/* =====================================================================
   &Nuts polish layer: loaded last on every page.
   Keeps the existing burgundy / cream / gold design and only refines:
   readability, touch comfort, feedback, motion and keyboard focus.
   Remove the <link> to polish.css to turn it all off.
   ===================================================================== */

/* ---------- Rendering ---------- */
html {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
::selection {
    background: rgba(204, 172, 111, 0.35);
    color: var(--text-main, #2d0610);
}
img {
    -webkit-user-drag: none;
}

/* Prices: numbers line up and don't jiggle when they change */
.pc-price, .current-price, .original-price, #ppCurrentPrice, #ppOriginalPrice,
.pp-sticky-bar__price, .cart-item-price, #checkoutSubtotal, #checkoutTax,
#checkoutShipping, #checkoutTotal, .fh-qty-pill__count {
    font-variant-numeric: tabular-nums lining-nums;
}

/* ---------- Keyboard focus (visible only when using a keyboard) ---------- */
:where(a, button, input, select, textarea, [role="button"], [tabindex]):focus-visible {
    outline: 2px solid var(--accent-gold, #CCAC6F);
    outline-offset: 3px;
    border-radius: 8px;
}
:where(a, button, [role="button"]):focus:not(:focus-visible) {
    outline: none;
}

/* ---------- Press feedback: every tap feels answered ---------- */
:where(button, .pp-btn-cart, .auth-continue-btn, .auth-alt-btn, .pc-variant-btn,
       .pp-variant-btn, .bottom-nav-link, .cart-icon-wrapper, .btn, .btn-primary):active {
    transform: scale(0.97);
}
:where(button, .pp-btn-cart, .auth-continue-btn, .auth-alt-btn, .pc-variant-btn,
       .pp-variant-btn, .bottom-nav-link, .btn, .btn-primary) {
    transition: transform 0.12s ease, background-color 0.2s ease, color 0.2s ease,
                border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ---------- Product cards: calm lift on hover (mouse only) ---------- */
@media (hover: hover) and (pointer: fine) {
    .product-card,
    .p-card-compact {
        transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease;
        will-change: transform;
    }
    .product-card:hover,
    .p-card-compact:hover {
        transform: translateY(-4px);
        box-shadow: 0 14px 34px rgba(93, 12, 29, 0.12);
    }
    .product-card img,
    .p-card-compact img {
        transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
    }
    .product-card:hover img,
    .p-card-compact:hover img {
        transform: scale(1.04);
    }
}

/* ---------- Phones & tablets: comfortable touch targets, readable small text ---------- */
@media (max-width: 820px) {
    /* Header icons: 44px invisible touch area, same look */
    .nav-icons [role="button"],
    .nav-icons .cart-icon-wrapper,
    #mobileMenuBtn {
        position: relative;
    }
    .nav-icons [role="button"]::after,
    .nav-icons .cart-icon-wrapper::after,
    #mobileMenuBtn::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 44px;
        height: 44px;
        transform: translate(-50%, -50%);
    }

    /* Small labels: never below ~10.5px */
    .pc-ribbon, .discount-ribbon {
        font-size: 10.5px !important;
        letter-spacing: 0.04em;
        padding: 4px 9px !important;
    }
    .pc-rating-score, .pc-rating-count {
        font-size: 11px !important;
    }
    .pc-desc, .original-price {
        font-size: 12px !important;
    }
    .category-name {
        font-size: 11.5px !important;
        line-height: 1.25;
    }
    .fixed-bottom-nav .bottom-nav-link span,
    .fixed-bottom-nav span {
        font-size: 10.5px !important;
        letter-spacing: 0.01em;
    }

    /* Size buttons on cards and the product page: easier to hit */
    .pc-variant-btn {
        min-height: 32px !important;
        font-size: 11px !important;
        border-radius: 10px !important;
    }
    .pp-variant-btn {
        min-height: 40px;
        min-width: 64px;
    }

    /* Quantity pill on product cards: 34px buttons instead of 24px */
    .product-card .fh-qty-pill__trash,
    .product-card .fh-qty-pill__plus,
    .p-card-compact .fh-qty-pill__trash,
    .p-card-compact .fh-qty-pill__plus {
        width: 34px !important;
        height: 34px !important;
    }

    /* "Add to cart" on product cards */
    .p-card-compact .pc-btn {
        min-height: 38px;
        font-size: 12px !important;
        letter-spacing: 0.02em;
    }

    /* Links inside running text */
    .pp-assurance a,
    .breadcrumb a {
        padding: 6px 0;
        display: inline-block;
    }
}

/* ---------- Smooth scrolling and motion preferences ---------- */
@media (prefers-reduced-motion: no-preference) {
    html:not(.lenis) {
        scroll-behavior: smooth;
    }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Desktop scrollbar in brand colours ---------- */
@media (hover: hover) and (pointer: fine) {
    html {
        scrollbar-color: rgba(93, 12, 29, 0.35) transparent;
        scrollbar-width: thin;
    }
}

/* ---------- Scroll reveals: quicker, gentler, no "transition: all" ---------- */
:root {
    --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
}
.reveal-up {
    transform: translateY(16px) !important;
    transition: opacity 600ms var(--ease-out-strong), transform 600ms var(--ease-out-strong) !important;
}
.reveal-up.active {
    transform: translateY(0) !important;
}
@media (prefers-reduced-motion: reduce) {
    .reveal-up,
    .reveal-up.active {
        transform: none !important;
        transition: opacity 200ms ease !important;
    }
}
