/* ===== DripFit Enhancements (mobile-first) ===== */

:root {
    --df-touch: 44px;
    --df-bottom-nav-h: 64px;
    --df-ease: cubic-bezier(.22,.61,.36,1);
}

/* iOS safe areas */
@supports (padding: max(0px)) {
    body { padding-bottom: env(safe-area-inset-bottom); }
}

/* Smooth scroll + better tap defaults */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ===== Sticky / scrolled navbar ===== */
.navbar {
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    background: rgba(255,255,255,0.85);
}
.navbar.scrolled {
    background: rgba(255,255,255,0.96);
    box-shadow: 0 2px 14px rgba(0,0,0,0.08);
}

/* ===== Page transitions ===== */
.page.active {
    animation: dfFadeUp .35s var(--df-ease) both;
}
@keyframes dfFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ===== Toast notifications ===== */
.df-toast-stack {
    position: fixed;
    left: 50%;
    bottom: calc(var(--df-bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 4000;
    pointer-events: none;
    width: min(92vw, 420px);
}
.df-toast {
    background: #111;
    color: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(20px);
    opacity: 0;
    transition: transform .3s var(--df-ease), opacity .3s var(--df-ease);
    pointer-events: auto;
}
.df-toast.show { opacity: 1; transform: none; }
.df-toast.success { background: #0f7b4f; }
.df-toast.error { background: #b32a2a; }
.df-toast i { font-size: 1.1rem; }

/* Hide the legacy in-page success message — superseded by toast */
.success-message { display: none !important; }

/* ===== Wishlist heart on product cards ===== */
.product-image, .shop-product-image {
    position: relative;
}
.df-wish-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.92);
    color: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: transform .2s var(--df-ease), background .2s, color .2s;
}
.df-wish-btn:hover { transform: scale(1.08); }
.df-wish-btn.active { color: #e0245e; background: #fff; }
.df-wish-btn.pulse { animation: dfPulse .45s var(--df-ease); }
@keyframes dfPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Image hover behavior is handled in home.css/shop.css (editorial cards w/ hover-swap) */

/* ===== Lazy-load fade-in ===== */
img.df-lazy { opacity: 0; transition: opacity .4s ease; }
img.df-lazy.df-loaded { opacity: 1; }

/* ===== Skeleton screens ===== */
.df-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    padding: 1rem 0;
}
.df-skel-card {
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
}
.df-skel-img {
    aspect-ratio: 1/1;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 200% 100%;
    animation: dfShimmer 1.2s linear infinite;
}
.df-skel-line {
    height: 12px;
    margin: 12px;
    border-radius: 6px;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 200% 100%;
    animation: dfShimmer 1.2s linear infinite;
}
.df-skel-line.short { width: 40%; }
@keyframes dfShimmer {
    to { background-position: -200% 0; }
}

/* ===== Search overlay ===== */
.df-search-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--primary-black);
    padding: 0.5rem;
    min-width: var(--df-touch);
    min-height: var(--df-touch);
    display: flex;
    align-items: center;
    justify-content: center;
}
.df-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    z-index: 5000;
    display: none;
    flex-direction: column;
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top));
}
.df-search-overlay.open { display: flex; animation: dfFadeUp .25s var(--df-ease) both; }
.df-search-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 2px solid #111;
    padding: .75rem 0;
}
.df-search-bar input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: inherit;
    color: #111;
    min-height: var(--df-touch);
}
.df-search-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    min-width: var(--df-touch);
    min-height: var(--df-touch);
}
.df-search-results {
    flex: 1;
    overflow-y: auto;
    margin-top: 1rem;
    -webkit-overflow-scrolling: touch;
}
.df-search-result {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
    min-height: var(--df-touch);
}
.df-search-result:hover, .df-search-result:active { background: #f3f3f3; }
.df-search-result img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}
.df-search-result .name { font-weight: 600; }
.df-search-result .price { font-size: .9rem; color: #666; }
.df-search-empty { text-align: center; color: #999; padding: 2rem; }

/* ===== Mobile bottom nav ===== */
.df-bottom-nav {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--df-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255,255,255,0.98);
    border-top: 1px solid #eee;
    z-index: 1500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.df-bottom-nav .row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: var(--df-bottom-nav-h);
}
.df-bn-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #666;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    cursor: pointer;
    position: relative;
    padding: 4px;
    min-height: var(--df-touch);
    transition: color .2s;
}
.df-bn-item i { font-size: 1.25rem; }
.df-bn-item.active { color: #000; }
.df-bn-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30%;
    right: 30%;
    height: 3px;
    background: #000;
    border-radius: 0 0 3px 3px;
}
.df-bn-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 22px);
    background: #e0245e;
    color: #fff;
    font-size: .6rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.df-bn-badge.hidden { display: none; }

/* ===== Scroll-to-top FAB ===== */
.df-fab-top {
    position: fixed;
    right: 16px;
    bottom: calc(var(--df-bottom-nav-h) + 24px + env(safe-area-inset-bottom, 0px));
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    z-index: 1400;
    opacity: 0;
    transform: translateY(20px) scale(.8);
    transition: opacity .25s, transform .25s var(--df-ease);
    pointer-events: none;
}
.df-fab-top.show {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

/* ===== Mobile-specific layout ===== */
@media (max-width: 900px) {
    /* Show bottom nav, hide hamburger menu we now augment with bottom nav */
    .df-bottom-nav { display: block; }
    main { padding-bottom: calc(var(--df-bottom-nav-h) + 16px); }

    /* Bigger tap targets */
    .nav-link, .cart-btn, .quick-view-btn, .shop-quick-view-btn,
    .size-btn, .qty-btn, .cart-qty-btn, .add-to-cart-btn, .checkout-btn,
    .category-btn, .shop-now-btn, .cta-btn, .btn,
    select, .custom-select-button {
        min-height: var(--df-touch);
    }

    /* Mobile filter drawer trigger */
    .shop-controls .filters {
        display: none;
    }
    .shop-controls.open .filters {
        display: flex !important;
        flex-direction: column;
        gap: .75rem;
    }
    .df-filter-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: .5rem;
        background: #111;
        color: #fff;
        border: none;
        border-radius: 10px;
        padding: .75rem 1rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        cursor: pointer;
        width: 100%;
        margin-top: .75rem;
        min-height: var(--df-touch);
    }

    /* Cart item layout — stack controls under details */
    .cart-item {
        flex-wrap: wrap;
    }

    /* Product gallery: hint horizontal swipe */
    .product-gallery {
        scroll-snap-type: x mandatory;
    }

    /* FAB safer position when bottom nav present */
    .df-fab-top { bottom: calc(var(--df-bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0px)); }

    /* Hide the legacy hamburger nav-menu since bottom nav covers nav */
    .navbar .nav-menu { display: none; }
    .navbar .hamburger { display: none !important; }
}

.df-filter-toggle { display: none; }

/* ===== Brand quick-pick chips ===== */
/* ===== Circular brand chips (symbol in a circle + label) ===== */
.df-brand-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
    justify-content: center;
    align-items: flex-start;
}

.df-brand-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 70px;
}

.df-chip-circle {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--primary-white);
    border: 2px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.df-brand-chip:hover .df-chip-circle {
    border-color: #b0b0b0;
    transform: translateY(-2px);
}

.df-brand-chip.active .df-chip-circle {
    border-color: var(--primary-black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* Brand symbol image (drop files at images/brands/<slug>.png) */
.df-chip-symbol {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 11px;
    display: block;
}

/* Monogram fallback shown until a symbol image is added */
.df-chip-monogram {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: var(--primary-black);
}

/* "All" chip uses an icon */
.df-chip-all i {
    font-size: 1.05rem;
    color: var(--primary-black);
}

.df-chip-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #333;
    text-align: center;
    line-height: 1.15;
    max-width: 74px;
}

.df-brand-chip.active .df-chip-label {
    color: var(--primary-black);
}

.df-brand-chip:focus-visible {
    outline: none;
}
.df-brand-chip:focus-visible .df-chip-circle {
    border-color: var(--primary-black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.15);
}

/* Desktop: a touch more spacing */
@media (min-width: 901px) {
    .df-brand-chips {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        gap: 1.25rem;
    }
}

/* Mobile: chips render ABOVE the FILTERS toggle button.
   .shop-controls is flex-column on mobile, so we use order. */
@media (max-width: 900px) {
    .shop-controls {
        display: flex;
        flex-direction: column;
    }
    .shop-controls .search-box { order: 1; }
    .shop-controls .df-brand-chips { order: 2; margin-top: 0.5rem; }
    .shop-controls .df-filter-toggle { order: 3; }
    .shop-controls .filters { order: 4; }
    .shop-controls.open .filters { order: 4; }
}

/* ===== Desktop: ensure FAB doesn't overlap ===== */
@media (min-width: 901px) {
    .df-fab-top { bottom: 24px; }
}

/* ===== Quantity input — hide spinners on mobile (cleaner look) ===== */
input[type=number].cart-qty-input::-webkit-inner-spin-button,
input[type=number].cart-qty-input::-webkit-outer-spin-button,
#quantity::-webkit-inner-spin-button,
#quantity::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number].cart-qty-input,
#quantity { -moz-appearance: textfield; }

/* ===== Wishlist page ===== */
#wishlist-page .wishlist-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: #666;
}
#wishlist-page .wishlist-empty i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
}

/* ===== Hero eyebrow badge ===== */
.hero-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1.75rem;
    animation: dfFadeUp .6s var(--df-ease) both;
}
.hero-eyebrow .text {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #111;
    white-space: nowrap;
}
.hero-eyebrow .line {
    display: block;
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #111);
}
.hero-eyebrow .line:last-child {
    background: linear-gradient(90deg, #111, transparent);
}
.hero-eyebrow .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #111;
    animation: dfPulseDot 2s var(--df-ease) infinite;
}
.hero-eyebrow .dot:last-of-type {
    animation-delay: .5s;
}
@keyframes dfPulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6); opacity: .4; }
}
@media (max-width: 600px) {
    .hero-eyebrow .line { width: 28px; }
    .hero-eyebrow .text { font-size: 0.7rem; letter-spacing: 3px; }
    .hero-eyebrow { gap: 8px; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* =====================================================================
   GLOBAL POLISH PASS — typography, colour, spacing refinements
   Conservative, same black/white vibe. Loaded last so it wins.
   To revert the whole pass, delete from here to end of file.
   ===================================================================== */

/* Crisper text everywhere (noticeably cleaner Montserrat on iOS/mobile) */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Tighten heavy display headings — bold Montserrat reads more premium
   with a hair of negative tracking. */
h1, h2 { letter-spacing: -0.015em; }
h3 { letter-spacing: -0.01em; }

/* Long-form body copy: soften pure black a touch and open up line-height
   for easier reading. Headings/labels stay pure black. */
.product-description,
p.product-description,
.about-text p,
.hero-subtitle {
    color: #1c1c1c;
    line-height: 1.7;
}

/* Prices: consistent figure widths so they line up cleanly on cards. */
.price, .product-price, #product-price {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

/* All-caps UI labels: even, intentional tracking. */
.pc-brand,
.product-brand-eyebrow,
.size-selector h4,
.quantity-selector h4 {
    letter-spacing: 0.12em;
}

/* Product cards: a bit more breathing room between image and text,
   and a gentler, more even title line-height. */
.shop-product-info, .product-info { padding-top: 0.9rem; }
.shop-product-info h3, .product-info h3 {
    line-height: 1.35;
    letter-spacing: -0.005em;
}

/* Softer, more modern corner radius + shadow on raised surfaces,
   applied only where the base uses the harsher defaults. */
.custom-select-button,
.filters select,
.search-box input {
    border-radius: 10px;
}

/* Primary action buttons: slightly taller tap target + refined weight. */
.add-to-cart-btn {
    letter-spacing: 0.14em;
    border-radius: 10px;
}

/* Consistent, comfortable section rhythm on mobile. */
@media (max-width: 600px) {
    h1 { font-size: 2.1rem; }
    h2 { font-size: 1.9rem; }
    .container { padding-left: 1.15rem; padding-right: 1.15rem; }
}

/* ===== Enhanced search bar ===== */
.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    border-radius: 14px;
    border: 1.5px solid #e4e4e4;
    background: var(--primary-white);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    padding: 1.05rem 2.75rem 1.05rem 3.1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-black);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-box input::placeholder {
    color: #b3b3b3;
    font-weight: 500;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06), 0 6px 18px rgba(0, 0, 0, 0.07);
}

/* Leading search icon — animates to solid black on focus */
.search-box > i,
.search-box .fa-search,
.search-box .fa-magnifying-glass {
    left: 1.15rem;
    color: #9a9a9a;
    transition: color 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.search-box:focus-within > i,
.search-box:focus-within .fa-search,
.search-box:focus-within .fa-magnifying-glass {
    color: var(--primary-black);
}

/* Clear (×) button injected by JS when there is text */
.df-search-clear {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #efefef;
    color: #555;
    font-size: 1rem;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.df-search-clear:hover {
    background: var(--primary-black);
    color: var(--primary-white);
}
.search-box.has-text .df-search-clear {
    display: flex;
}

/* =====================================================================
   LOGO-INSPIRED VISUAL LANGUAGE
   Echoes the DripFit mark: forward-leaning italic display type, the "//"
   speed-slash motif, and faint diagonal speed-lines. Delete this block
   to revert the whole look.
   ===================================================================== */

/* 1) Forward-leaning italic on big display headings (matches the italic
      DRIPFIT wordmark). Product names / body copy stay upright. */
.hero-title,
.section-title,
.page-title,
.similar-products-title {
    font-style: italic;
}

/* Keep the italicised caps from feeling cramped */
.hero-title { letter-spacing: 1px; }
.section-title,
.page-title,
.similar-products-title { letter-spacing: 2px; }

/* 2) "//" speed-slash accent above centred section titles — a nod to the
      //F mark. Drawn crisply with an inline SVG. */
.section-title,
.similar-products-title,
.shop-header .page-title {
    position: relative;
}
.section-title::before,
.similar-products-title::before,
.shop-header .page-title::before {
    content: "";
    display: block;
    width: 52px;
    height: 15px;
    margin: 0 auto 1rem;
    background: center / contain no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 15'%3E%3Cg fill='%23000'%3E%3Cpolygon points='7,0 18,0 11,15 0,15'/%3E%3Cpolygon points='22,0 33,0 26,15 15,15'/%3E%3Cpolygon points='37,0 48,0 41,15 30,15'/%3E%3C/g%3E%3C/svg%3E");
}

/* 3) Faint diagonal "speed lines" texture on the header blocks + hero,
      echoing the logo's background. Very subtle so it never competes. */
.shop-header {
    background-image:
        repeating-linear-gradient(115deg,
            rgba(0, 0, 0, 0.04) 0 1.5px,
            transparent 1.5px 46px);
    background-color: var(--light-grey);
}
.hero {
    background-image:
        repeating-linear-gradient(115deg,
            rgba(0, 0, 0, 0.028) 0 1px,
            transparent 1px 48px);
}
