/* ============================================================
   Pets on the Road – Webshop stylesheet
   File: assets/css/shop.css
   Enqueue via functions.php (see shop-functions.php)
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
    --potr-accent:        #c8956a;
    --potr-accent-dark:   #a06840;
    --potr-accent-light:  #f5ede3;
    --potr-accent-border: #d4a87a;

    --potr-card-bg:       #1e1c1a;
    --potr-card-border:   rgba(255,255,255,0.08);
    --potr-card-radius:   18px;

    --potr-text-on-dark:  #f0ece6;
    --potr-muted-on-dark: rgba(240,236,230,0.55);

    --potr-badge-bg:      rgba(255,255,255,0.09);
    --potr-badge-border:  rgba(200,149,106,0.45);
    --potr-badge-text:    #e8c9a8;

    --potr-btn-radius:    999px;
    --potr-transition:    0.18s ease;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.potr-shop {
    width: 100%;
    min-height: 60vh;
}

.potr-shop__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

/* ── Page title ─────────────────────────────────────────────────────────── */
.potr-shop__header {
    margin-bottom: 1.75rem;
}

.potr-shop__title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    color: var(--e-global-color-accent, #c8956a);
    margin: 0;
    line-height: 1.15;
}

/* ── Category nav ───────────────────────────────────────────────────────── */
.potr-cat-nav {
    margin-bottom: 2rem;
}

.potr-cat-nav__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--potr-accent-dark);
    margin: 0 0 10px;
}

.potr-cat-nav__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.potr-cat-nav__divider {
    border: none;
    border-top: 1px solid rgba(200,149,106,0.2);
    margin: 14px 0 14px;
}

/* pills */
.potr-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 500;
    white-space: nowrap;
    transition: background var(--potr-transition), color var(--potr-transition), border-color var(--potr-transition);
    line-height: 1.2;
}

.potr-pill--top {
    background: var(--potr-accent-light);
    border: 1.5px solid var(--potr-accent-border);
    color: #7a4a28;
    font-size: 14px;
    padding: 7px 16px;
}
.potr-pill--top:hover,
.potr-pill--top.is-active {
    background: var(--potr-accent);
    border-color: var(--potr-accent-dark);
    color: #fff;
}

.potr-pill--sub {
    background: transparent;
    border: 1px solid var(--potr-accent-border);
    color: var(--potr-accent-dark);
    font-size: 13px;
    padding: 5px 14px;
}
.potr-pill--sub:hover,
.potr-pill--sub.is-active {
    background: var(--potr-accent-light);
    color: #7a4a28;
}

.potr-pill__count {
    background: rgba(255,255,255,0.35);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    padding: 1px 7px;
    min-width: 18px;
    text-align: center;
    color: inherit;
}
.potr-pill--top.is-active .potr-pill__count {
    background: rgba(255,255,255,0.25);
}

/* ── Product grid ───────────────────────────────────────────────────────── */
.potr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (min-width: 560px)  { .potr-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; } }
@media (min-width: 768px)  { .potr-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; } }
@media (min-width: 1100px) { .potr-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 24px; } }

/* ── Product card ───────────────────────────────────────────────────────── */
.potr-card {
    background: var(--potr-card-bg);
    border: 1px solid var(--potr-card-border);
    border-radius: var(--potr-card-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--potr-transition), transform var(--potr-transition);
    position: relative;
}

.potr-card:hover {
    border-color: rgba(200,149,106,0.5);
    transform: translateY(-2px);
}

.potr-card--soldout {
    opacity: 0.82;
}

/* image */
.potr-card__img-link {
    display: block;
    text-decoration: none;
}

.potr-card__img-wrap {
    position: relative;
    overflow: hidden;
    background: #f5ede3;
    aspect-ratio: 1 / 1;
}

.potr-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.potr-card:hover .potr-card__img-wrap img {
    transform: scale(1.04);
}

.potr-card__img-placeholder {
    width: 100%;
    height: 100%;
    background: #ede4d8;
}

/* sold-out pill on image */
.potr-card__soldout-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #1e1c1a;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    z-index: 1;
}

/* body */
.potr-card__body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
}

/* attribute badges */
.potr-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.potr-badge {
    display: inline-block;
    background: var(--potr-badge-bg);
    border: 1px solid var(--potr-badge-border);
    color: var(--potr-badge-text);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    white-space: nowrap;
}

/* title */
.potr-card__title-link {
    text-decoration: none;
}

.potr-card__title {
    font-size: clamp(14px, 1.5vw, 16px);
    font-weight: 600;
    color: var(--potr-text-on-dark);
    margin: 0;
    line-height: 1.3;
}

.potr-card__title-link:hover .potr-card__title {
    color: var(--potr-accent);
}

/* price */
.potr-card__price {
    font-size: 14px;
    font-weight: 500;
    color: var(--potr-accent);
    margin: 0;
}

.potr-card__price del {
    color: var(--potr-muted-on-dark);
    font-weight: 400;
    font-size: 13px;
}

.potr-card__price ins {
    text-decoration: none;
}

/* footer / button area */
.potr-card__footer {
    margin-top: auto;
    padding-top: 4px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.potr-btn {
    display: block;
    width: 100%;
    text-align: center;
    border-radius: var(--potr-btn-radius);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background var(--potr-transition), color var(--potr-transition), opacity var(--potr-transition);
    line-height: 1.2;
    letter-spacing: 0.01em;
}

/* primary – simple product ATC */
.potr-btn--primary {
    background: transparent;
    color: var(--potr-text-on-dark);
    border: 1.5px solid rgba(255,255,255,0.18);
}
.potr-btn--primary:hover {
    background: var(--potr-accent);
    border-color: var(--potr-accent);
    color: #fff;
}

/* loading state */
.potr-btn--primary.is-loading {
    opacity: 0.6;
    pointer-events: none;
}
.potr-btn--primary.is-loading::after {
    content: ' ·';
    animation: potr-dots 1s infinite;
}
@keyframes potr-dots {
    0%   { content: ' ·'; }
    33%  { content: ' ··'; }
    66%  { content: ' ···'; }
}

/* success state */
.potr-btn--primary.is-added {
    background: #2e6b3e;
    border-color: #2e6b3e;
    color: #fff;
    pointer-events: none;
}

/* outline – variable product link */
.potr-btn--outline {
    background: transparent;
    color: var(--potr-text-on-dark);
    border: 1.5px solid rgba(255,255,255,0.18);
}
.potr-btn--outline:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}

/* disabled */
.potr-btn--disabled {
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.08);
    color: var(--potr-muted-on-dark);
    cursor: not-allowed;
}

/* ── Pagination ─────────────────────────────────────────────────────────── */
.potr-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 3rem;
}

.potr-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid rgba(200,149,106,0.25);
    color: var(--potr-accent-dark);
    transition: all var(--potr-transition);
}

.potr-pagination .page-numbers:hover,
.potr-pagination .page-numbers.current {
    background: var(--potr-accent);
    border-color: var(--potr-accent);
    color: #fff;
}

/* ── Empty state ────────────────────────────────────────────────────────── */
.potr-empty {
    text-align: center;
    color: var(--potr-muted-on-dark);
    font-size: 16px;
    padding: 4rem 0;
}

/* ── Header icons shortcode ([shop_icons]) ──────────────────────────────── */
.potr-header-icons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

/* Shared: remove underline on icon links */
.potr-cart-icon,
.potr-account-icon {
    text-decoration: none;
}

/* Cart count badge */
.potr-cart-icon__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--potr-accent);
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    line-height: 1;
}

.potr-cart-icon:hover .potr-cart-icon__count,
.potr-cart-icon.is-active .potr-cart-icon__count {
    background: #fff;
    color: var(--potr-accent-dark);
}

/* Search wrap: toggle button + expandable form sit side-by-side */
.potr-search-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.potr-search-toggle {
    cursor: pointer;
}

/* Hidden by default; shown when .is-open is added by JS */
.potr-search-form {
    display: none;
    align-items: center;
    gap: 4px;
    background: var(--potr-accent-light);
    border: 1.5px solid var(--potr-accent-border);
    border-radius: 999px;
    padding: 0 6px 0 16px;
    height: 36px; /* matches pill height */
}

.potr-search-wrap.is-open .potr-search-toggle {
    display: none;
}

.potr-search-wrap.is-open .potr-search-form {
    display: inline-flex;
}

.potr-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    font-weight: 500;
    color: #7a4a28;
    width: 160px;
    min-width: 0;
    padding: 0;
    line-height: 1;
}

.potr-search-input::placeholder {
    color: var(--potr-accent-dark);
    opacity: 0.6;
}

.potr-search-submit {
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7a4a28;
    padding: 5px;
    border-radius: 999px;
    transition: color var(--potr-transition);
    flex-shrink: 0;
}

.potr-search-submit:hover {
    color: var(--potr-accent-dark);
}

@media (max-width: 480px) {
    .potr-search-input {
        width: 120px;
    }
}

/* ── Toast notification ─────────────────────────────────────────────────── */
.potr-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1e1c1a;
    color: #f0ece6;
    border: 1px solid rgba(200,149,106,0.4);
    border-radius: 999px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}
.potr-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
