/* =============================================================================
   NAMÛDAGE — storefront styles
   Modern minimalist: lots of whitespace, soft shadows, rounded corners.
   Mobile-first; larger layouts kick in at the media queries near the bottom.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------- */
:root {
    --bg:        #fafafa;
    --surface:   #ffffff;
    --surface-2: #f4f4f5;
    --text:      #18181b;
    --muted:     #6b7280;
    --border:    #e7e7ea;
    --accent:    #111111;
    --accent-2:  #3b82f6;
    --danger:    #dc2626;
    --success:   #16a34a;
    --radius:    14px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --shadow:    0 4px 20px rgba(0,0,0,.06);
    --shadow-md: 0 8px 30px rgba(0,0,0,.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,.12);
    --container: 1200px;
    --header-h:  68px;
    --ease:      cubic-bezier(.4,0,.2,1);
    --font:      'Inter', 'Tajawal', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: inherit; }
ul { list-style: none; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: 56px; }
.muted { color: var(--muted); }
.num { text-align: end; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: .95rem;
    transition: transform .15s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease), opacity .2s;
    white-space: nowrap; border: 1.5px solid transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #000; box-shadow: var(--shadow-md); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }

.link-arrow { color: var(--accent-2); font-weight: 600; }
.link-arrow::after { content: ' →'; }
.link-danger { color: var(--danger); font-size: .82rem; font-weight: 600; background: none; padding: 0; }
.link-danger:hover { text-decoration: underline; }

/* ---- Header -------------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: var(--header-h); }
.logo { font-weight: 800; font-size: 1.35rem; letter-spacing: .14em; }
.main-nav { display: flex; gap: 22px; margin-inline-start: 14px; }
.main-nav a { font-weight: 500; color: var(--muted); position: relative; padding: 4px 0; }
.main-nav a:hover, .main-nav a.active { color: var(--text); }
.main-nav a.active::after {
    content: ''; position: absolute; inset-inline: 0; bottom: -2px; height: 2px; background: var(--accent); border-radius: 2px;
}
.header-actions { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }

.search-form { display: flex; align-items: center; background: var(--surface-2); border-radius: 999px; padding: 4px 4px 4px 14px; }
.search-form input { background: none; border: none; outline: none; width: 150px; padding: 6px 0; }
.search-form button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; color: var(--muted); }
.search-form button:hover { color: var(--text); }

.lang-switch { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.lang-btn { padding: 5px 11px; border-radius: 999px; font-weight: 600; font-size: .85rem; color: var(--muted); transition: .2s; }
.lang-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.cart-link { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; }
.cart-link:hover { background: var(--surface-2); }
.cart-badge {
    position: absolute; top: 2px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 4px;
    background: var(--accent); color: #fff; border-radius: 999px; font-size: .68rem; font-weight: 700;
    display: grid; place-items: center;
}
.nav-toggle { display: none; width: 40px; height: 40px; border-radius: 10px; place-items: center; }

/* ---- Hero ---------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%); border-bottom: 1px solid var(--border); }
/* soft colour blobs behind the content */
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-bg .blob { position: absolute; border-radius: 50%; filter: blur(72px); opacity: .55; }
.hero-bg .blob-1 { width: 420px; height: 420px; background: #dbeafe; top: -120px; inset-inline-end: -60px; }
.hero-bg .blob-2 { width: 360px; height: 360px; background: #fde6e1; bottom: -150px; inset-inline-start: 8%; }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 48px; padding-block: 88px; }

.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; padding: 7px 14px 7px 12px; font-size: .8rem; font-weight: 600; box-shadow: var(--shadow); }
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.hero-title { font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.04; margin-top: 18px; }
.hero-subtitle { color: var(--muted); font-size: 1.12rem; margin: 18px 0 28px; max-width: 44ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; gap: 2px; }
.hero-stats li + li { padding-inline-start: 26px; border-inline-start: 1px solid var(--border); }
.hero-stats strong { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.hero-stats span { font-size: .8rem; color: var(--muted); }

/* layered product composition */
.hero-art { position: relative; min-height: 440px; }
.hero-card { position: absolute; border-radius: 24px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-lg); }
.hero-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-card-main { width: 62%; aspect-ratio: 4 / 5; inset-inline-end: 6%; top: 3%; z-index: 2; }
.hero-card-mini { width: 40%; aspect-ratio: 1 / 1; inset-inline-start: 2%; bottom: 6%; z-index: 3; border: 6px solid #fff; }
.hero-badge-float { position: absolute; z-index: 4; top: 10%; inset-inline-start: 0; background: #fff; border-radius: 14px;
    padding: 9px 14px 9px 9px; box-shadow: var(--shadow-lg); display: inline-flex; align-items: center; gap: 10px; font-size: .82rem; font-weight: 700; }
.hero-badge-float .bf-ico { width: 34px; height: 34px; border-radius: 10px; background: #dcfce7; color: #16a34a; display: grid; place-items: center; }

/* ---- Features ------------------------------------------------------------ */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-block: 48px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: .25s var(--ease); }
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.feature-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.feature-card p { color: var(--muted); font-size: .92rem; }

/* ---- Section head -------------------------------------------------------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 26px; }
.section-head h2 { font-size: 1.6rem; }
.page-title { font-size: 1.9rem; margin-bottom: 26px; }

/* ---- Product grid & cards ------------------------------------------------ */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.product-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column; transition: .25s var(--ease);
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.card-media { position: relative; aspect-ratio: 4/5; overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.product-card:hover .card-media img { transform: scale(1.05); }
.stock-tag {
    position: absolute; top: 12px; inset-inline-start: 12px; font-size: .7rem; font-weight: 700;
    padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em;
}
.stock-tag.out { background: var(--danger); color: #fff; }
.stock-tag.low { background: #fef3c7; color: #92400e; }
.stock-tag.in  { background: #dcfce7; color: #166534; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card-title { font-size: 1rem; font-weight: 600; }
.card-colors { display: flex; gap: 6px; margin-top: 2px; }
.swatch { width: 16px; height: 16px; border-radius: 999px; border: 1px solid rgba(0,0,0,.12); display: inline-block; }
.swatch.sm { width: 13px; height: 13px; }
.swatch.lg { width: 30px; height: 30px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.card-price, .price { font-weight: 700; }
.btn-quick-add {
    width: 38px; height: 38px; border-radius: 999px; background: var(--accent); color: #fff;
    display: grid; place-items: center; transition: .2s var(--ease);
}
.btn-quick-add:hover { transform: scale(1.08); background: #000; }
.btn-quick-add.disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

.empty-state { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 0; }

/* ---- Shop layout / filters ---------------------------------------------- */
.shop-layout { display: grid; grid-template-columns: 260px 1fr; gap: 30px; padding-block: 34px; align-items: start; }
.filters-toggle { display: none; margin-bottom: 16px; }
.filters {
    position: sticky; top: calc(var(--header-h) + 16px);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.filters-head h3 { font-size: 1.1rem; }
.filters-close { display: none; font-size: 1.2rem; color: var(--muted); }
.filter-group { padding-block: 16px; border-top: 1px solid var(--border); }
.filter-group:first-of-type { border-top: none; }
.filter-group h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 9px; padding: 5px 0; cursor: pointer; font-size: .93rem; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.price-slider { position: relative; height: 30px; margin: 6px 4px 2px; }
.slider-track { position: absolute; top: 13px; inset-inline: 0; height: 4px; background: var(--surface-2); border-radius: 4px; }
.slider-range { position: absolute; height: 100%; background: var(--accent); border-radius: 4px; }
.price-slider input[type=range] {
    position: absolute; top: 0; inset-inline: 0; width: 100%; height: 30px;
    -webkit-appearance: none; appearance: none; background: none; pointer-events: none;
}
.price-slider input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; pointer-events: all; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; border: 2px solid var(--accent); box-shadow: var(--shadow); cursor: pointer;
}
.price-slider input[type=range]::-moz-range-thumb {
    pointer-events: all; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 2px solid var(--accent); cursor: pointer;
}
.price-inputs { display: flex; gap: 10px; margin-top: 12px; }
.price-inputs label { flex: 1; font-size: .75rem; color: var(--muted); }
.price-inputs input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 4px; }

.color-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-check { cursor: pointer; }
.swatch-check input { display: none; }
.swatch-check .swatch { width: 26px; height: 26px; transition: .15s; }
.swatch-check input:checked + .swatch { outline: 2px solid var(--accent); outline-offset: 2px; }

.size-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.size-check input { display: none; }
.size-check span {
    display: grid; place-items: center; min-width: 40px; padding: 7px 10px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600; transition: .15s;
}
.size-check input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-actions { display: flex; gap: 10px; margin-top: 18px; }
.filter-actions .btn { flex: 1; }

.shop-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.results-count { color: var(--muted); font-size: .92rem; }
.sort-control { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); }
.sort-control select { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 36px; }
.page-btn {
    min-width: 40px; height: 40px; padding: 0 8px; border-radius: var(--radius-sm); display: grid; place-items: center;
    border: 1px solid var(--border); background: var(--surface); font-weight: 600; transition: .15s;
}
.page-btn:hover { border-color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn.disabled { opacity: .4; pointer-events: none; }
.page-ellipsis { display: grid; place-items: center; min-width: 28px; color: var(--muted); }

.grid-loader { display: grid; place-items: center; padding: 40px; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.is-loading { opacity: .45; pointer-events: none; transition: opacity .2s; }

/* ---- Breadcrumb ---------------------------------------------------------- */
.breadcrumb { color: var(--muted); font-size: .85rem; padding-block: 22px; display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--text); }

/* ---- Product page -------------------------------------------------------- */
.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding-bottom: 30px; }
.gallery-main { background: var(--surface-2); border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4/5; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.thumb { width: 74px; height: 90px; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--accent); }

.product-info { padding-top: 10px; }
.product-cat { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.product-title { font-size: 2rem; margin: 8px 0 14px; }
.product-price { font-size: 1.6rem; font-weight: 700; margin-bottom: 12px; }
.stock-line { margin-bottom: 16px; }
.product-desc { color: #3f3f46; margin-bottom: 26px; }
.option-group { margin-bottom: 22px; }
.option-label { display: block; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.option-label strong { color: var(--text); text-transform: none; letter-spacing: 0; font-size: .95rem; }
.color-options, .size-options { display: flex; flex-wrap: wrap; gap: 10px; }
.color-opt input, .size-opt input { display: none; }
.color-opt { cursor: pointer; }
.color-opt input:checked + .swatch { outline: 2px solid var(--accent); outline-offset: 3px; }
.size-opt span {
    display: grid; place-items: center; min-width: 48px; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-weight: 600; transition: .15s;
}
.size-opt input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.size-opt:hover span { border-color: var(--accent); }

.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.qty-stepper.sm { transform: scale(.92); }
.qty-btn { width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.2rem; color: var(--muted); transition: .15s; }
.qty-btn:hover { background: var(--surface-2); color: var(--text); }
.qty-stepper input { width: 46px; text-align: center; border: none; outline: none; background: none; font-weight: 600; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

.purchase-actions { display: flex; gap: 12px; margin-top: 28px; }
.purchase-actions .btn { flex: 1; }

/* ---- Cart ---------------------------------------------------------------- */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 30px; align-items: start; }
.cart-items { display: flex; flex-direction: column; gap: 14px; }
.cart-row {
    display: grid; grid-template-columns: 92px 1fr auto auto auto auto; gap: 16px; align-items: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
    transition: opacity .25s, transform .25s;
}
.cart-row.removing { opacity: 0; transform: translateX(-12px); }
.cart-thumb { width: 92px; height: 92px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cart-name { font-weight: 600; }
.cart-variant { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.cart-variant .dot { opacity: .5; }
.cart-unit, .cart-subtotal { font-weight: 600; white-space: nowrap; }
.cart-subtotal { min-width: 90px; text-align: end; }
.cart-remove { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); transition: .15s; }
.cart-remove:hover { background: #fee2e2; color: var(--danger); }

.cart-summary, .checkout-summary {
    position: sticky; top: calc(var(--header-h) + 16px);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
.cart-summary h3, .checkout-summary h3 { font-size: 1.15rem; margin-bottom: 18px; }
.summary-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: .95rem; }
.summary-row.muted { color: var(--muted); }
.summary-row.total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 16px; font-size: 1.15rem; font-weight: 700; }
.cart-summary .btn, .checkout-summary .btn { margin-top: 14px; }

.empty-cart { text-align: center; padding: 70px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.empty-cart svg { color: var(--border); }

/* ---- Checkout ------------------------------------------------------------ */
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 30px; align-items: start; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.form-card legend { font-weight: 700; font-size: 1.05rem; padding: 0 6px; margin-inline-start: -6px; }
.form-row { margin-top: 16px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field input, .field select {
    padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: .15s;
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; }
.field.invalid input, .field.invalid select { border-color: var(--danger); }
.err { color: var(--danger); font-size: .78rem; min-height: 1em; }

.payment-option { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px solid var(--accent); border-radius: var(--radius); background: var(--surface-2); }
.payment-option .pay-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; }
.captcha-field .captcha-q { background: var(--surface-2); padding: 4px 12px; border-radius: 8px; font-size: 1.05rem; letter-spacing: .04em; }

.summary-items { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; max-height: 320px; overflow-y: auto; }
.summary-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; }
.summary-item-media { position: relative; width: 52px; height: 60px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.summary-item-media img { width: 100%; height: 100%; object-fit: cover; }
.qty-bubble { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px; background: var(--accent); color: #fff; border-radius: 999px; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.summary-item-info { display: flex; flex-direction: column; min-width: 0; }
.summary-item-name { font-weight: 600; font-size: .9rem; }
.summary-item-meta { font-size: .78rem; color: var(--muted); }
.summary-item-price { font-weight: 600; font-size: .9rem; white-space: nowrap; }
.secure-note { display: flex; align-items: center; gap: 7px; justify-content: center; color: var(--muted); font-size: .8rem; margin-top: 14px; }

.flash { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-weight: 500; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-success { background: #dcfce7; color: #166534; }

/* ---- Order success ------------------------------------------------------- */
.success-page { display: grid; place-items: center; }
.success-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 48px 40px; max-width: 560px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.success-icon { width: 84px; height: 84px; border-radius: 999px; background: #dcfce7; color: var(--success); display: grid; place-items: center; margin: 0 auto 20px; }
.success-card h1 { font-size: 1.7rem; margin-bottom: 8px; }
.order-number-box { display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); border-radius: var(--radius); padding: 16px; margin: 24px 0; }
.order-number-box span { font-size: .8rem; color: var(--muted); }
.order-number-box strong { font-size: 1.25rem; letter-spacing: .05em; }
.success-summary { text-align: start; margin-bottom: 22px; }
.success-items { width: 100%; border-collapse: collapse; }
.success-items td { padding: 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.success-items small { display: block; }
.success-items tfoot td { border: none; padding-top: 12px; }
.success-items tfoot .grand td { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: 12px; }

/* ---- Toasts -------------------------------------------------------------- */
.toast-container { position: fixed; top: 84px; inset-inline-end: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
    background: var(--text); color: #fff; padding: 13px 18px; border-radius: var(--radius); box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 500;
    animation: toastIn .3s var(--ease); pointer-events: auto; max-width: 340px;
}
.toast.success { background: #064e3b; }
.toast.error { background: #7f1d1d; }
.toast.hide { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ---- Footer -------------------------------------------------------------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-block: 48px; }
.footer-col h4 { font-size: .95rem; margin-bottom: 14px; }
.footer-col a { display: block; color: var(--muted); padding: 4px 0; }
.footer-col a:hover { color: var(--text); }
.footer-about { color: var(--muted); margin-top: 12px; max-width: 40ch; }
.footer-bottom { border-top: 1px solid var(--border); padding-block: 20px; color: var(--muted); font-size: .85rem; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero-eyebrow, .hero-cta, .hero-stats { justify-content: center; }
    .hero-art { display: none; }
    .features { grid-template-columns: 1fr; }
    .product-layout { grid-template-columns: 1fr; gap: 28px; }
    .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
    .cart-summary, .checkout-summary, .filters { position: static; }
}
@media (max-width: 768px) {
    /* Mobile dropdown nav. Hidden with visibility (not a % transform) so it can
       never peek into the header regardless of how tall its content is. It is
       anchored just below the header and never overlaps it. */
    .main-nav { position: fixed; inset: var(--header-h) 0 auto 0; z-index: 90; flex-direction: column; gap: 0;
        background: var(--surface); border-bottom: 1px solid var(--border); padding: 6px 20px 12px; margin: 0;
        transform: translateY(-12px); opacity: 0; visibility: hidden;
        transition: transform .3s var(--ease), opacity .25s var(--ease), visibility .3s; }
    .main-nav.open { transform: translateY(0); opacity: 1; visibility: visible; box-shadow: var(--shadow-md); }
    .main-nav a { padding: 13px 0; border-bottom: 1px solid var(--border); }
    .nav-toggle { display: grid; }
    .search-form { display: none; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

    /* filters become a slide-in drawer */
    .filters-toggle { display: inline-flex; }
    .shop-layout { grid-template-columns: 1fr; }
    .filters {
        position: fixed; inset: 0 auto 0 0; width: min(86%, 340px); z-index: 200; border-radius: 0;
        transform: translateX(-105%); transition: transform .3s var(--ease); overflow-y: auto;
    }
    .filters.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .filters-close { display: block; }
    body.filters-open::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 150; }

    .cart-row { grid-template-columns: 70px 1fr auto; grid-template-areas: 'img info remove' 'img qty sub'; gap: 10px; }
    .cart-thumb { grid-area: img; width: 70px; height: 70px; }
    .cart-info { grid-area: info; }
    .cart-unit { display: none; }
    .cart-qty { grid-area: qty; }
    .cart-subtotal { grid-area: sub; }
    .cart-remove { grid-area: remove; justify-self: end; }
}
@media (max-width: 480px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .purchase-actions { flex-direction: column; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
