/* ═══════════════════════════════════════════════════════════════
   ThreadCraft — Storefront Styles (Responsive)
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg: #ffffff;
    --bg-soft: #f7f8fa;
    --fg: #0f172a;
    --fg-muted: #64748b;
    --border: #e2e8f0;
    --accent: #0f172a;
    --accent-hover: #1e293b;
    --danger: #dc2626;
    --success: #16a34a;
    --radius: 10px;
    --container: 1200px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
    --shadow-md: 0 6px 20px rgba(15,23,42,.08);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--fg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 24px;
    padding: 14px 20px;
    position: relative;
}
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 32px; height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 60;
}
.mobile-toggle span {
    display: block;
    height: 2px;
    background: var(--fg);
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
}
.mobile-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.logo-mark {
    background: var(--accent); color: #fff;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 8px;
    font-size: 13px; letter-spacing: .5px;
}

.main-nav { position: relative; }
.nav-root {
    list-style: none; padding: 0; margin: 0;
    display: flex; gap: 24px; align-items: center;
}
.nav-item { position: static; }
.nav-link {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--fg); font-size: 14px; font-weight: 500;
    padding: 18px 0;
    transition: color .15s;
}
.nav-link:hover { color: var(--accent); }
.nav-caret { font-size: 10px; color: var(--fg-muted); }

.mega-panel {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(15,23,42,.08);
    opacity: 0; visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    z-index: 40;
}
.nav-item.has-mega:hover > .mega-panel,
.mega-panel:hover {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.mega-inner { max-width: var(--container); margin: 0 auto; padding: 32px 20px; }
.mega-header {
    display: flex; justify-content: space-between; align-items: baseline;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px; margin-bottom: 24px;
}
.mega-header h3 { margin: 0; font-size: 20px; letter-spacing: -0.3px; }
.mega-viewall { color: var(--fg-muted); font-size: 13px; font-weight: 500; }
.mega-viewall:hover { color: var(--accent); }
.mega-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 32px 40px;
}
.mega-col h5 {
    margin: 0 0 12px; font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .8px;
}
.mega-col h5 a { color: var(--fg); }
.mega-col ul { list-style: none; padding: 0; margin: 0; }
.mega-col ul li { padding: 3px 0; }
.mega-col ul a { color: var(--fg-muted); font-size: 14px; }
.mega-sub {
    margin-top: 6px; margin-left: 12px;
    border-left: 1px dashed var(--border);
    padding-left: 12px;
}
.mega-sub a { font-size: 13px; }

.search-form input {
    border: 1px solid var(--border);
    background: var(--bg-soft);
    padding: 8px 12px;
    border-radius: 8px;
    width: 220px;
    font-size: 14px;
    font-family: inherit;
    transition: width .2s ease;
}
.search-form input:focus { outline: none; border-color: var(--accent); width: 260px; }

.header-actions { display: flex; align-items: center; gap: 16px; }
.header-icon {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    color: var(--fg);
    transition: color .15s;
}
.header-icon svg { width: 22px; height: 22px; display: block; }
.header-icon:hover { color: var(--accent-hover); }
.icon-badge {
    position: absolute;
    top: -6px; right: -10px;
    background: var(--accent); color: #fff;
    font-size: 11px; padding: 1px 6px;
    border-radius: 10px; font-weight: 600;
    min-width: 18px; text-align: center;
    line-height: 1.4;
}
.admin-badge { display: inline-block; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 10px 18px; border-radius: 8px;
    font-size: 14px; font-weight: 600;
    cursor: pointer; border: 1px solid transparent;
    transition: all .15s ease;
    background: transparent; color: var(--fg);
    font-family: inherit; text-decoration: none;
    text-align: center;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--border); background: #fff; }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */
.hero {
    padding: 80px 20px;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border-radius: 20px;
    margin: 30px 0;
    text-align: center;
}
.hero-content { max-width: 700px; margin: 0 auto; }
.hero .badge {
    display: inline-block; background: #fff;
    border: 1px solid var(--border);
    padding: 4px 12px; border-radius: 100px;
    font-size: 12px; font-weight: 600;
    color: var(--fg-muted); margin-bottom: 16px;
}
.hero h1 {
    font-size: clamp(32px, 5vw, 56px);
    margin: 0 0 16px; line-height: 1.1;
    letter-spacing: -1px;
}
.hero p { color: var(--fg-muted); font-size: 17px; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════
   PAGE HEAD / SECTIONS
   ═══════════════════════════════════════════════════════════════ */
.page-head { padding: 40px 0 20px; }
.page-head h1 { font-size: 32px; margin: 0 0 8px; letter-spacing: -0.5px; }
.page-head p { color: var(--fg-muted); margin: 0; }

.section { padding: 40px 0; }
.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 24px;
}
.section-head h2 { font-size: 24px; margin: 0; letter-spacing: -0.5px; }
.link-more { color: var(--fg-muted); font-size: 14px; font-weight: 500; }
.link-more:hover { color: var(--fg); }

/* ═══════════════════════════════════════════════════════════════
   CATEGORY GRID
   ═══════════════════════════════════════════════════════════════ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.category-tile {
    background: var(--bg-soft);
    padding: 32px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: transform .15s ease, box-shadow .15s ease;
}
.category-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.category-tile h3 { margin: 0 0 4px; font-size: 18px; }
.category-tile p { margin: 0; color: var(--fg-muted); font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════
   PRODUCT CARD
   ═══════════════════════════════════════════════════════════════ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px 20px;
}
.product-card {
    display: flex; flex-direction: column; color: inherit;
}
.card-image {
    position: relative;
    aspect-ratio: 4 / 5;
    background: #f5f5f5;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 14px;
}
.card-image-link { display: block; width: 100%; height: 100%; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.product-card:hover .card-image img { transform: scale(1.04); }

.card-wishlist {
    position: absolute; top: 12px; right: 12px;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.9);
    border: none; border-radius: 50%;
    cursor: pointer; color: #111;
    z-index: 2;
    transition: background .15s ease;
}
.card-wishlist:hover { background: #fff; }
.card-wishlist svg {
    width: 18px; height: 18px;
    stroke: currentColor; fill: none;
    transition: fill .15s ease;
}
.card-wishlist.active svg { fill: currentColor; }

.badge-new {
    position: absolute; top: 12px; left: 12px;
    background: #111; color: #fff;
    font-size: 10px; font-weight: 700;
    letter-spacing: .8px;
    padding: 4px 9px; border-radius: 2px;
    z-index: 2;
}

.card-body { padding: 0 4px; }
.card-title {
    font-size: 15px; font-weight: 500;
    color: #111; margin: 0 0 6px;
    line-height: 1.35; letter-spacing: -0.1px;
}
.card-price { font-size: 15px; font-weight: 500; color: #111; margin: 0 0 10px; }
.card-swatches { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.card-swatch {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.1);
    display: inline-block;
}
.card-swatch-more { font-size: 11px; color: #666; margin-left: 2px; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════
   PRODUCT PAGE
   ═══════════════════════════════════════════════════════════════ */
.product-breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #666;
    padding: 24px 0 32px;
}
.product-breadcrumb a { color: #666; }
.product-breadcrumb span { color: #ccc; }
.product-breadcrumb strong { color: #111; font-weight: 500; }

.product-page {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 64px;
    padding-bottom: 100px;
    align-items: start;
}

.product-media {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.thumbnails {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px;
    position: sticky; top: 100px;
    max-height: calc(100vh - 140px);
    width: 88px;
}
.thumb-nav {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    background: transparent; border: none; color: #999;
    cursor: pointer; border-radius: 50%;
    transition: background .15s, color .15s;
    flex-shrink: 0; padding: 0;
}
.thumb-nav:hover { background: #f0f0f0; color: #111; }
.thumb-nav svg { width: 14px; height: 14px; }

.thumbs-track {
    display: flex; flex-direction: column; gap: 10px;
    overflow-y: auto; scrollbar-width: none;
    padding: 2px;
    max-height: calc(100vh - 240px);
    width: 100%; align-items: center;
}
.thumbs-track::-webkit-scrollbar { display: none; }

.thumb {
    width: 68px; height: 82px;
    border-radius: 3px; overflow: hidden;
    border: 1px solid transparent;
    padding: 0; cursor: pointer;
    background: #f5f5f5; flex-shrink: 0;
    transition: border-color .15s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: #111; }

.main-media {
    position: relative;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 4 / 5;
}
.main-media > img { width: 100%; height: 100%; object-fit: cover; display: block; }

.icon-btn {
    position: absolute;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none; border-radius: 50%;
    cursor: pointer; color: #111;
    z-index: 3;
    transition: background .15s;
}
.icon-btn:hover { background: #fff; }
.icon-btn svg {
    width: 18px; height: 18px;
    stroke: currentColor; fill: none;
    transition: fill .15s;
}
.wishlist-btn { top: 16px; right: 16px; }
.share-btn    { top: 62px; right: 16px; }
.wishlist-btn.active svg { fill: currentColor; }

.media-nav {
    position: absolute; bottom: 16px; left: 16px;
    display: flex; gap: 8px; z-index: 3;
}
.media-nav button {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none; border-radius: 50%;
    cursor: pointer; color: #111;
    padding: 0;
}
.media-nav svg { width: 18px; height: 18px; }

.media-counter {
    position: absolute;
    bottom: 24px; right: 20px;
    font-size: 12px; color: #fff;
    background: rgba(0,0,0,.5);
    padding: 3px 10px; border-radius: 100px;
    z-index: 3; letter-spacing: .5px;
}

.product-info { padding-top: 8px; position: sticky; top: 100px; min-width: 0; }
.product-cat {
    display: inline-block;
    font-size: 11px; letter-spacing: 1.4px;
    color: #999; font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.product-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 42px; font-weight: 400;
    line-height: 1.1; color: #111;
    margin: 0 0 20px; letter-spacing: -0.5px;
}
.product-price {
    font-size: 24px; font-weight: 500;
    color: #111; margin: 0 0 28px;
    letter-spacing: -0.3px;
}
.product-desc {
    font-size: 14px; line-height: 1.7;
    color: #555; margin: 0 0 36px;
}

.option-group { margin-bottom: 28px; }
.option-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
}
.option-label {
    font-size: 13px; font-weight: 600;
    color: #111; letter-spacing: -0.1px;
}
.size-guide-link {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; color: #666;
    background: none; border: none;
    cursor: pointer; padding: 0;
    font-family: inherit;
}
.size-guide-link:hover { color: #111; }

.color-swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.color-swatch {
    position: relative;
    width: 40px; height: 40px;
    padding: 0; background: transparent;
    border: none; cursor: pointer;
    border-radius: 50%;
    display: grid; place-items: center;
}
.color-swatch::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color .15s ease;
}
.color-swatch:hover::before { border-color: #ddd; }
.color-swatch.active::before { border-color: #111; }
.swatch-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.1);
    display: block;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}

.size-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.size-pill {
    min-width: 54px; height: 44px;
    padding: 0 16px;
    border: 1px solid #ddd;
    background: #fff; color: #111;
    font-size: 12px; font-weight: 500;
    letter-spacing: .8px; text-transform: uppercase;
    border-radius: 2px; cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.size-pill:hover { border-color: #111; }
.size-pill.active { background: #111; color: #fff; border-color: #111; }

.qty-selector {
    display: inline-flex; align-items: center;
    border: 1px solid #ddd;
    border-radius: 2px;
    overflow: hidden;
    height: 46px;
    background: #fff;
}
.qty-btn {
    width: 46px; height: 46px;
    border: none; background: transparent;
    color: #111; font-size: 18px;
    cursor: pointer; padding: 0;
    transition: background .15s;
    font-family: inherit;
    line-height: 1;
}
.qty-btn:hover { background: #f5f5f5; }
.qty-selector input {
    width: 60px; height: 46px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 14px; font-weight: 500;
    color: #111; font-family: inherit;
    background: transparent;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}
.qty-selector input::-webkit-outer-spin-button,
.qty-selector input::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}

.product-actions {
    display: grid;
    grid-template-columns: 1fr 60px;
    gap: 12px;
    margin-top: 36px;
}
.btn-add-to-cart {
    height: 54px;
    background: #111; color: #fff;
    border: 1px solid #111;
    font-size: 13px; font-weight: 600;
    letter-spacing: .8px; text-transform: uppercase;
    border-radius: 2px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 10px; font-family: inherit;
    transition: background .15s;
    width: 100%;
}
.btn-add-to-cart:hover { background: #333; border-color: #333; }
.btn-add-to-cart:disabled { opacity: .6; cursor: not-allowed; }

.btn-wishlist-square {
    width: 100%; height: 54px;
    border: 1px solid #ddd;
    background: #fff; border-radius: 2px;
    cursor: pointer;
    display: grid; place-items: center;
    color: #111; padding: 0;
    transition: border-color .15s;
}
.btn-wishlist-square:hover { border-color: #111; }
.btn-wishlist-square svg {
    width: 20px; height: 20px;
    stroke: currentColor; fill: none;
    transition: fill .15s;
}
.btn-wishlist-square.active svg { fill: currentColor; }

/* ═══════════════════════════════════════════════════════════════
   CART
   ═══════════════════════════════════════════════════════════════ */
.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    padding: 24px 0;
}
.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr 90px 100px 40px;
    gap: 16px; align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.cart-thumb {
    width: 80px; height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-soft);
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-title { font-weight: 600; display: block; margin-bottom: 4px; }
.cart-variant { color: var(--fg-muted); font-size: 13px; display: block; }
.cart-unit { color: var(--fg-muted); font-size: 13px; display: block; margin-top: 4px; }
.cart-qty-form input {
    width: 70px; padding: 6px;
    border: 1px solid var(--border); border-radius: 6px;
    font-family: inherit;
}
.cart-subtotal { font-weight: 600; text-align: right; }

.cart-summary,
.checkout-summary {
    background: var(--bg-soft);
    border-radius: var(--radius);
    padding: 24px;
    height: fit-content;
    position: sticky; top: 90px;
}
.cart-summary h2,
.checkout-summary h2 { font-size: 18px; margin: 0 0 16px; }
.summary-row {
    display: flex; justify-content: space-between;
    padding: 8px 0; font-size: 14px;
}
.summary-row.small { font-size: 13px; color: var(--fg-muted); }
.summary-row.total {
    border-top: 1px solid var(--border);
    margin-top: 12px; padding-top: 16px;
    font-weight: 700; font-size: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   CHECKOUT
   ═══════════════════════════════════════════════════════════════ */
.checkout-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    padding: 24px 0;
}
.checkout-form fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px; margin: 0 0 20px;
}
.checkout-form legend { padding: 0 8px; font-weight: 600; font-size: 14px; }
.checkout-form label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 500; }
.checkout-form input,
.checkout-form textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 15px; font-family: inherit;
    margin-top: 6px;
}
.notice {
    font-size: 13px; color: var(--fg-muted);
    margin-top: 12px; text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   SUCCESS
   ═══════════════════════════════════════════════════════════════ */
.success-page {
    text-align: center; padding: 80px 20px;
    max-width: 500px; margin: 0 auto;
}
.success-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--success); color: #fff;
    display: grid; place-items: center;
    font-size: 36px; margin: 0 auto 24px;
}
.success-page h1 { font-size: 32px; margin: 0 0 16px; }
.success-page p { color: var(--fg-muted); margin: 0 0 12px; }

/* ═══════════════════════════════════════════════════════════════
   AUTH
   ═══════════════════════════════════════════════════════════════ */
.auth-card {
    max-width: 400px; margin: 60px auto;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}
.auth-card h1 { font-size: 24px; margin: 0 0 24px; }
.auth-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.auth-card input {
    width: 100%; padding: 10px 12px; margin-top: 6px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 15px; font-family: inherit;
}
.auth-alt { text-align: center; font-size: 14px; color: var(--fg-muted); margin-top: 20px; }
.auth-alt a { color: var(--accent); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════ */
.alert {
    padding: 12px 16px; border-radius: 8px;
    font-size: 14px; margin: 20px 0;
}
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
    background: var(--bg-soft);
    padding: 60px 0 30px;
    margin-top: 80px;
    border-top: 1px solid var(--border);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}
.footer-grid h4 { margin: 0 0 8px; font-size: 18px; }
.footer-grid h5 { margin: 0 0 12px; font-size: 14px; }
.footer-grid p { color: var(--fg-muted); font-size: 14px; margin: 0; }
.footer-grid a {
    display: block; color: var(--fg-muted);
    font-size: 14px; padding: 4px 0;
    transition: color .15s;
}
.footer-grid a:hover { color: var(--fg); }
.footer-bottom {
    margin-top: 40px; padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center; color: var(--fg-muted);
}

/* ═══════════════════════════════════════════════════════════════
   PLACEHOLDERS
   ═══════════════════════════════════════════════════════════════ */
.empty-state {
    color: var(--fg-muted); padding: 40px 0; text-align: center;
}
.empty-state a { color: var(--accent); font-weight: 600; }
.thumb-placeholder {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    color: var(--fg-muted); background: var(--bg-soft);
    font-size: 13px;
}
.thumb-placeholder.large { font-size: 15px; }

/* ═══════════════════════════════════════════════════════════════
   SIZE GUIDE MODAL
   ═══════════════════════════════════════════════════════════════ */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .55);
    display: grid; place-items: center;
    z-index: 200; padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
    background: #fff; border-radius: 12px;
    padding: 32px; max-width: 520px; width: 100%;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .25);
    position: relative;
    max-height: 90vh; overflow-y: auto;
}
.modal h3 {
    font-family: Georgia, serif;
    font-size: 24px; font-weight: 400;
    margin: 0 0 20px;
}
.modal-close {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px;
    border: none; background: transparent;
    font-size: 22px; cursor: pointer;
    color: #666; border-radius: 50%;
}
.size-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.size-table th,
.size-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.size-table th {
    background: #f8fafc; font-weight: 600;
    font-size: 11px; text-transform: uppercase;
    color: var(--fg-muted);
}
.modal-note {
    font-size: 12px; color: var(--fg-muted);
    margin: 16px 0 0; font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════ */
.site-toast {
    position: fixed; bottom: 30px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #111; color: #fff;
    padding: 12px 22px; border-radius: 100px;
    font-size: 14px; font-weight: 500;
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 300;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
    max-width: calc(100vw - 40px);
    text-align: center;
}
.site-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   ACCOUNT
   ═══════════════════════════════════════════════════════════════ */
.account-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    padding-bottom: 80px;
}
.account-sidebar {
    position: sticky; top: 100px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}
.account-sidebar nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.account-nav-link {
    display: block; padding: 10px 14px;
    border-radius: 6px; font-size: 14px;
    font-weight: 500; color: var(--fg-muted);
}
.account-nav-link.active,
.account-nav-link:hover { background: #f8fafc; color: var(--fg); }
.account-signout-form { border-top: 1px solid var(--border); padding-top: 12px; }

.account-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.account-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px 28px;
}
.account-card h2 { margin: 0 0 20px; font-size: 18px; }
.account-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.account-form input {
    display: block; width: 100%;
    margin-top: 6px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 15px; font-family: inherit; background: #fff;
}
.account-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.account-form .form-actions {
    display: flex; justify-content: flex-end;
    margin-top: 8px; padding-top: 20px;
    border-top: 1px solid var(--border);
}

.account-order { padding: 18px 0; border-top: 1px solid var(--border); }
.account-order:first-of-type { border-top: none; padding-top: 0; }
.account-order-header {
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap;
    gap: 12px; margin-bottom: 14px;
}
.account-order-date { color: var(--fg-muted); font-size: 13px; margin-left: 10px; }
.account-order-meta { display: flex; align-items: center; gap: 14px; }
.account-order-items { list-style: none; padding: 0; margin: 0 0 14px; font-size: 14px; }
.account-order-items li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px; padding: 6px 0;
}
.account-order-link { color: var(--accent); font-size: 13px; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════ */
.badge {
    padding: 3px 8px; border-radius: 4px;
    font-size: 12px; font-weight: 600;
    text-transform: capitalize;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-paid { background: #dcfce7; color: #166534; }
.badge-shipped { background: #dbeafe; color: #1e40af; }
.badge-delivered { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-pickup { background: #dbeafe; color: #1e40af; }
.badge-royal  { background: #fef3c7; color: #92400e; }
.badge-custom { background: #e0e7ff; color: #3730a3; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 1024px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .product-page { gap: 40px; padding-bottom: 60px; }
    .product-title { font-size: 34px; }
    .account-layout { grid-template-columns: 200px 1fr; gap: 24px; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE LANDSCAPE / SMALL TABLET (≤ 900px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .header-inner {
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "toggle logo actions";
        gap: 12px;
        padding: 12px 16px;
    }
    .mobile-toggle { display: flex; grid-area: toggle; }
    .logo { grid-area: logo; }
    .header-actions { grid-area: actions; }
    .search-form { display: none; }

    /* Slide-out nav */
    .main-nav {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: min(85vw, 340px);
        background: #fff;
        border-right: 1px solid var(--border);
        padding: 80px 24px 24px;
        transform: translateX(-100%);
        transition: transform .3s ease;
        overflow-y: auto;
        z-index: 55;
        box-shadow: 8px 0 24px rgba(15,23,42,.08);
    }
    .main-nav.open { transform: translateX(0); }
    .nav-root { flex-direction: column; gap: 0; align-items: stretch; }
    .nav-item { border-bottom: 1px solid var(--border); }
    .nav-link { padding: 16px 0; font-size: 16px; justify-content: space-between; }
    .nav-item.has-mega > .nav-link { cursor: pointer; }

    .mega-panel {
        position: static;
        opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: none;
        background: #f8fafc;
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
        display: block;
    }
    .nav-item.open > .mega-panel { max-height: 3000px; }
    .mega-inner { padding: 12px 16px; }
    .mega-header { border: none; padding: 0; margin-bottom: 12px; }
    .mega-header h3 { font-size: 14px; color: var(--fg-muted); }
    .mega-columns { grid-template-columns: 1fr; gap: 12px; }
    .mega-col h5 { font-size: 12px; }
    .mega-col ul a { font-size: 14px; }

    /* Product page: single column */
    .product-page { grid-template-columns: 1fr; gap: 32px; padding-bottom: 40px; }
    .product-info { position: static; }
    .product-media {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 14px;
    }
    .thumbnails { width: 64px; }
    .thumb { width: 56px; height: 68px; }
    .thumbs-track { max-height: 400px; }

    .product-title { font-size: 30px; }
    .product-price { font-size: 20px; }
    .product-desc { margin-bottom: 24px; }

    .product-actions { grid-template-columns: 1fr 52px; margin-top: 28px; }
    .btn-add-to-cart,
    .btn-wishlist-square { height: 48px; }

    /* Cart / checkout stacks */
    .cart-layout,
    .checkout-layout { grid-template-columns: 1fr; gap: 20px; }
    .cart-summary,
    .checkout-summary { position: static; }

    .cart-item {
        grid-template-columns: 60px 1fr 70px 80px;
        gap: 10px;
        padding: 14px 0;
    }
    .cart-item .cart-remove-form { grid-column: 4; grid-row: 2; justify-self: end; }

    /* Footer 2-col */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }

    /* Account stacks */
    .account-layout { grid-template-columns: 1fr; gap: 20px; padding-bottom: 40px; }
    .account-sidebar { position: static; padding: 8px; }
    .account-sidebar nav { flex-direction: row; overflow-x: auto; gap: 4px; margin-bottom: 12px; }
    .account-nav-link { white-space: nowrap; padding: 8px 12px; }
    .account-card { padding: 20px; }

    .hero { padding: 60px 20px; border-radius: 12px; margin: 16px 0; }
    .hero p { font-size: 15px; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — PHONE (≤ 560px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 560px) {
    .container { padding: 0 16px; }

    /* Single-column gallery */
    .product-media { grid-template-columns: 1fr; gap: 12px; }
    .thumbnails {
        order: 2;
        flex-direction: row;
        position: static;
        width: 100%;
        max-height: none;
    }
    .thumbs-track {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
    }
    .thumb { width: 60px; height: 74px; }
    .main-media { order: 1; }

    .product-title { font-size: 26px; }
    .product-price { font-size: 18px; }
    .btn-add-to-cart { font-size: 12px; letter-spacing: .5px; }

    /* Product grid: 2 columns on mobile */
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px 12px;
    }
    .card-title { font-size: 13px; }
    .card-price { font-size: 13px; }
    .card-wishlist { width: 32px; height: 32px; top: 8px; right: 8px; }
    .card-wishlist svg { width: 16px; height: 16px; }

    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .footer-bottom { font-size: 12px; }

    .hero { padding: 48px 16px; margin: 12px 0; border-radius: 10px; }
    .hero h1 { font-size: 28px !important; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }

    .page-head h1 { font-size: 24px; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
    .section-head h2 { font-size: 20px; }

    .account-form .form-row { grid-template-columns: 1fr; }

    .account-order-header { flex-direction: column; align-items: flex-start; }
    .account-order-meta { width: 100%; justify-content: space-between; }

    .modal { padding: 20px; }
    .modal h3 { font-size: 18px; }
    .size-table th,
    .size-table td { padding: 8px 6px; font-size: 12px; }

    .search-form { display: none; }
    .header-actions { gap: 12px; }
    .header-icon { width: 24px; height: 24px; }
    .header-icon svg { width: 20px; height: 20px; }
    .icon-badge { font-size: 10px; padding: 1px 5px; }
    .admin-badge { display: none; }
}