/* Madewell-inspired storefront */
:root {
    --black: #111;
    --white: #fff;
    --gray-100: #f7f7f7;
    --gray-200: #e8e8e8;
    --gray-500: #767676;
    --yellow: #f5e6a8;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --max-width: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--black);
    background: var(--white);
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; }

.promo-bar {
    background: var(--black);
    color: var(--white);
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.06em;
    padding: 8px 16px;
}
.promo-bar p { margin: 0; }

.site-header {
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 100;
}
.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 24px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
}
.logo {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-style: italic;
}
.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}
.main-nav a {
    font-size: 12px;
    letter-spacing: 0.12em;
    font-weight: 500;
}
.main-nav a:hover { text-decoration: underline; }
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.search-form {
    display: flex;
    border: 1px solid var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}
.search-form input {
    border: 0;
    padding: 10px 14px;
    width: 220px;
    font-size: 13px;
    background: #fafafa;
}
.search-form button {
    border: 0;
    background: transparent;
    padding: 0 10px;
    cursor: pointer;
}
.cart-link {
    position: relative;
    font-size: 20px;
}
.cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--black);
    color: var(--white);
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mobile-menu-btn {
    display: none;
    background: none;
    border: 0;
    font-size: 24px;
    cursor: pointer;
}
.mobile-nav {
    display: none;
    flex-direction: column;
    padding: 0 24px 16px;
    gap: 12px;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav.is-open {
    display: flex;
}

.site-main { min-height: 60vh; }

/* Hero video — Madewell-style */
.hero-video-wrap {
    width: 100%;
    background: #000;
}
.hero-video-inner {
    position: relative;
    width: 100%;
    min-height: min(85vh, 720px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-video,
.hero-fallback-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    padding: 24px;
    text-shadow: 0 1px 12px rgba(0,0,0,.35);
}
.hero-eyebrow {
    letter-spacing: 0.28em;
    font-size: clamp(11px, 1.2vw, 14px);
    margin: 0 0 12px;
    font-weight: 500;
}
.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 400;
    margin: 0 0 28px;
    letter-spacing: 0.06em;
    line-height: 1.1;
}
.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    background-size: cover;
    background-position: center;
}
.hero-summer {
    background-image: linear-gradient(rgba(0,0,0,.25), rgba(0,0,0,.25)),
        url('https://images.unsplash.com/photo-1509631179647-0177331693ae?w=1600&h=900&fit=crop');
}
.hero-eyebrow {
    letter-spacing: 0.2em;
    font-size: 13px;
    margin: 0 0 8px;
}
.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 400;
    margin: 0 0 24px;
    letter-spacing: 0.04em;
}
.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: 1px solid var(--black);
    background: var(--black);
    color: var(--white);
    cursor: pointer;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: 0.2s ease;
}
.btn:hover { opacity: 0.85; }
.btn-outline-light {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}
.btn-primary { background: var(--black); color: var(--white); }
.btn-block { width: 100%; }
.btn-text {
    background: none;
    border: none;
    color: var(--black);
    text-decoration: underline;
    padding: 4px 0;
}

.promo-strip {
    background: #f3e6a0;
    text-align: center;
    padding: 56px 24px;
}
.promo-strip-inner { max-width: 640px; margin: 0 auto; }
.promo-strip .script {
    font-family: var(--font-serif);
    font-size: clamp(24px, 3vw, 32px);
    font-style: italic;
    display: block;
    margin-bottom: 8px;
}
.promo-strip h2 {
    font-family: var(--font-serif);
    font-size: clamp(36px, 5vw, 52px);
    margin: 0 0 12px;
    font-weight: 400;
    letter-spacing: 0.02em;
}
.promo-strip p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 24px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
}
.section-header h1,
.section-header h2 {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 400;
    margin: 0;
    letter-spacing: 0.04em;
}
.section-link {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.product-card {
    display: flex;
    flex-direction: column;
}
.product-image-wrap {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    background: var(--gray-100);
    margin-bottom: 12px;
}
.product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product-card:hover img { transform: scale(1.03); }
.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--white);
    padding: 4px 8px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.product-card h3 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px;
}
.product-rating, .product-price {
    margin: 0;
    font-size: 13px;
    color: var(--gray-500);
}
.btn-add-quick {
    margin-top: 8px;
    background: var(--white);
    color: var(--black);
}
.btn-add-quick:hover { background: var(--black); color: var(--white); }

.category-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 48px;
}
.tile {
    min-height: 320px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 24px;
    color: var(--white);
    font-family: var(--font-serif);
    font-size: 32px;
}

.category-hero, .product-page .breadcrumbs, .cart-page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px 24px 0;
}
.category-hero h1 {
    font-family: var(--font-serif);
    font-size: 40px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-align: center;
    margin: 16px 0 32px;
}
.breadcrumbs {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.subcategory-row {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 32px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}
.subcategory-card img {
    aspect-ratio: 3/4;
    object-fit: cover;
    width: 100%;
    margin-bottom: 8px;
}
.subcategory-card span {
    font-size: 13px;
    text-align: center;
    display: block;
}

.filters-bar {
    max-width: var(--max-width);
    margin: 0 auto 24px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    padding-top: 16px;
    padding-bottom: 16px;
}
.filters-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.fit-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.fit-btn {
    padding: 8px 14px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    cursor: pointer;
    font-size: 12px;
}
.fit-btn.is-active, .fit-btn:hover {
    border-color: var(--black);
    background: var(--black);
    color: var(--white);
}
.filters-form label {
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filters-form select {
    padding: 8px;
    border: 1px solid var(--gray-200);
}
.product-count {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px;
}
.product-gallery video[data-gallery-image] {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    display: none;
}
.product-gallery video.is-active { display: block; }
.product-gallery img[data-gallery-image] {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    display: none;
}
.product-gallery img.is-active { display: block; }
.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.gallery-thumbs button {
    border: 2px solid transparent;
    padding: 0;
    background: none;
    cursor: pointer;
    width: 64px;
}
.gallery-thumbs button.is-active { border-color: var(--black); }
.gallery-thumbs img { width: 64px; height: 80px; object-fit: cover; }

.product-info h1 {
    font-family: var(--font-serif);
    font-size: 36px;
    font-weight: 400;
    margin: 8px 0;
}
.product-price-lg {
    font-size: 20px;
    font-weight: 600;
    margin: 16px 0;
}
.size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 20px;
}
.size-option input { display: none; }
.size-option span {
    display: inline-flex;
    min-width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    font-size: 13px;
}
.size-option input:checked + span,
.size-option input:not(:disabled) + span:hover {
    border-color: var(--black);
    background: var(--black);
    color: var(--white);
}
.size-option input:disabled + span {
    opacity: 0.35;
    cursor: not-allowed;
    text-decoration: line-through;
}
.qty-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
    font-size: 12px;
}
.qty-label input {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--gray-200);
}
.form-message {
    margin-top: 12px;
    font-size: 13px;
}
.form-message.is-success { color: #1a7f37; }
.form-message.is-error { color: #b42318; }

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 48px;
    margin-top: 32px;
}
.cart-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 20px;
    padding: 24px 0;
    border-bottom: 1px solid var(--gray-200);
}
.cart-item img {
    width: 120px;
    aspect-ratio: 4/5;
    object-fit: cover;
}
.cart-item h2 {
    font-size: 16px;
    margin: 0 0 8px;
}
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}
.cart-summary {
    background: var(--gray-100);
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 100px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}
.summary-total {
    font-weight: 600;
    font-size: 16px;
    border-top: 1px solid var(--gray-200);
    padding-top: 12px;
    margin-top: 12px;
}
.checkout-note {
    font-size: 12px;
    color: var(--gray-500);
    margin: 12px 0;
}

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--gray-500);
}

.site-footer {
    background: var(--gray-100);
    padding: 48px 24px 24px;
    margin-top: 48px;
}
.footer-grid {
    max-width: var(--max-width);
    margin: 0 auto 32px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.footer-grid h3 {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.footer-grid a {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--gray-500);
}
.footer-copy {
    text-align: center;
    font-size: 12px;
    color: var(--gray-500);
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 40px;
    height: 40px;
    background: var(--black);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .subcategory-row { grid-template-columns: repeat(3, 1fr); }
    .product-layout, .cart-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .header-inner {
        grid-template-columns: 1fr auto auto;
    }
    .main-nav, .search-form { display: none; }
    .mobile-menu-btn { display: block; }
    .category-tiles { grid-template-columns: 1fr; }
    .subcategory-row { grid-template-columns: repeat(2, 1fr); }
    .cart-item { grid-template-columns: 80px 1fr; }
    .cart-line-total { grid-column: 2; }
}
