:root {
    --text-caption: .875rem;
    --text-small: 1rem;
    --text-body: 1.0625rem;
    --text-lg: 1.25rem;
    --text-xl: 1.75rem;
    --text-heading: 2.25rem;
    --text-title: 3rem;
    --text-display: 4rem;
    --icon-size: 1.5rem;
    --touch-target: 2.75rem;
    --color-olive: #344831;
    --color-ivory: #fafaf6;
    --color-primary: #000000;
    --color-accent: #000000;
    --color-sale: #e10600;
    --color-bg: #f5f5f5;
    --color-border: #e5e5e5;
    --color-muted: #6b6b6b;
    --font-body: 'Archivo', system-ui, sans-serif;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --free-shipping-threshold: 5000;
    --img-master: 1254;
}

* { box-sizing: border-box; }

body {
    font-size: var(--text-body);
    line-height: 1.6;
    font-family: var(--font-body);
    color: var(--color-primary);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-primary); opacity: 0.7; }

.btn-dark {
    background: #000;
    border-color: #000;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: var(--text-small);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
}
.btn-dark:hover { background: #222; border-color: #222; }
.btn-outline-dark { border-radius: 0; border-color: #000; text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--text-small); }
.btn-light { border-radius: 0; text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--text-small); font-weight: 600; }
.form-control, .form-select { border-radius: 0; border-color: var(--color-border); }

/* —— Top bar —— */
.top-bar {
    background: #000;
    color: #fff;
    font-size: var(--text-small);
    letter-spacing: 0.04em;
    padding: 0.55rem 0;
    position: sticky;
    top: 0;
    z-index: 1040;
}
.top-bar a { color: #fff; opacity: 0.85; }
.top-bar a:hover { opacity: 1; color: #fff; }

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    z-index: 1030;
}

.navbar-brand {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    letter-spacing: 0.12em;
    font-weight: 600;
}
.brand-accent { color: #000; font-weight: 400; }

.mega-nav .nav-link {
    font-size: var(--text-small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 1.1rem 0.9rem !important;
}
.sale-link { color: var(--color-sale) !important; }

.mega-menu {
    border: none;
    border-radius: 0;
    padding: 1.5rem 2rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    min-width: 600px;
    border-top: 1px solid var(--color-border);
}
.mega-menu a {
    display: block;
    padding: 0.35rem 0;
    font-size: var(--text-small);
}
.mega-menu a:hover { opacity: 0.6; color: #000; }

.search-wrapper { position: relative; }
.search-form input {
    border-radius: 0;
    padding-left: 1rem;
    width: 200px;
    font-size: var(--text-small);
    border: 1px solid var(--color-border);
}
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
}
.search-suggestions.show { display: block; }
.search-suggestions a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: var(--text-small);
}
.search-suggestions a:hover { background: var(--color-bg); }

.nav-icon { font-size: var(--text-lg); position: relative; }
.cart-icon .cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #000;
    color: #fff;
    font-size: var(--text-caption);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* —— Hero —— */
.hero-section .carousel-item {
    height: 78vh;
    min-height: 420px;
    background-size: cover;
    background-position: center;
    background-color: #111;
}
.hero-overlay {
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 100%);
    display: flex;
    align-items: center;
}
.hero-content { color: #fff; max-width: 520px; }
.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    font-weight: 500;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}
.hero-content p { font-size: var(--text-body); opacity: 0.9; margin-bottom: 1.5rem; letter-spacing: 0.04em; }

.section { padding: 3.5rem 0; }
.section-header h2 {
    font-family: var(--font-display);
    font-size: var(--text-heading);
    font-weight: 500;
    margin-bottom: 0.25rem;
    letter-spacing: 0.02em;
}
.section-header p { color: var(--color-muted); font-size: var(--text-body); }

.category-card { display: block; position: relative; overflow: hidden; }
.category-image {
    height: 300px;
    background-size: cover;
    background-position: center;
    background-color: #ddd;
    transition: transform 0.6s ease;
}
.category-card:hover .category-image { transform: scale(1.04); }
.category-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: var(--text-small);
}

/* —— Product images 1:1 —— */
.img-square {
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    background: var(--color-bg);
}
.img-square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* —— Product card —— */
.product-card { position: relative; }
.product-image-wrap {
    position: relative;
    overflow: hidden;
    background: var(--color-bg);
    aspect-ratio: 1 / 1;
}
.product-image-wrap .product-image,
.product-image-wrap .product-image-secondary {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    transition: opacity 0.35s ease;
}
.product-image-wrap .product-image-secondary { opacity: 0; }
.product-card.hover-ready:hover .product-image { opacity: 0; }
.product-card.hover-ready:hover .product-image-secondary { opacity: 1; }

.badge-sale, .badge-new {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    font-size: var(--text-caption);
    padding: 0.3rem 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.badge-sale { background: var(--color-sale); color: #fff; }
.badge-new { background: #000; color: #fff; left: auto; right: 10px; }

.product-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3;
}
.product-card:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}
.quick-add-btn {
    width: 100%;
    border: none;
    background: #000;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: var(--text-small);
    font-weight: 600;
    padding: 0.85rem;
    cursor: pointer;
}
.quick-add-btn:hover { background: #222; color: #fff; }

.product-info { padding: 0.85rem 0 0.25rem; }
.product-name { font-size: var(--text-small); font-weight: 500; margin-bottom: 0.25rem; letter-spacing: 0.02em; }
.price-current { font-weight: 600; font-size: var(--text-body); }
.price-original { text-decoration: line-through; color: #999; font-size: var(--text-small); margin-left: 0.4rem; }
.related-colors { display: flex; gap: 0.35rem; margin-top: 0.5rem; flex-wrap: wrap; }
.related-colors .color-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    display: inline-block;
}

/* —— Collection bands —— */
.collection-band { padding: 0 0 3rem; }
.collection-band-banner {
    height: 42vw;
    max-height: 480px;
    min-height: 220px;
    background-size: cover;
    background-position: center;
    background-color: #111;
    position: relative;
    display: flex;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}
.collection-band-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 40%, rgba(0,0,0,0.65));
}
.collection-band-banner .banner-inner {
    position: relative;
    z-index: 1;
    color: #fff;
    padding: 2rem;
    width: 100%;
}
.collection-band-banner h2 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.product-rail-wrap { position: relative; }
.product-rail {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.25rem 0 1rem;
}
.product-rail::-webkit-scrollbar { display: none; }
.product-rail .rail-item {
    flex: 0 0 calc(50% - 0.5rem);
    scroll-snap-align: start;
}
@media (min-width: 768px) {
    .product-rail .rail-item { flex: 0 0 calc(25% - 0.75rem); }
}
.rail-nav {
    position: absolute;
    top: 35%;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    cursor: pointer;
}
.rail-nav.prev { left: 0; }
.rail-nav.next { right: 0; }
.rail-nav:hover { background: #000; color: #fff; border-color: #000; }

.category-banner {
    height: 220px;
    background-size: cover;
    background-position: center;
    background-color: #111;
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    position: relative;
}
.category-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.55));
}
.category-banner-content { position: relative; color: #fff; z-index: 1; }
.category-banner-content h2 { font-family: var(--font-display); margin-bottom: 1rem; }

.promo-banner {
    display: block;
    height: 280px;
    background-size: cover;
    background-position: center;
    background-color: #222;
    position: relative;
    overflow: hidden;
}
.promo-content {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    color: #fff;
}
.promo-content h3 { font-family: var(--font-display); font-weight: 500; }

.instagram-item {
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-color: #333;
}

.newsletter-box { background: var(--color-bg); padding: 3rem; }
.newsletter-box h2 { font-family: var(--font-display); font-weight: 500; }

.site-footer { background: #000; color: #fff; }
.footer-brand { font-family: var(--font-display); letter-spacing: 0.15em; font-weight: 500; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: rgba(255,255,255,0.65); font-size: var(--text-small); }
.footer-links a:hover { color: #fff; opacity: 1; }
.social-links a { color: #fff; font-size: var(--text-lg); margin-right: 1rem; opacity: 0.7; }
.social-links a:hover { opacity: 1; color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 1rem 0;
    text-align: center;
    font-size: var(--text-small);
    color: rgba(255,255,255,0.45);
}
.payment-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.payment-icons span {
    border: 1px solid rgba(255,255,255,0.25);
    padding: 0.25rem 0.5rem;
    font-size: var(--text-caption);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
}
.footer-support { font-size: var(--text-small); color: rgba(255,255,255,0.7); }

.shop-header { background: var(--color-bg); padding: 3rem 0; text-align: center; }
.shop-header h1 { font-family: var(--font-display); text-transform: capitalize; font-weight: 500; }

.filter-panel { background: var(--color-bg); padding: 1.5rem; }
.filter-group { margin-bottom: 1rem; }
.filter-label { font-size: var(--text-small); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; display: block; }
.sort-select { width: auto; min-width: 180px; }

.order-summary, .checkout-section {
    background: var(--color-bg);
    padding: 1.5rem;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: var(--text-body);
}
.summary-row.total {
    font-weight: 700;
    font-size: var(--text-lg);
    border-top: 1px solid var(--color-border);
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.cart-item-image {
    width: 96px;
    height: 96px;
    object-fit: cover;
}
.free-ship-bar { margin-bottom: 1rem; }
.free-ship-bar .progress { height: 4px; border-radius: 0; background: #e5e5e5; }
.free-ship-bar .progress-bar { background: #000; }
.promo-feedback { font-size: var(--text-small); margin-top: 0.35rem; }
.promo-feedback.valid { color: #0a7a2f; }
.promo-feedback.invalid { color: var(--color-sale); }

/* Cart drawer */
.cart-drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1050;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s;
}
.cart-drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.cart-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(400px, 100%);
    background: #fff;
    z-index: 1051;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 30px rgba(0,0,0,0.12);
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--color-border);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: var(--text-small);
    font-weight: 700;
}
.cart-drawer-body { flex: 1; overflow-y: auto; padding: 1rem; }
.cart-drawer-footer { padding: 1.25rem; border-top: 1px solid var(--color-border); }

/* PDP */
.product-gallery .main-image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--color-bg);
}
.product-gallery .main-image img { width: 100%; height: 100%; object-fit: cover; }
.thumbnail-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.thumbnail-btn {
    border: 1px solid transparent;
    padding: 0;
    width: 72px;
    height: 72px;
    overflow: hidden;
    cursor: pointer;
    background: none;
}
.thumbnail-btn img { width: 100%; height: 100%; object-fit: cover; }
.thumbnail-btn:hover, .thumbnail-btn:focus, .thumbnail-btn.active { border-color: #000; }

.product-title { font-family: var(--font-display); font-size: var(--text-heading); font-weight: 500; }
.product-price-lg .price-current { font-size: var(--text-lg); font-weight: 700; }

.size-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.size-option input { display: none; }
.size-option span {
    display: inline-block;
    padding: 0.55rem 1rem;
    border: 1px solid var(--color-border);
    cursor: pointer;
    font-size: var(--text-small);
    min-width: 44px;
    text-align: center;
}
.size-option input:checked + span {
    background: #000;
    color: #fff;
    border-color: #000;
}
.size-option input:disabled + span {
    opacity: 0.35;
    text-decoration: line-through;
    cursor: not-allowed;
}

.color-option input { display: none; }
.color-option .color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid var(--color-border);
    cursor: pointer;
    margin-right: 0.35rem;
}
.color-option input:checked + .color-swatch {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
}
.qty-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: var(--text-lg);
    cursor: pointer;
}
.quantity-selector input { border: none; text-align: center; width: 50px; }

.sticky-atc {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #fff;
    border-top: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    z-index: 1020;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.sticky-atc.show { transform: translateY(0); }

.checkout-steps {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.checkout-steps .step {
    font-size: var(--text-small);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--color-border);
    flex: 1;
    text-align: center;
    min-width: 80px;
}
.checkout-steps .step.active {
    color: #000;
    border-color: #000;
    font-weight: 700;
}
.checkout-steps .step.done { color: #000; border-color: #000; opacity: 0.55; }

.auth-card { background: var(--color-bg); padding: 2rem; }
.account-nav .nav-link { color: #666; padding: 0.5rem 0; }
.account-nav .nav-link.active { color: #000; font-weight: 600; }

.payment-mock-card {
    max-width: 480px;
    margin: 2rem auto;
    border: 1px solid var(--color-border);
    padding: 2rem;
}
.saved-address {
    border: 1px solid var(--color-border);
    padding: 1rem;
    cursor: pointer;
    margin-bottom: 0.75rem;
}
.saved-address.selected { border-color: #000; background: var(--color-bg); }

.animate-fade-up { animation: fadeUp 0.8s ease forwards; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991px) {
    .search-form { display: none; }
    .hero-section .carousel-item { height: 55vh; }
    .mega-menu { min-width: 100%; }
}

@media (max-width: 576px) {
    .section { padding: 2.25rem 0; }
    .category-image { height: 200px; }
}

/* Shared type, icon and interaction scale. */
html { font-size: 100%; }
h1, .h1 { font-size: var(--text-title); }
h2, .h2 { font-size: var(--text-heading); }
h3, .h3 { font-size: var(--text-xl); }
h4, .h4 { font-size: var(--text-lg); }
h5, h6, .h5, .h6 { font-size: var(--text-body); }
small, .small { font-size: var(--text-caption); }
.form-label, .form-control, .form-select { font-size: var(--text-small); }
.form-control, .form-select { min-height: var(--touch-target); }
button, .btn, .nav-link, .social-links a, .footer-links a, .size-option span, .color-option { min-height: var(--touch-target); }
button, .btn, .nav-icon, .social-links a, .color-option { min-width: var(--touch-target); }
body .bi { font-size: var(--icon-size); line-height: 1; vertical-align: middle; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--color-olive); outline-offset: 4px; }
.footer-links a { display: inline-flex; align-items: center; }
#mainAtcRow { flex-wrap: wrap; }
#mainAtcRow .quantity-selector { flex: 0 0 100%; width: fit-content; }
#mainAtcRow > .btn { flex-basis: 40%; }
.product-detail-info, .product-name, .product-title { overflow-wrap: anywhere; }
.policy-summary { display: flex; gap: 1rem; padding: 1.25rem 0; margin: 1rem 0; border-block: 1px solid var(--color-border); font-size: var(--text-small); }
.policy-summary > i { color: var(--color-olive); }
.policy-summary p { margin: .25rem 0; }
.policy-summary a { text-decoration: underline; text-underline-offset: .2em; }
.policy-summary small { display: block; color: var(--color-muted); margin-top: .5rem; }
.policy-page { max-width: 54rem; }
.policy-page h1, .policy-page h2 { font-family: var(--font-display); }
.policy-page h2 { margin-top: 2rem; }
.policy-page li { margin-block: .75rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.social-links a { display: inline-flex; align-items: center; justify-content: center; margin-right: .5rem; }

.color-option .color-swatch { width: var(--touch-target); height: var(--touch-target); }
.size-option input, .color-option input { display: block; position: absolute; width: 1px; height: 1px; opacity: 0; }
.size-option input:focus-visible + span, .color-option input:focus-visible + span { outline: 2px solid var(--color-olive); outline-offset: 3px; }
.bi::before { font-size: max(var(--icon-size), 1em); }

.cart-drawer:not(.open) { visibility: hidden; }

@media (max-width: 575px) { #mainAtcRow > .btn { padding-inline: .5rem; letter-spacing: .03em; } #mainAtcRow > .btn .bi { display: none; } }
