/* ==========================================================================
   Maison Parfum — component layer
   Design language: Amazon-style light marketplace.
   Navy chrome (#161823 / #232F3E), orange accents (#FF9900), yellow primary
   buttons (#FFD814), teal links (#161823), #EAEDED page background.
   Tailwind (CDN) handles utilities; this file holds tokens, components and the
   behaviour Tailwind cannot express.
   Typography: system-first sans stack — no external font CDN (works in CN).
   ========================================================================== */

:root {
    /* TikTok-Shop-style palette -------------------------------------------- */
    --tt-red: #fe2c55;          /* primary action, price emphasis, active nav */
    --tt-red-dark: #e6224a;
    --tt-red-soft: #ffe8ee;
    --tt-cyan: #25f4ee;         /* secondary accent */
    --tt-ink: #161823;          /* headings and body copy */
    --tt-muted: #6b6c77;
    --tt-muted-2: #8a8b91;
    --tt-bg: #f8f8f8;           /* page background */
    --tt-surface: #ffffff;
    --tt-surface-2: #f1f1f2;    /* inputs, subtle fills */
    --tt-border: #e3e3e4;
    --tt-border-soft: #f1f1f2;
    --tt-star: #ffa800;
    --tt-success: #00b578;
    --tt-warning: #ff9500;
    --tt-danger: #fe2c55;

    /* Legacy token names remapped onto the palette so existing class names
       keep working without touching every view. */
    --ink-900: #161823;
    --ink-800: #23252f;
    --ink-700: #3a3c47;
    --ink-600: #55575f;
    --gold-400: #ff7a92;
    --gold-500: #fe2c55;
    --gold-600: #e6224a;
    --cream: #f8f8f8;

    --ok: #00b578;
    --warn: #ff9500;
    --danger: #fe2c55;
    --info: #25f4ee;

    /* Legacy Amazon-era variable names (used by earlier component rules). */
    --amz-navy: #161823;
    --amz-navy-2: #23252f;
    --amz-navy-3: #3a3c47;
    --amz-orange: #fe2c55;
    --amz-orange-dark: #e6224a;
    --amz-yellow: #fe2c55;
    --amz-yellow-hover: #e6224a;
    --amz-yellow-border: #e6224a;
    --amz-link: #161823;
    --amz-link-hover: #fe2c55;
    --amz-price: #161823;
    --amz-star: #ffa800;
    --amz-bg: #f8f8f8;
    --amz-border: #e3e3e4;
    --amz-border-soft: #f1f1f2;
    --amz-text: #161823;
    --amz-muted: #6b6c77;
    --amz-muted-2: #8a8b91;
    --amz-success: #00b578;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(22, 24, 35, .06);
    --shadow: 0 2px 10px rgba(22, 24, 35, .10);
    --shadow-lg: 0 10px 30px rgba(22, 24, 35, .16);

    --header-height: 60px;
    --bottom-nav-height: 56px;
    --ring: 0 0 0 3px rgba(254, 44, 85, .18);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "TikTok Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--tt-ink);
    background: var(--tt-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overscroll-behavior-y: none;
}

/* Kept for the standalone error pages: they render on the light palette too. */
body.theme-dark { background: var(--tt-bg); color: var(--tt-ink); }

h1, h2, h3, h4, .font-display {
    font-family: inherit;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.25;
    margin: 0 0 .5em;
    color: var(--tt-ink);
}
h1, .font-display { letter-spacing: -.02em; }

a { color: var(--tt-ink); text-decoration: none; }
a:hover { color: var(--tt-red); text-decoration: none; }

img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 2px solid var(--amz-orange); outline-offset: 1px; }

/* ------------------------------------------------------------- containers */

.container-x { width: 100%; max-width: 1500px; margin-inline: auto; padding-inline: 14px; }
@media (min-width: 768px) { .container-x { padding-inline: 20px; } }
@media (min-width: 1280px) { .container-x { padding-inline: 24px; } }

/* --------------------------------------------------------------- surfaces */

.surface { background: #fff; border: 1px solid var(--amz-border); border-radius: var(--radius); }
/* Legacy name from the dark theme: now a standard light card so existing
   markup keeps working without a mass rename. */
.surface-dark { background: #fff; border: 1px solid var(--amz-border); border-radius: var(--radius); color: var(--amz-text); }
.surface-pad { padding: 16px; }
@media (min-width: 768px) { .surface-pad { padding: 20px; } }

.hairline { border-bottom: 1px solid var(--amz-border-soft); }

/* ----------------------------------------------------------------- buttons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 18px; border-radius: var(--radius); border: 1px solid transparent;
    font-size: 13.5px; font-weight: 500; line-height: 1.2; cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, color .12s ease;
    white-space: nowrap; text-align: center;
}
.btn:active { transform: scale(.985); }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* Primary = TikTok Shop red pill */
.btn-primary {
    background: var(--tt-red); border-color: var(--tt-red); color: #fff;
    border-radius: var(--radius-pill); font-weight: 600;
}
.btn-primary:hover { background: var(--tt-red-dark); border-color: var(--tt-red-dark); color: #fff; text-decoration: none; }

/* Accent = solid black button (secondary CTA) */
.btn-gold { background: var(--tt-ink); border-color: var(--tt-ink); color: #fff; font-weight: 600; border-radius: var(--radius-pill); }
.btn-gold:hover { background: #000; border-color: #000; color: #fff; text-decoration: none; }

.btn-outline { background: #fff; border-color: var(--tt-border); color: var(--tt-ink); }
.btn-outline:hover { background: var(--tt-surface-2); border-color: #d0d0d3; color: var(--tt-ink); text-decoration: none; }

.btn-ghost { background: transparent; color: var(--tt-muted); border-radius: var(--radius-pill); }
.btn-ghost:hover { background: var(--tt-surface-2); color: var(--tt-ink); text-decoration: none; }

.btn-danger { background: var(--danger); border-color: #b52a10; color: #fff; }
.btn-danger:hover { background: #b52a10; color: #fff; text-decoration: none; }

.btn-success { background: var(--amz-success); border-color: #00795a; color: #fff; }
.btn-success:hover { background: #00795a; color: #fff; text-decoration: none; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

@media (max-width: 767px) {
    .btn { padding: 11px 16px; }              /* comfortable touch targets */
    .btn-block-mobile { width: 100%; }
}

/* ------------------------------------------------------------------ forms */

.field { margin-bottom: 14px; }
.label { display: block; font-size: 13px; font-weight: 700; color: var(--amz-text); margin-bottom: 4px; }
.hint { font-size: 12px; color: var(--amz-muted); margin-top: 4px; }
.error-text { font-size: 12.5px; color: var(--danger); margin-top: 5px; }

.input, .select, .textarea {
    width: 100%; padding: 8px 10px; font-size: 14px; font-family: inherit;
    color: var(--tt-ink); background: var(--tt-surface-2); border: 1px solid transparent; border-radius: var(--radius);
    box-shadow: none;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--tt-ink); background: #fff; box-shadow: 0 0 0 2px rgba(22, 24, 35, .08); }
.input::placeholder, .textarea::placeholder { color: var(--tt-muted-2); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(209, 50, 18, .2); }
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%236b6c77' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }

.checkbox, .radio { width: 16px; height: 16px; accent-color: var(--amz-orange); }
.check-row { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; }
.check-row label { cursor: pointer; }

.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Application shells now use the same light form controls as the storefront. */
.theme-shell .input, .theme-shell .select, .theme-shell .textarea { background: var(--tt-surface-2); border-color: transparent; color: var(--tt-ink); }
.theme-shell .label { color: var(--amz-text); }
.theme-shell .hint { color: var(--amz-muted); }

/* ------------------------------------------------------------------ badges */

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px; border-radius: var(--radius-sm); font-size: 11.5px; font-weight: 600;
    letter-spacing: 0; white-space: nowrap; line-height: 1.6;
}
.badge-success { background: #e5f8f1; color: #00795a; }
.badge-warning { background: #fff4e5; color: #b26a00; }
.badge-danger  { background: var(--tt-red-soft); color: var(--tt-red-dark); }
.badge-info    { background: #e5fbfa; color: #007e78; }
.badge-neutral { background: var(--tt-surface-2); color: var(--tt-muted); }
.badge-gold    { background: var(--tt-ink); color: #fff; }

.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
    border-radius: var(--radius-pill); border: 1px solid var(--tt-border); background: #fff;
    font-size: 12.5px; color: var(--tt-ink); cursor: pointer; transition: all .12s ease;
}
.chip:hover { border-color: var(--tt-ink); background: var(--tt-surface-2); text-decoration: none; }
.chip.is-active { background: var(--tt-ink); border-color: var(--tt-ink); color: #fff; }

/* ------------------------------------------------------------------- cards */

.product-card {
    position: relative; display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border: 1px solid var(--tt-border-soft); border-radius: var(--radius-lg);
    transition: box-shadow .16s ease, transform .16s ease;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card__media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #fff; padding: 8px; }
.product-card__media img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s ease; }
.product-card:hover .product-card__media img { transform: scale(1.03); }
.product-card__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card__priceline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.product-card__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 11.5px; }
.product-card__variant { color: var(--tt-muted-2); }
.product-card__brand { font-size: 11.5px; color: var(--amz-muted); }
.product-card__name { font-size: 14px; font-weight: 500; line-height: 1.35; color: var(--amz-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card:hover .product-card__name { color: var(--tt-red); }
.product-card__foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 4px; }
.product-card__price { font-size: 17px; font-weight: 700; color: var(--tt-ink); }
.product-card__compare { font-size: 12.5px; color: var(--tt-muted-2); text-decoration: line-through; }

.product-media-badge { position: absolute; top: 8px; left: 8px; z-index: 2; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.product-media-action { position: absolute; top: 8px; right: 8px; z-index: 2; }

.stat-card { background: #fff; border: 1px solid var(--amz-border); border-radius: var(--radius); padding: 16px; }
.stat-card__label { font-size: 12px; font-weight: 600; color: var(--amz-muted); }
.stat-card__value { font-size: 26px; font-weight: 700; color: var(--amz-text); line-height: 1.15; margin-top: 4px; letter-spacing: -.02em; }
.stat-card__delta { font-size: 12.5px; font-weight: 600; }
.delta-up { color: var(--amz-success); }
.delta-down { color: var(--danger); }
.delta-flat { color: var(--amz-muted); }

.theme-shell .stat-card { background: #fff; border-color: var(--amz-border); }
.theme-shell .stat-card__value { color: var(--amz-text); }
.theme-shell .stat-card__label { color: var(--amz-muted); }

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left; padding: 11px 12px; font-size: 12.5px; font-weight: 600;
    color: var(--tt-muted); border-bottom: 1px solid var(--tt-border-soft);
    white-space: nowrap; background: #fafafa;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--amz-border-soft); vertical-align: middle; color: var(--amz-text); }
.table tbody tr:hover { background: #fafafa; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }

.theme-shell .table th { background: #f1f1f2; border-color: var(--amz-border); color: var(--amz-muted); }
.theme-shell .table td { border-color: var(--amz-border-soft); color: var(--amz-text); }
.theme-shell .table tbody tr:hover { background: #fafafa; }

/* Mobile: stacked card tables */
@media (max-width: 767px) {
    .table-stack thead { display: none; }
    .table-stack tbody tr { display: block; padding: 12px; border: 1px solid var(--amz-border); border-radius: var(--radius); margin-bottom: 10px; background: #fff; }
    .table-stack tbody td { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border: none; }
    .table-stack tbody td::before { content: attr(data-label); font-size: 11.5px; font-weight: 600; color: var(--amz-muted); flex: 0 0 42%; }
    .theme-shell .table-stack tbody tr { background: #fff; border-color: var(--amz-border); }
}

/* -------------------------------------------------------------- pagination */

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; }
.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm);
    border: 1px solid var(--amz-border); background: #fff; font-size: 13.5px; color: var(--amz-text);
}
.page-link:hover { background: #fafafa; border-color: #b7bcbc; color: var(--amz-text); text-decoration: none; }
.page-link-active { background: var(--tt-ink); border-color: var(--tt-ink); color: #fff; font-weight: 700; }
.page-link-active:hover { background: var(--amz-navy-2); color: #fff; }
.page-link-disabled { opacity: .45; cursor: not-allowed; }
.page-dots { color: var(--amz-muted-2); padding: 0 4px; }

.theme-shell .page-link { background: #fff; border-color: var(--amz-border); color: var(--amz-text); }
.theme-shell .page-link-active { background: var(--amz-navy-2); border-color: var(--amz-navy-2); color: #fff; }

/* ------------------------------------------------------------------ alerts */

.alert { display: flex; gap: 11px; padding: 12px 14px; border-radius: var(--radius); font-size: 13.5px; border: 1px solid transparent; }
.alert-success { background: #e5f8f1; border-color: #b3e6d6; color: #00795a; }
.alert-error   { background: #ffe8ee; border-color: #ffc9d6; color: #e6224a; }
.alert-warning { background: #fff4e5; border-color: #ffd9a0; color: #8a5a00; }
.alert-info    { background: #e5fbfa; border-color: #a8e6e2; color: #007e78; }

.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 32px)); }
.toast {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
    background: #fff; color: var(--amz-text); border: 1px solid var(--amz-border);
    box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toast-in .2s ease;
}
.toast-success { border-left: 4px solid var(--amz-success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--amz-orange); }
.toast-info { border-left: 4px solid var(--amz-link); }
@keyframes toast-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ modals */

.modal-backdrop {
    position: fixed; inset: 0; z-index: 80; background: rgba(15, 17, 17, .55);
    display: flex; align-items: center; justify-content: center; padding: 16px;
    opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s ease;
    backdrop-filter: blur(2px);
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
.modal {
    width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
    background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    transform: translateY(10px); transition: transform .2s ease;
}
.modal-backdrop.is-open .modal { transform: none; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--amz-border-soft); }
.modal-title { font-size: 18px; font-weight: 700; margin: 0; color: var(--amz-text); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--amz-border-soft); background: #fafafa; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-wide { max-width: 760px; }
.modal-close { background: none; border: none; font-size: 22px; line-height: 1; color: var(--amz-muted); cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); }
.modal-close:hover { background: #f1f1f2; color: var(--amz-text); }

/* ----------------------------------------------------------------- drawer */

.drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(15, 17, 17, .5); opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s ease; }
.drawer-backdrop.is-open { opacity: 1; visibility: visible; }
.drawer {
    position: fixed; top: 0; bottom: 0; width: min(360px, 88vw); z-index: 85; background: #fff;
    display: flex; flex-direction: column; transition: transform .22s ease; box-shadow: var(--shadow-lg);
}
.drawer-left { left: 0; transform: translateX(-100%); }
.drawer-right { right: 0; transform: translateX(100%); }
.drawer.is-open { transform: none; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--tt-border); background: #fff; color: var(--tt-ink); }
.drawer-header .font-display { color: var(--tt-ink); }
.drawer-header .modal-close { color: var(--tt-muted); }
.drawer-header .modal-close:hover { background: var(--tt-surface-2); }
.drawer-body { padding: 16px; overflow-y: auto; flex: 1; }

/* ------------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--amz-border); -webkit-overflow-scrolling: touch; }
.tab {
    padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--amz-muted); white-space: nowrap;
    border-bottom: 2px solid transparent; cursor: pointer; background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover { color: var(--amz-text); }
.tab.is-active { color: var(--amz-text); border-bottom-color: var(--amz-orange); font-weight: 700; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.theme-shell .tabs { border-color: var(--amz-border); }
.theme-shell .tab { color: var(--amz-muted); }
.theme-shell .tab:hover { color: var(--amz-text); }
.theme-shell .tab.is-active { color: var(--amz-text); }

/* ---------------------------------------------------------------- dropdown */

.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 6px); right: 0; min-width: 210px; z-index: 60;
    background: #fff; border: 1px solid var(--amz-border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: all .14s ease;
}
.dropdown-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.dropdown-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13.5px; color: var(--amz-text); width: 100%; background: none; border: none; cursor: pointer; text-align: left; }
.dropdown-item:hover { background: #f1f1f2; color: var(--amz-text); text-decoration: none; }
.dropdown-divider { height: 1px; background: var(--amz-border-soft); margin: 5px 0; }

/* ----------------------------------------------------------- empty states */

.empty-state { text-align: center; padding: 40px 20px; color: var(--amz-muted); }
.empty-state__icon { font-size: 38px; opacity: .4; margin-bottom: 10px; }
.empty-state__title { font-size: 18px; font-weight: 700; color: var(--amz-text); margin-bottom: 6px; }
.empty-state__text { font-size: 13.5px; max-width: 420px; margin: 0 auto 18px; }

.skeleton { background: linear-gradient(90deg, #eef0f0 25%, #f7f8f8 37%, #eef0f0 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* --------------------------------------------------------------- storefront */

.site-header { position: relative; z-index: 70; background: #fff; color: var(--tt-ink); border-bottom: 1px solid var(--tt-border); }
.site-header a { color: var(--tt-ink); }
.site-header a:hover { color: var(--tt-red); text-decoration: none; }
.site-header__bar { display: flex; align-items: center; gap: 12px; height: var(--header-height); }
.site-subheader { background: #fff; color: var(--tt-ink); border-bottom: 1px solid var(--tt-border); }
.site-subheader a { color: var(--tt-muted); }
.site-subheader__inner { display: flex; align-items: center; gap: 2px; height: 40px; overflow-x: auto; scrollbar-width: none; }
.site-subheader__inner::-webkit-scrollbar { display: none; }

.logo { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 800; letter-spacing: -.03em; color: var(--tt-ink); }
.logo:hover { color: var(--tt-ink); }
.logo__mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--tt-ink); color: #fff; font-size: 15px; font-weight: 800; }

.nav-link { padding: 7px 10px; border-radius: var(--radius); font-size: 13.5px; color: var(--tt-muted); white-space: nowrap; }
.nav-link:hover { background: var(--tt-surface-2); color: var(--tt-ink); text-decoration: none; }
.nav-link.active { color: var(--tt-ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--tt-red); }

.search-bar { position: relative; display: flex; flex: 1; max-width: 640px; }
.search-bar input {
    width: 100%; padding: 9px 44px 9px 16px; border-radius: var(--radius-pill); border: 1px solid transparent; background: var(--tt-surface-2);
    font-size: 14px; color: var(--tt-ink);
}
.search-bar input:focus { outline: none; background: #fff; border-color: var(--tt-ink); box-shadow: none; }
.search-bar button {
    position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
    border: none; background: transparent; color: var(--tt-muted); width: 36px; height: 36px; border-radius: 50%;
    cursor: pointer; display: grid; place-items: center;
}
.search-bar button:hover { background: var(--tt-surface-2); color: var(--tt-ink); }

.icon-btn { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius); border: none; background: transparent; color: var(--tt-ink); cursor: pointer; }
.icon-btn:hover { background: var(--tt-surface-2); text-decoration: none; }
.icon-count { position: absolute; top: 1px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--tt-red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

.header-stat { display: flex; flex-direction: column; line-height: 1.15; padding: 5px 8px; border-radius: var(--radius); text-align: left; }
.header-stat:hover { background: var(--tt-surface-2); }
.header-stat small { font-size: 11.5px; color: var(--tt-muted); }
.header-stat strong { font-size: 13.5px; font-weight: 700; color: var(--tt-ink); }

.announcement { background: var(--tt-ink); color: #fff; text-align: center; font-size: 12.5px; padding: 8px 16px; }
.announcement a { color: var(--tt-cyan); text-decoration: underline; }

.hero { position: relative; overflow: hidden; background: linear-gradient(115deg, #161823 0%, #23252f 58%, #2f3140 100%); color: #fff; }
.hero::after {
    content: ""; position: absolute; inset: 0;
    background:
        radial-gradient(circle at 84% 76%, rgba(254, 44, 85, .28), transparent 52%),
        radial-gradient(circle at 12% 18%, rgba(37, 244, 238, .16), transparent 46%);
    pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; display: grid; gap: 26px; padding: 40px 0; }
@media (min-width: 900px) { .hero__inner { grid-template-columns: 1.05fr .95fr; align-items: center; padding: 64px 0; } }
.hero h1 { font-size: clamp(28px, 5.4vw, 46px); line-height: 1.1; margin-bottom: 12px; color: #fff; }
.hero p.lead { color: rgba(255, 255, 255, .86); font-size: clamp(14.5px, 2.2vw, 16.5px); max-width: 540px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 24px; }
.hero__stat strong { display: block; font-size: 22px; font-weight: 800; color: #fff; }
.hero__stat span { font-size: 12px; color: rgba(255, 255, 255, .66); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(19px, 3vw, 24px); margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--amz-muted); font-size: 13.5px; }
.section-link { font-size: 13.5px; color: var(--amz-link); font-weight: 500; white-space: nowrap; }
.section-link:hover { color: var(--amz-link-hover); text-decoration: underline; }

.category-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius); background: #fff; border: 1px solid var(--amz-border); height: 100%; transition: all .15s ease; }
.category-tile:hover { border-color: #b7bcbc; box-shadow: var(--shadow-sm); text-decoration: none; }
.category-tile__icon { font-size: 21px; }
.category-tile__name { font-weight: 700; font-size: 14.5px; color: var(--amz-text); }
.category-tile__count { font-size: 12.5px; color: var(--amz-muted); }

.brand-tile { display: grid; place-items: center; padding: 12px; border-radius: var(--radius); background: #fff; border: 1px solid var(--amz-border); transition: all .15s ease; }
.brand-tile:hover { border-color: #b7bcbc; box-shadow: var(--shadow-sm); text-decoration: none; }
.brand-tile img { border-radius: var(--radius-sm); }

.coupon-strip { border: 1px dashed var(--amz-orange); background: #fff8ec; border-radius: var(--radius); padding: 13px 15px; }

.product-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1440px) { .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.product-grid--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .product-grid--wide { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .product-grid--wide { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.rating { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--tt-star); }
.rating span { color: var(--tt-muted); margin-left: 4px; }

.price { font-weight: 700; color: var(--tt-ink); }
.price-lg { font-size: 26px; font-weight: 800; }
.price-was { color: var(--amz-muted-2); text-decoration: line-through; font-size: 13.5px; }

/* product detail gallery */
.gallery { display: grid; gap: 10px; }
.gallery__main { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--amz-border-soft); }
.gallery__main img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.gallery__thumb { flex: 0 0 60px; width: 60px; height: 60px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--amz-border); cursor: pointer; background: #fff; }
.gallery__thumb.is-active { border-color: var(--amz-orange); box-shadow: 0 0 0 1px var(--amz-orange); }
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--amz-border); border-radius: var(--radius-pill); overflow: hidden; background: #f1f1f2; }
.qty button { width: 36px; height: 40px; border: none; background: transparent; font-size: 16px; cursor: pointer; color: var(--amz-text); }
.qty button:hover { background: #e3e6e6; }
.qty input { width: 46px; height: 40px; border: none; background: #fff; text-align: center; font-size: 14px; font-weight: 600; }

.spec-list { display: grid; gap: 8px; }
.spec-row { display: flex; justify-content: space-between; gap: 14px; font-size: 13.5px; padding-bottom: 8px; border-bottom: 1px solid var(--amz-border-soft); }
.spec-row dt { color: var(--amz-muted); }
.spec-row dd { margin: 0; font-weight: 500; text-align: right; color: var(--amz-text); }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--amz-border); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before { content: ""; position: absolute; left: -22px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--amz-border); }
.timeline-item.is-done::before { border-color: var(--amz-success); background: var(--amz-success); }
.timeline-item.is-current::before { border-color: var(--amz-orange); background: var(--amz-orange); }

/* ------------------------------------------------------ mobile bottom nav */

.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff; border-top: 1px solid var(--amz-border);
    display: grid; grid-template-columns: repeat(5, 1fr);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; color: var(--amz-muted); position: relative; }
.bottom-nav a.active { color: var(--tt-ink); font-weight: 700; }
.bottom-nav a.active svg { color: var(--tt-red); }
.bottom-nav a.active::before { content: ""; position: absolute; top: 0; width: 26px; height: 2px; background: var(--tt-red); border-radius: 2px; }
.bottom-nav svg { width: 20px; height: 20px; }
@media (min-width: 768px) { .bottom-nav { display: none; } }
body.has-bottom-nav { padding-bottom: var(--bottom-nav-height); }
@media (min-width: 768px) { body.has-bottom-nav { padding-bottom: 0; } }

/* --------------------------------------------------- application shells */

.shell { display: flex; min-height: 100vh; background: #f8f8f8; }
.shell__sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 250px; z-index: 60;
    background: #fff; color: var(--amz-text); display: flex; flex-direction: column;
    border-right: 1px solid var(--amz-border); transform: translateX(-100%); transition: transform .22s ease;
}
.shell__sidebar.is-open { transform: none; }
@media (min-width: 1024px) { .shell__sidebar { transform: none; } }
.shell__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
@media (min-width: 1024px) { .shell__main { margin-left: 250px; } }

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--tt-border); background: var(--tt-ink); }
.sidebar-brand .font-display, .sidebar-brand p { color: #fff; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px 26px; }
.sidebar-group { margin-bottom: 12px; }
.sidebar-group__title { font-size: 11.5px; font-weight: 700; color: var(--amz-muted); padding: 8px 10px 4px; margin: 0; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13.5px; color: var(--amz-text); border-left: 3px solid transparent; }
.sidebar-link:hover { background: #f1f1f2; color: var(--amz-text); text-decoration: none; }
.sidebar-link.active { background: var(--tt-red-soft); color: var(--tt-red-dark); font-weight: 700; border-left-color: var(--tt-red); }
.sidebar-link svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--amz-muted); }
.sidebar-link.active svg { color: var(--amz-text); }
.sidebar-link__count { margin-left: auto; font-size: 11px; background: var(--tt-red); color: #fff; font-weight: 700; padding: 1px 7px; border-radius: 999px; }

.shell__topbar {
    position: sticky; top: 0; z-index: 55; height: 58px; display: flex; align-items: center; gap: 12px;
    padding: 0 14px; background: #fff; color: var(--tt-ink); border-bottom: 1px solid var(--tt-border);
}
@media (min-width: 1024px) { .shell__topbar { padding: 0 20px; } }
.shell__topbar a { color: var(--tt-ink); }
.shell__topbar .font-display { color: var(--tt-ink); }
.shell__content { flex: 1; padding: 16px 14px 40px; background: #f8f8f8; }
@media (min-width: 768px) { .shell__content { padding: 20px; } }

.sidebar-toggle { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius); border: none; background: var(--tt-surface-2); color: var(--tt-ink); cursor: pointer; }
.sidebar-toggle:hover { background: #e8e8ea; }
@media (min-width: 1024px) { .sidebar-toggle { display: none; } }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 58; background: rgba(15, 17, 17, .5); opacity: 0; visibility: hidden; transition: all .18s ease; }
.sidebar-backdrop.is-open { opacity: 1; visibility: visible; }
@media (min-width: 1024px) { .sidebar-backdrop { display: none; } }

/* auth pages: light card on the gray marketplace background */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 26px 16px; background: var(--amz-bg); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--amz-border); border-radius: var(--radius-lg); padding: 22px 22px 24px; box-shadow: var(--shadow-sm); }
.auth-card h1 { font-size: 24px; margin-bottom: 12px; }
.auth-side { display: none; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.auth-brand .font-display { color: var(--amz-text); }

/* misc utilities */
.muted { color: var(--amz-muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.truncate-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.divider { height: 1px; background: var(--amz-border-soft); margin: 16px 0; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(15, 17, 17, .25); border-top-color: var(--amz-text); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.copy-field { display: flex; gap: 8px; align-items: center; background: #fafafa; border: 1px solid var(--amz-border); border-radius: var(--radius-sm); padding: 8px 11px; }
.copy-field code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }

.chart-box { position: relative; width: 100%; height: 250px; }
@media (min-width: 768px) { .chart-box { height: 290px; } }
.chart-box canvas { max-width: 100%; }

.progress { height: 6px; background: #e3e6e6; border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--tt-red); border-radius: 999px; transition: width .4s ease; }

@media print {
    .site-header, .site-subheader, .bottom-nav, .no-print { display: none !important; }
    body { background: #fff; }
}
