/* ============================================================================
   SHOP PAGE — Direction A
   ============================================================================
   Phase 3 translation of shop.jsx into vanilla CSS. Editorial layout with the
   Direction A `--ps-*` palette. Selectors prefixed `ps-shop-*`. The cart
   contract and product-card DOM (rendered by shop.js) is preserved — legacy
   class names (.product-card, .cart-item, .product-modal-*, .review-*, etc.)
   are restyled here in the ps namespace so existing JS keeps working.
   ============================================================================ */

/* ─────────────────────────────────────────────────────────────────────────
   HERO
   ───────────────────────────────────────────────────────────────────────── */

.ps-shop-hero {
    padding: 88px 48px 40px;
    background: var(--ps-bg);
}

.ps-shop-hero-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 64px;
    align-items: end;
    max-width: var(--container-wide);
    margin: 0 auto;
}

.ps-shop-hero-text {
    min-width: 0;
}

.ps-shop-hero-title {
    font-family: var(--ps-font-display);
    font-size: clamp(48px, 8.5vw, 88px);
    letter-spacing: -0.032em;
    margin: 20px 0 24px;
    font-weight: 400;
    line-height: 0.96;
    color: var(--ps-ink);
}

.ps-shop-hero-title em {
    font-style: italic;
    color: var(--ps-teal);
}

.ps-shop-hero-lede {
    font-size: 18px;
    line-height: 1.6;
    color: var(--ps-ink-muted);
    max-width: 520px;
    margin: 0;
}

.ps-shop-hero-card {
    background: var(--ps-cream);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--ps-line);
}

.ps-shop-hero-card-eyebrow {
    display: block;
    font-size: 11px;
    color: var(--ps-teal);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.ps-shop-hero-card-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ps-ink);
    margin: 0;
}

.ps-shop-hero-card-body a {
    color: var(--ps-teal);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ─────────────────────────────────────────────────────────────────────────
   CONTROLS (search, sort, category chips)
   ───────────────────────────────────────────────────────────────────────── */

.ps-shop-controls {
    padding: 0 48px 24px;
    background: var(--ps-bg);
    max-width: var(--container-wide);
    margin: 0 auto;
}

.ps-shop-controls-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    margin-bottom: 20px;
    align-items: center;
}

.ps-shop-search {
    background: var(--ps-card);
    border: 1px solid var(--ps-line);
    border-radius: 999px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.ps-shop-search:focus-within {
    border-color: var(--ps-teal);
    box-shadow: 0 8px 24px rgba(14, 93, 89, 0.10);
}

.ps-shop-search > svg {
    color: var(--ps-ink-muted);
    flex-shrink: 0;
}

.ps-shop-search input {
    border: none;
    outline: none;
    flex: 1;
    background: transparent;
    font-size: 15px;
    color: var(--ps-ink);
    font-family: var(--ps-font-body);
    min-height: 44px;
}

.ps-shop-search input::placeholder { color: var(--ps-ink-muted); }

.ps-shop-search-clear {
    background: none;
    border: none;
    color: var(--ps-ink-muted);
    cursor: pointer;
    font-size: 22px;
    padding: 0 4px;
    line-height: 1;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    transition: background-color 150ms ease, color 150ms ease;
}

.ps-shop-search-clear:hover,
.ps-shop-search-clear:focus-visible {
    background: var(--ps-bg);
    color: var(--ps-ink);
    outline: none;
}

.ps-shop-sort-wrap { flex-shrink: 0; }

.ps-shop-sort-select {
    border: 1px solid var(--ps-line);
    background: var(--ps-card);
    border-radius: 999px;
    padding: 14px 44px 14px 24px;
    font-size: 14px;
    font-family: var(--ps-font-body);
    color: var(--ps-ink);
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A6563' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    min-height: 44px;
    transition: border-color 150ms ease, color 150ms ease;
}

.ps-shop-sort-select:hover { border-color: var(--ps-ink); }

.ps-shop-sort-select:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

/* Category chips */
.ps-shop-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-family: var(--ps-font-body);
    font-weight: 500;
    border: 1px solid var(--ps-line);
    background: transparent;
    color: var(--ps-ink);
    cursor: pointer;
    min-height: 40px;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.category-btn:hover { border-color: var(--ps-ink); }

.category-btn:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

.category-btn.active,
.category-btn[aria-pressed="true"] {
    background: var(--ps-ink);
    border-color: var(--ps-ink);
    color: #fff;
}

/* ─────────────────────────────────────────────────────────────────────────
   PRODUCT GRID + CARDS
   ───────────────────────────────────────────────────────────────────────── */

.ps-shop-products {
    padding: 16px 48px 96px;
    background: var(--ps-bg);
    min-height: 600px;
    max-width: var(--container-wide);
    margin: 0 auto;
}

.ps-shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.products-result-count {
    grid-column: 1 / -1;
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--ps-ink-muted);
}

/* Product card (rendered by shop.js with class .product-card) */
.product-card {
    background: var(--ps-card);
    border-radius: 16px;
    border: 1px solid var(--ps-line);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: box-shadow 200ms ease, border-color 150ms ease, transform 200ms ease;
    position: relative;
}

.product-card:hover {
    box-shadow: var(--ps-shadow-lift);
    border-color: var(--ps-line-strong);
    transform: translateY(-2px);
}

.product-card:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

/* Image / placeholder — gradient with serif initial letter */
.product-image {
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, var(--ps-teal-light) 0%, var(--ps-cream) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image img {
    max-width: 75%;
    max-height: 75%;
    object-fit: contain;
}

.product-image-placeholder {
    /* SVG is hidden; we render the serif initial letter via ::before based on first product letter.
       Since shop.js can't easily set the letter, we display a stylized SVG token instead. */
    color: var(--ps-teal);
    opacity: 0.4;
}

.product-image-placeholder svg {
    width: 64px;
    height: 64px;
}

/* Product badges (top-left chip) */
.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    z-index: 1;
    max-width: calc(100% - 24px);
}

.product-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ps-ink-muted);
    padding: 4px 10px;
    border-radius: 999px;
}

.badge-bestseller { background: var(--ps-mint); color: var(--ps-teal-deep); }
.badge-new        { background: var(--ps-teal-light); color: var(--ps-teal-deep); }
.badge-sale       { background: var(--ps-badge-sale-bg); color: var(--ps-accent-on-cream); }
.badge-fsa-eligible,
.badge-fsa_eligible { background: var(--ps-cream); color: var(--ps-ink); }
.badge-popular     { background: var(--ps-sand); color: var(--ps-ink); }
.badge-age-restricted { background: var(--ps-badge-age-bg); color: var(--ps-badge-age-text); }
.badge-pickup-only    { background: var(--ps-badge-pickup-bg); color: var(--ps-accent-on-cream); }

/* Product info */
.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.product-name-heading {
    margin: 0;
}

/* Product name is a <button> (inside an h3 heading) so keyboard users can
   open the detail modal directly without triggering axe's nested-interactive
   rule on the parent card. Button styling is reset to match the old heading. */
.product-name {
    font-family: var(--ps-font-display);
    font-size: 20px;
    letter-spacing: -0.015em;
    line-height: 1.2;
    color: var(--ps-ink);
    margin: 0;
    font-weight: 400;
    /* Two-line clamp keeps cards even */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Button resets */
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.product-name:hover {
    color: var(--ps-teal-deep);
}

.product-name:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
    border-radius: 2px;
}

.product-brand {
    font-size: 12px;
    color: var(--ps-ink-muted);
    margin: 0;
}

.product-price-row {
    margin-top: 10px;
    font-family: var(--ps-font-display);
    font-size: 26px;
    color: var(--ps-ink);
    letter-spacing: -0.018em;
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.product-price-sale {
    color: var(--ps-accent-on-cream);
}

.product-price-original {
    font-family: var(--ps-font-body);
    font-size: 14px;
    color: var(--ps-ink-soft);
    text-decoration: line-through;
}

.product-out-of-stock {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-error);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-low-stock {
    font-size: 12px;
    color: var(--ps-accent-on-cream);
    margin-top: 4px;
    font-weight: 500;
}

.product-qty-limit {
    font-size: 11px;
    color: var(--ps-ink-soft);
    margin-top: 4px;
}

/* Actions row — Add+ button OR qty controls */
.product-actions {
    padding: 0 20px 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: auto;
}

.product-add-btn {
    background: var(--ps-ink);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--ps-font-body);
    cursor: pointer;
    min-height: 40px;
    min-width: 72px;
    transition: background-color 150ms ease;
}

.product-add-btn:hover { background: var(--ps-teal-deep); }

.product-add-btn:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

.product-add-btn:disabled {
    background: var(--ps-line-strong);
    color: var(--ps-ink-muted);
    cursor: not-allowed;
}

.product-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ps-cream);
    border-radius: 999px;
    padding: 4px;
}

.product-qty-controls .qty-btn {
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-family: var(--ps-font-body);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 150ms ease, color 150ms ease;
}

.product-qty-controls .qty-minus {
    background: #fff;
    color: var(--ps-ink);
}

.product-qty-controls .qty-minus:hover { background: var(--ps-bg); }

.product-qty-controls .qty-plus {
    background: var(--ps-ink);
    color: #fff;
}

.product-qty-controls .qty-plus:hover { background: var(--ps-teal-deep); }

.product-qty-controls .qty-plus:disabled {
    background: var(--ps-line-strong);
    cursor: not-allowed;
}

.product-qty-controls .qty-btn:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

.product-qty-controls .qty-display {
    font-size: 14px;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
    color: var(--ps-ink);
}

/* Empty / error / loading */
.ps-shop-loading {
    /* Skeleton wrapper styled by ps-shop-grid */
}

.ps-shop-skeleton-card {
    background: var(--ps-card);
    border: 1px solid var(--ps-line);
    border-radius: 16px;
    overflow: hidden;
    padding: 0 0 20px;
}

.ps-shop-skeleton-img {
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, var(--ps-teal-light) 0%, var(--ps-cream) 100%);
}

.ps-shop-skeleton-line {
    height: 1rem;
    margin: 16px 20px 0;
    border-radius: 4px;
    background: var(--ps-line);
}

.skeleton-pulse {
    animation: ps-shop-pulse 1.4s ease-in-out infinite;
}

@keyframes ps-shop-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

.ps-shop-empty,
.ps-shop-error {
    background: var(--ps-card);
    border: 1px solid var(--ps-line);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    color: var(--ps-ink-muted);
}

.ps-shop-empty h3,
.ps-shop-error h3 {
    font-family: var(--ps-font-display);
    font-size: 28px;
    color: var(--ps-ink);
    margin: 0 0 8px;
    font-weight: 400;
}

.ps-shop-empty p,
.ps-shop-error p {
    font-size: 15px;
    margin: 0 0 20px;
}

.ps-shop-empty-btn {
    background: var(--ps-ink);
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--ps-font-body);
    cursor: pointer;
    min-height: 44px;
    transition: background-color 150ms ease;
}

.ps-shop-empty-btn:hover { background: var(--ps-teal-deep); }

.ps-shop-empty-btn:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

.ps-shop-error-help {
    margin-top: 20px;
    font-size: 13px;
}

.ps-shop-error-help a {
    color: var(--ps-teal);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ─────────────────────────────────────────────────────────────────────────
   FLOATING CART FAB (bottom-right)
   ───────────────────────────────────────────────────────────────────────── */

.ps-shop-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--z-toast);
    background: var(--ps-ink);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 22px 14px 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 20px 50px rgba(15, 30, 28, 0.25);
    font-family: var(--ps-font-body);
    font-size: 14px;
    font-weight: 500;
    min-height: 52px;
    transition: background-color 150ms ease, transform 200ms ease;
}

.ps-shop-fab:hover { background: var(--ps-teal-deep); transform: translateY(-2px); }

.ps-shop-fab:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 3px;
}

.ps-shop-fab-icon {
    color: var(--ps-mint);
    flex-shrink: 0;
}

.ps-shop-fab-count {
    background: var(--ps-mint);
    color: var(--ps-teal-deep);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
    line-height: 1.4;
}

.ps-shop-fab .ps-shop-fab-count[aria-hidden="true"] {
    display: none;
}

/* ─────────────────────────────────────────────────────────────────────────
   CART DRAWER + OVERLAY
   ───────────────────────────────────────────────────────────────────────── */

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 28, 0.45);
    z-index: var(--z-overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

.cart-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 440px;
    height: 100vh;
    background: var(--ps-card);
    z-index: calc(var(--z-overlay) + 10);
    display: flex;
    flex-direction: column;
    transition: right 280ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(15, 30, 28, 0.16);
}

.cart-drawer.open { right: 0; }

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--ps-line);
}

.cart-header h2 {
    font-family: var(--ps-font-display);
    font-size: 24px;
    font-weight: 400;
    letter-spacing: -0.018em;
    color: var(--ps-ink);
    margin: 0;
}

.cart-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ps-ink-muted);
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 150ms ease, color 150ms ease;
}

.cart-close-btn:hover { background: var(--ps-bg); color: var(--ps-ink); }

.cart-close-btn:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.cart-empty {
    text-align: center;
    padding: 48px 0;
    color: var(--ps-ink-muted);
    font-size: 15px;
}

.cart-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--ps-line);
}

.cart-item:last-of-type { border-bottom: none; }

.cart-item-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.cart-item-name {
    font-weight: 500;
    color: var(--ps-ink);
    font-size: 14px;
    line-height: 1.4;
}

.cart-item-price {
    font-family: var(--ps-font-display);
    font-size: 18px;
    color: var(--ps-ink);
    letter-spacing: -0.012em;
    flex-shrink: 0;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-item-controls .qty-btn {
    background: var(--ps-cream);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: var(--ps-ink);
    line-height: 1;
    transition: background-color 150ms ease;
}

.cart-item-controls .qty-btn:hover { background: var(--ps-sand); }

.cart-item-controls .qty-btn:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

.cart-item-controls .qty-display {
    font-size: 14px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    color: var(--ps-ink);
}

.cart-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ps-ink-muted);
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    border-radius: 50%;
    transition: background-color 150ms ease, color 150ms ease;
}

.cart-item-remove:hover {
    background: var(--ps-bg);
    color: var(--color-error);
}

.cart-item-remove:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

/* Cart footer */
.cart-footer {
    padding: 20px 24px 24px;
    border-top: 1px solid var(--ps-line);
    background: var(--ps-bg);
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
    color: var(--ps-ink-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 14px;
}

.cart-subtotal #cart-subtotal-amount {
    font-family: var(--ps-font-display);
    font-size: 28px;
    font-weight: 400;
    color: var(--ps-ink);
    letter-spacing: -0.018em;
    text-transform: none;
    letter-spacing: -0.018em;
}

/* Shipping progress */
.shipping-progress-wrap { margin-bottom: 18px; }

.shipping-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.shipping-progress-label {
    font-size: 12px;
    color: var(--ps-ink-muted);
    font-weight: 500;
}

.shipping-progress-amount {
    font-size: 11px;
    color: var(--ps-ink-soft);
}

.shipping-progress-wrap.free .shipping-progress-label {
    color: var(--ps-teal);
    font-weight: 600;
}

.shipping-progress-track {
    height: 6px;
    background: var(--ps-line);
    border-radius: 999px;
    overflow: hidden;
}

.shipping-progress-fill {
    height: 100%;
    background: var(--ps-teal);
    border-radius: 999px;
    transition: width 400ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: width;
    width: 0%;
}

.shipping-progress-fill.full { background: var(--ps-mint); }

@media (prefers-reduced-motion: reduce) {
    .shipping-progress-fill { transition: none; }
}

/* Email row */
.cart-email-row { margin-bottom: 14px; }

.cart-email-row label {
    display: block;
    font-size: 12px;
    color: var(--ps-ink-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.cart-email-row input {
    width: 100%;
    padding: 12px 16px;
    min-height: 44px;
    border: 1px solid var(--ps-line);
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--ps-font-body);
    background: var(--ps-card);
    color: var(--ps-ink);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.cart-email-row input:focus {
    border-color: var(--ps-teal);
    box-shadow: 0 0 0 3px rgba(14, 93, 89, 0.12);
    outline: none;
}

.cart-email-row input:focus-visible {
    outline: none;
}

.cart-email-row input.input-error { border-color: var(--color-error); }

.cart-email-error {
    display: none;
    font-size: 12px;
    color: var(--color-error);
    margin-top: 6px;
}

.cart-checkout-btn {
    width: 100%;
    background: var(--ps-ink);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--ps-font-body);
    cursor: pointer;
    min-height: 48px;
    margin-bottom: 12px;
    transition: background-color 150ms ease;
}

.cart-checkout-btn:hover { background: var(--ps-teal-deep); }

.cart-checkout-btn:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

.cart-secure-note {
    text-align: center;
    font-size: 12px;
    color: var(--ps-ink-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
}

.checkout-error-toast {
    background: var(--ps-color-error-soft-bg);
    color: var(--color-error);
    border: 1px solid var(--ps-color-error-soft-border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 12px;
    animation: ps-shop-fade-in 200ms ease-in;
}

@keyframes ps-shop-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────────────────────
   PRODUCT DETAIL MODAL
   ───────────────────────────────────────────────────────────────────────── */

.product-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 28, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--z-modal);
    padding: 24px;
}

.product-modal-content {
    background: var(--ps-card);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(15, 30, 28, 0.30);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.product-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--ps-ink-muted);
    cursor: pointer;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 1;
    transition: background-color 150ms ease, color 150ms ease;
}

.product-modal-close:hover { background: var(--ps-bg); color: var(--ps-ink); }

.product-modal-close:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

.product-modal-body {
    display: flex;
    padding: 32px;
    padding-bottom: 16px;
    overflow-y: auto;
    flex: 1;
    gap: 24px;
}

.product-modal-image-wrap {
    position: relative;
    flex: 0 0 200px;
}

.product-modal-image-wrap img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--ps-teal-light) 0%, var(--ps-cream) 100%);
}

.product-modal-badge-wrap {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.product-modal-details {
    flex: 1;
    min-width: 0;
}

.product-modal-name {
    font-family: var(--ps-font-display);
    font-size: 28px;
    font-weight: 400;
    letter-spacing: -0.020em;
    color: var(--ps-ink);
    margin: 0 0 4px;
    padding-right: 32px;
    line-height: 1.15;
}

.product-modal-brand {
    font-size: 13px;
    color: var(--ps-ink-muted);
    margin: 0 0 16px;
}

.product-modal-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ps-ink);
    margin: 0;
}

.product-modal-meta {
    margin-top: 16px;
    font-size: 13px;
}

.product-modal-meta p { margin: 4px 0; }

.product-modal-stock {
    font-weight: 600;
    color: var(--ps-teal);
}

.product-modal-stock.out-of-stock { color: var(--color-error); }

.product-modal-restriction {
    color: var(--ps-accent-on-cream);
    font-size: 12px;
}

.product-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px 24px;
    border-top: 1px solid var(--ps-line);
    background: var(--ps-bg);
    gap: 16px;
    flex-wrap: wrap;
}

.product-modal-price {
    font-family: var(--ps-font-display);
    font-size: 32px;
    font-weight: 400;
    color: var(--ps-ink);
    letter-spacing: -0.020em;
}

.product-modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-modal-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-modal-qty label {
    font-size: 13px;
    color: var(--ps-ink-muted);
    font-weight: 500;
}

.product-modal-qty input {
    width: 64px;
    padding: 8px;
    min-height: 44px;
    text-align: center;
    border: 1px solid var(--ps-line);
    border-radius: 10px;
    font-size: 15px;
    font-family: var(--ps-font-body);
    color: var(--ps-ink);
    background: var(--ps-card);
}

.product-modal-qty input:focus {
    border-color: var(--ps-teal);
    box-shadow: 0 0 0 3px rgba(14, 93, 89, 0.12);
    outline: none;
}

.product-modal-add-btn {
    background: var(--ps-ink);
    color: #fff;
    border: none;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--ps-font-body);
    border-radius: 999px;
    min-height: 44px;
    cursor: pointer;
    transition: background-color 150ms ease;
}

.product-modal-add-btn:hover { background: var(--ps-teal-deep); }

.product-modal-add-btn:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

.product-modal-add-btn:disabled {
    background: var(--ps-line-strong);
    color: var(--ps-ink-muted);
    cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────────────────
   ORDER REVIEW PANEL
   ───────────────────────────────────────────────────────────────────────── */

.review-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 28, 0.5);
    z-index: calc(var(--z-overlay) + 20);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

.review-overlay.open { opacity: 1; pointer-events: auto; }

.review-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: var(--ps-card);
    z-index: calc(var(--z-overlay) + 30);
    display: none;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(15, 30, 28, 0.18);
}

.review-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ps-line);
}

.review-panel-header h2 {
    font-family: var(--ps-font-display);
    font-size: 24px;
    font-weight: 400;
    letter-spacing: -0.018em;
    color: var(--ps-ink);
    margin: 0;
}

.review-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ps-ink-muted);
    padding: 8px 12px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--ps-font-body);
    border-radius: 999px;
    transition: background-color 150ms ease, color 150ms ease;
}

.review-back-btn:hover { background: var(--ps-bg); color: var(--ps-ink); }

.review-back-btn:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

.review-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.review-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--ps-line);
}

.review-item:last-child { border-bottom: none; }

.review-item-thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--ps-teal-light) 0%, var(--ps-cream) 100%);
}

.review-item-thumb img { width: 100%; height: 100%; object-fit: cover; }

.review-item-thumb-placeholder { width: 100%; height: 100%; }

.review-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.review-item-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--ps-ink);
}

.review-item-unit {
    font-size: 12px;
    color: var(--ps-ink-muted);
}

.review-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.review-item-qty {
    font-size: 12px;
    color: var(--ps-ink-muted);
}

.review-item-total {
    font-family: var(--ps-font-display);
    font-size: 18px;
    color: var(--ps-ink);
    letter-spacing: -0.012em;
}

.review-panel-footer {
    padding: 20px 24px 24px;
    border-top: 1px solid var(--ps-line);
    background: var(--ps-bg);
}

.review-line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--ps-ink-muted);
    margin-bottom: 8px;
}

.review-shipping { color: var(--ps-ink-muted); }

.review-total {
    font-family: var(--ps-font-display);
    font-size: 22px;
    font-weight: 400;
    color: var(--ps-ink);
    letter-spacing: -0.018em;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ps-line);
}

.review-stock-error {
    background: var(--ps-color-error-soft-bg);
    color: var(--color-error);
    border: 1px solid var(--ps-color-error-soft-border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 12px;
}

.review-confirm-btn {
    width: 100%;
    background: var(--ps-ink);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--ps-font-body);
    cursor: pointer;
    min-height: 48px;
    margin-top: 4px;
    transition: background-color 150ms ease;
}

.review-confirm-btn:hover { background: var(--ps-teal-deep); }

.review-confirm-btn:focus-visible {
    outline: 2px solid var(--ps-teal);
    outline-offset: 2px;
}

.review-confirm-btn:disabled {
    background: var(--ps-line-strong);
    cursor: not-allowed;
}

.ps-shop-review-note {
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    color: var(--ps-ink-muted);
    line-height: 1.5;
}

.ps-shop-review-note a {
    color: var(--ps-teal);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ─────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
    .ps-shop-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
    .ps-shop-hero-inner { grid-template-columns: 1fr; gap: 32px; align-items: start; }
    .ps-shop-hero-card  { max-width: 520px; }
}

@media (max-width: 768px) {
    .ps-shop-hero,
    .ps-shop-controls,
    .ps-shop-products { padding-left: 24px; padding-right: 24px; }
    .ps-shop-hero { padding-top: 40px; padding-bottom: 24px; }
    .ps-shop-controls-row { grid-template-columns: 1fr; }
    .ps-shop-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .ps-shop-hero-title { font-size: clamp(40px, 12vw, 64px); }

    .product-modal-overlay { padding: 0; align-items: stretch; }
    .product-modal-content { border-radius: 0; width: 100%; height: 100%; max-height: 100%; max-width: 100%; }
    .product-modal-body { flex-direction: column; padding: 24px; }
    .product-modal-image-wrap { flex-basis: auto; max-width: 240px; margin: 0 auto; }
    .product-modal-footer { flex-direction: column; align-items: stretch; padding: 16px 24px 24px; }
    .product-modal-price { text-align: center; }
    .product-modal-actions { justify-content: space-between; }
    .product-modal-add-btn { flex: 1; }

    .ps-shop-fab {
        bottom: 16px;
        right: 16px;
        padding: 12px 18px 12px 16px;
    }
}

@media (max-width: 480px) {
    .ps-shop-grid { grid-template-columns: 1fr; }
    .ps-shop-hero,
    .ps-shop-controls,
    .ps-shop-products { padding-left: 20px; padding-right: 20px; }
    .product-info { padding: 16px; }
    .product-actions { padding: 0 16px 16px; }
}

/* Tighter cart drawer on phones */
@media (max-width: 480px) {
    .cart-drawer { max-width: 100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-add-btn,
    .product-qty-controls .qty-btn,
    .ps-shop-fab,
    .ps-shop-empty-btn,
    .cart-checkout-btn,
    .review-confirm-btn,
    .product-modal-add-btn,
    .ps-shop-search,
    .ps-shop-search-clear,
    .ps-shop-sort-select,
    .category-btn,
    .cart-overlay,
    .cart-drawer,
    .review-overlay,
    .product-modal-close,
    .review-back-btn,
    .cart-close-btn,
    .cart-item-controls .qty-btn,
    .cart-item-remove,
    .checkout-error-toast,
    .cart-email-row input,
    .product-modal-qty input { transition: none; animation: none; }

    .skeleton-pulse { animation: none; }
}
