/* ══════════ TRX SITE — design tokens ══════════ */
:root {
    --bg-primary: #07080d;
    --bg-secondary: #0d0e16;
    --bg-card: #11121b;
    --bg-card-hover: #161726;
    --bg-input: #15161f;
    --bg-elev: #181a26;
    --text-primary: #ffffff;
    --text-secondary: #a4a8c0;
    --text-muted: #6a6e84;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-strong: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.32);
    --accent-gradient: linear-gradient(135deg, #6366f1, #3b82f6 55%, #06b6d4);
    --pink: #e840e0;
    --purple: #8b5cf6;
    --green: #22c55e;
    --red: #ef4444;
    --orange: #f59e0b;
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 12px 40px rgba(59, 130, 246, 0.25);
    --maxw: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1c1d29; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2a2b3a; }

/* ══════════ Background decoration ══════════ */
.bg-glow {
    position: fixed;
    top: -300px; left: 50%; transform: translateX(-50%);
    width: 1200px; height: 700px;
    background:
        radial-gradient(40% 40% at 30% 50%, rgba(99, 102, 241, 0.32), transparent 70%),
        radial-gradient(40% 40% at 70% 60%, rgba(6, 182, 212, 0.20), transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at top, rgba(0, 0, 0, 0.6), transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at top, rgba(0, 0, 0, 0.6), transparent 70%);
    z-index: 0;
}

/* ══════════ Topbar ══════════ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: rgba(7, 8, 13, 0.7);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px max(20px, calc((100vw - var(--maxw)) / 2));
    gap: 24px;
}

.brand {
    display: flex; align-items: baseline; gap: 8px;
    font-weight: 800;
}
.brand-mark {
    font-size: 22px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}
.brand-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}
.topbar-nav a, .topbar-nav button.nav-btn {
    padding: 9px 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    background: transparent;
    border: none;
    display: flex; align-items: center; gap: 8px;
}
.topbar-nav a:hover, .topbar-nav button.nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}
.topbar-nav a.active {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.12);
}
.topbar-nav .btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-glow);
    font-weight: 600;
}
.topbar-nav .btn-primary:hover {
    color: #fff;
    transform: translateY(-1px);
}

.mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    flex-direction: column;
    gap: 4px;
    width: 42px; height: 42px;
    align-items: center; justify-content: center;
}
.mobile-toggle span { display: block; width: 18px; height: 2px; background: var(--text-primary); border-radius: 2px; }

@media (max-width: 768px) {
    .topbar { padding: 14px 16px; gap: 12px; }
    .brand-sub { display: none; }
    .topbar-nav {
        position: fixed;
        top: 64px; left: 12px; right: 12px;
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        box-shadow: var(--shadow-card);
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: all 0.2s ease;
    }
    .topbar-nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    .topbar-nav a, .topbar-nav button.nav-btn {
        justify-content: flex-start;
        padding: 12px 14px;
    }
    .mobile-toggle { display: flex; }
}

/* ══════════ Layout ══════════ */
.app {
    position: relative;
    z-index: 1;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 32px max(20px, calc((100vw - var(--maxw)) / 2));
    min-height: calc(100vh - 64px - 240px);
    animation: fadeIn 0.3s ease;
}
.app[hidden] { display: none; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-loader { display: flex; align-items: center; justify-content: center; padding: 80px 0; }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.08);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════ Hero ══════════ */
.hero {
    position: relative;
    padding: 56px 0 40px;
    text-align: center;
}
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-light);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(59, 130, 246, 0.25);
}
.hero h1 {
    font-size: clamp(32px, 5.5vw, 64px);
    font-weight: 800;
    letter-spacing: -1.4px;
    line-height: 1.05;
    background: linear-gradient(135deg, #ffffff 0%, #c4c8e8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero h1 .accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    margin: 18px auto 0;
    color: var(--text-secondary);
    max-width: 640px;
    font-size: clamp(15px, 2vw, 18px);
}
.hero-actions {
    margin-top: 32px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ══════════ Buttons ══════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s, color 0.15s, border-color 0.15s;
    background: transparent;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 50px rgba(59, 130, 246, 0.35); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
    color: var(--text-primary);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--border-strong); }
.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ff8585;
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.18); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 15px; }

/* ══════════ Cards / sections ══════════ */
.section {
    padding: 56px 0;
}
.section-title {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}
.section-sub {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: border-color 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}
.card:hover { border-color: var(--border-strong); }
.card-glow {
    position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(60% 100% at 50% 0%, rgba(59, 130, 246, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.2s;
}
.card:hover .card-glow { opacity: 1; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: transform 0.2s, border-color 0.2s;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.feature-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-light);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
    font-size: 22px;
}
.feature-card h3 { font-size: 17px; margin-bottom: 6px; }
.feature-card p { color: var(--text-secondary); font-size: 14px; }

/* ══════════ Forms ══════════ */
.auth-wrap {
    max-width: 460px;
    margin: 40px auto 0;
}
.auth-wrap .card { padding: 32px; }
.auth-wrap h2 {
    font-size: 26px;
    margin-bottom: 6px;
}
.auth-wrap .subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}

.field {
    display: block;
    margin-bottom: 16px;
}
.field label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}
.field input, .field textarea {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}
.field input:focus, .field textarea:focus {
    border-color: var(--accent);
    background: var(--bg-elev);
}
.field input::placeholder { color: var(--text-muted); }
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.form-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ffacac;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}
.form-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-foot {
    margin-top: 18px;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
}
.auth-foot a {
    color: var(--accent-light);
    font-weight: 500;
}
.auth-foot a:hover { text-decoration: underline; }

.divider {
    display: flex; align-items: center; gap: 12px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 24px 0;
}
.divider::before, .divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ══════════ Profile ══════════ */
.profile {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    margin-top: 8px;
}
@media (max-width: 900px) {
    .profile { grid-template-columns: 1fr; }
}

.profile-aside .card { padding: 22px; }
.profile-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700;
    margin-bottom: 14px;
    box-shadow: var(--shadow-glow);
}
.profile-name {
    font-size: 18px; font-weight: 600; margin-bottom: 4px;
}
.profile-email {
    font-size: 13px; color: var(--text-secondary);
    word-break: break-all;
}

.profile-menu {
    margin-top: 18px;
    display: flex; flex-direction: column; gap: 4px;
}
.profile-menu button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
    display: flex; align-items: center; gap: 10px;
}
.profile-menu button:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.04); }
.profile-menu button.active {
    background: rgba(59, 130, 246, 0.14);
    color: var(--text-primary);
}
.profile-menu button.danger { color: #ff8585; }
.profile-menu button.danger:hover { background: rgba(239, 68, 68, 0.1); }

.profile-content .card { padding: 28px; }

/* Linked badge */
.link-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}
.link-badge.linked { background: rgba(34, 197, 94, 0.12); color: #86efac; }
.link-badge.unlinked { background: rgba(245, 158, 11, 0.12); color: #fcd34d; }

/* Code box */
.code-box {
    background: var(--bg-input);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
    margin: 14px 0;
    position: relative;
}
.code-box .code {
    font-family: ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--accent-light);
}
.code-box .copy-btn {
    position: absolute;
    top: 12px; right: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
}
.code-box .copy-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.1); }
.code-timer {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Orders / wishlist */
.empty-state {
    text-align: center;
    padding: 36px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}
.empty-state svg, .empty-state .ico {
    font-size: 36px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: block;
}

.order-list { display: flex; flex-direction: column; gap: 12px; }
.order-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: border-color 0.15s;
}
.order-card:hover { border-color: var(--border-strong); }
.order-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; gap: 12px;
}
.order-num {
    font-family: ui-monospace, monospace;
    font-size: 13px; color: var(--text-secondary);
}
.order-status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}
.order-status.s-paid { background: rgba(34, 197, 94, 0.14); color: #86efac; }
.order-status.s-pending { background: rgba(245, 158, 11, 0.14); color: #fcd34d; }
.order-status.s-shipped { background: rgba(59, 130, 246, 0.14); color: #93c5fd; }
.order-status.s-delivered { background: rgba(34, 197, 94, 0.14); color: #86efac; }
.order-status.s-cancelled { background: rgba(239, 68, 68, 0.14); color: #fca5a5; }
.order-status.s-refunded { background: rgba(168, 85, 247, 0.14); color: #d8b4fe; }
.order-status.s-processing { background: rgba(99, 102, 241, 0.14); color: #a5b4fc; }

.order-body {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
    flex-wrap: wrap;
}
.order-items {
    color: var(--text-secondary);
    font-size: 13px;
    flex: 1;
}
.order-items .item { padding: 2px 0; }
.order-total {
    font-size: 18px; font-weight: 700;
    color: var(--text-primary);
}
.order-meta {
    margin-top: 10px;
    display: flex; gap: 14px; flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
}
.order-meta .tracking {
    color: var(--accent-light);
    font-family: ui-monospace, monospace;
}

.wish-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.wish-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.15s, border-color 0.15s;
}
.wish-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.wish-card .img {
    aspect-ratio: 1;
    background: var(--bg-input);
    background-size: cover;
    background-position: center;
}
.wish-card .body { padding: 12px; }
.wish-card .name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}
.wish-card .price { font-size: 15px; font-weight: 700; color: var(--accent-light); }
.wish-card .old { text-decoration: line-through; color: var(--text-muted); font-size: 12px; margin-left: 6px; }
.wish-card .out-of-stock {
    margin-top: 6px; font-size: 11px; color: #fca5a5;
}

/* ══════════ Footer ══════════ */
.footer {
    border-top: 1px solid var(--border);
    background: rgba(7, 8, 13, 0.6);
    padding: 36px max(20px, calc((100vw - var(--maxw)) / 2)) 30px;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}
.footer-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 600px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}
.footer-text { font-size: 14px; max-width: 400px; }
.footer-links {
    display: flex; flex-direction: column; gap: 6px;
    font-size: 14px;
}
.footer-links a:hover { color: var(--text-primary); }
.footer-meta {
    grid-column: 1 / -1;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 8px;
}

/* ══════════ Toast ══════════ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: var(--shadow-card);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    max-width: calc(100vw - 48px);
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.error { border-color: rgba(239, 68, 68, 0.4); color: #ffd6d6; }
.toast.success { border-color: rgba(34, 197, 94, 0.4); color: #d2f8dc; }

/* ══════════ Misc ══════════ */
.muted { color: var(--text-muted); }
.row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }

.kbd {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    font-family: ui-monospace, monospace;
    font-size: 12px;
}


/* ══════════ Icons inline ══════════ */
svg.ico {
    display: inline-block;
    vertical-align: -3px;
    flex-shrink: 0;
}
.topbar-nav a svg.ico,
.topbar-nav button svg.ico,
.btn svg.ico {
    margin-right: 4px;
}
.topbar-nav .btn-primary svg.ico { color: #fff; }

/* Online dot */
.dot-online {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
}

/* ══════════ Section head ══════════ */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.section-head .section-title { margin-bottom: 4px; }
.section-head .section-sub { margin-bottom: 0; }

/* ══════════ Category chips ══════════ */
.cat-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cat-chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 8px;
    white-space: nowrap;
}
.cat-chip:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
}
.cat-chip.active {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.4);
    color: var(--text-primary);
}

/* ══════════ Product grid + card ══════════ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
@media (max-width: 600px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
    display: flex; flex-direction: column;
    color: var(--text-primary);
}
.product-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: 0 14px 40px rgba(0,0,0,0.4);
}
.product-img {
    aspect-ratio: 1;
    background: var(--bg-input);
    background-size: cover;
    background-position: center;
    position: relative;
}
.img-placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.badge-discount {
    position: absolute;
    top: 10px; left: 10px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}
.badge-oos {
    position: absolute;
    bottom: 10px; left: 10px; right: 10px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.product-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.product-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}
.product-rating {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}
.product-rating.big { font-size: 14px; gap: 8px; }
.rating-star { color: #f59e0b; display: inline-flex; }
.product-prices {
    display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
    margin-top: 2px;
}
.product-prices.big .price { font-size: 26px; }
.product-prices.big .old { font-size: 16px; }
.product-prices .price {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.product-prices .old {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
}

/* ══════════ Catalog toolbar ══════════ */
.catalog-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.search-wrap {
    flex: 1;
    min-width: 200px;
    position: relative;
}
.search-input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}
.search-input:focus {
    border-color: var(--accent);
    background: var(--bg-elev);
}
.search-input::placeholder { color: var(--text-muted); }
.search-ico {
    position: absolute;
    left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.sort-select {
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}
.sort-select:focus { outline: none; border-color: var(--accent); }

/* ══════════ Breadcrumbs ══════════ */
.breadcrumbs {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--text-primary); }

/* ══════════ Product page ══════════ */
.product-page {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 28px;
    margin-bottom: 24px;
}
@media (max-width: 900px) {
    .product-page { grid-template-columns: 1fr; }
}

.product-gallery .main-img {
    aspect-ratio: 1;
    background: var(--bg-card);
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    position: relative;
}
.thumbs {
    display: flex; gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.thumb {
    flex: 0 0 auto;
    width: 64px; height: 64px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    background-size: cover;
    background-position: center;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s;
}
.thumb:hover { border-color: var(--border-strong); }
.thumb.active { border-color: var(--accent); }

.product-cat {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-light);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}
.product-title {
    font-size: clamp(22px, 3.5vw, 32px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
}
.product-short {
    color: var(--text-secondary);
    margin: 14px 0;
    font-size: 14px;
}
.stock-line {
    margin: 12px 0;
    font-size: 14px;
}
.stock-yes { color: #86efac; display: inline-flex; align-items: center; gap: 6px; }
.stock-no { color: #fca5a5; display: inline-flex; align-items: center; gap: 6px; }

.qty-row {
    display: inline-flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    margin: 14px 0;
}
.qty-btn {
    width: 36px; height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
}
.qty-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.06); }
.qty-row input {
    width: 60px;
    background: transparent;
    border: none;
    text-align: center;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    outline: none;
    appearance: none;
    -moz-appearance: textfield;
}
.qty-row input::-webkit-outer-spin-button,
.qty-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.action-row {
    display: flex; gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.action-row .btn { flex: 1; min-width: 180px; }

.prose {
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 14px;
}

/* ══════════ Reviews ══════════ */
.reviews-list {
    display: flex; flex-direction: column; gap: 12px;
}
.review-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.review-head {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 8px;
}
.review-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}
.review-name { font-size: 14px; font-weight: 500; }
.review-stars {
    display: inline-flex; gap: 2px;
    color: #f59e0b;
}
.review-stars .ico { color: #f59e0b; }
.review-text { color: var(--text-secondary); font-size: 14px; line-height: 1.55; }

/* ══════════ News grid ══════════ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.15s, border-color 0.15s;
    color: var(--text-primary);
    display: flex; flex-direction: column;
}
.news-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.news-img {
    aspect-ratio: 16 / 9;
    background: var(--bg-input);
    background-size: cover;
    background-position: center;
    position: relative;
}
.news-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.news-date { font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.news-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article {
    max-width: 760px;
    margin: 0 auto;
}
.article-cover {
    aspect-ratio: 16 / 7;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-lg);
    margin-bottom: 22px;
}
.article-meta {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 12px;
}
.article h1 {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 700;
    margin-bottom: 18px;
    line-height: 1.2;
}
.article-body {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}

/* ══════════ Empty state ══════════ */
.empty-state .empty-ico {
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* ══════════ Profile info tiles ══════════ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.info-tile {
    background: var(--bg-elev);
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.info-tile div:last-child {
    font-size: 14px;
    font-weight: 500;
    word-break: break-all;
    margin-top: 2px;
}
.link-tile {
    background: var(--bg-elev);
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.small { font-size: 12px; }

/* ══════════ FAQ ══════════ */
.faq-item {
    padding: 18px 22px;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    display: flex; align-items: center; justify-content: space-between;
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .faq-chev { color: var(--text-muted); transition: transform 0.2s; }
.faq-item[open] .faq-chev { transform: rotate(180deg); }
.faq-item p {
    margin-top: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ══════════ Modal ══════════ */
.modal {
    position: fixed; inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal.show { display: flex; }
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.2s ease;
}
.modal-dialog {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 28px 26px 22px;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-close {
    position: absolute;
    top: 12px; right: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.modal-dialog h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* ══════════ CTA card ══════════ */
.cta-card {
    background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(6,182,212,0.12));
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    backdrop-filter: blur(20px);
}


/* ══════════ Top nav: badges + icon links ══════════ */
.nav-icon-link {
    position: relative;
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: background 0.15s, color 0.15s;
}
.nav-icon-link:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.04); }
.nav-icon-link.active { color: var(--text-primary); background: rgba(59, 130, 246, 0.12); }
.nav-badge {
    position: absolute;
    top: 4px; right: 4px;
    min-width: 17px; height: 17px;
    padding: 0 5px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1;
}
.nav-badge.accent { background: var(--accent); box-shadow: 0 0 0 2px var(--bg-primary); }

@media (max-width: 768px) {
    .nav-icon-link {
        width: auto; height: auto;
        padding: 12px 14px;
        justify-content: flex-start;
        gap: 8px;
    }
    .nav-icon-link::after {
        content: attr(title);
        font-size: 14px;
        font-weight: 500;
    }
    .nav-badge { position: static; margin-left: auto; }
}

/* ══════════ Cart page ══════════ */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 22px;
    align-items: start;
}
@media (max-width: 900px) {
    .cart-layout { grid-template-columns: 1fr; }
}

.cart-list {
    display: flex; flex-direction: column; gap: 10px;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto;
    gap: 14px;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    transition: border-color 0.15s;
}
.cart-item:hover { border-color: var(--border-strong); }
@media (max-width: 600px) {
    .cart-item {
        grid-template-columns: 64px 1fr auto;
        grid-template-areas:
            "img info rm"
            "img qty total";
        gap: 10px;
    }
    .cart-item .cart-img { grid-area: img; }
    .cart-item .cart-info { grid-area: info; }
    .cart-item .cart-qty { grid-area: qty; justify-self: start; }
    .cart-item .cart-line-total { grid-area: total; justify-self: end; }
    .cart-item .cart-remove { grid-area: rm; justify-self: end; }
}

.cart-img {
    width: 80px; height: 80px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
@media (max-width: 600px) { .cart-img { width: 64px; height: 64px; } }

.cart-info { min-width: 0; }
.cart-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.cart-name:hover { color: var(--accent-light); }

.warn-pill {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    font-size: 11px;
}

.cart-qty {
    display: inline-flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
}
.cart-qty .qty-btn {
    width: 28px; height: 28px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
}
.cart-qty .qty-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.cart-qty .qty-input {
    width: 38px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    appearance: textfield;
    -moz-appearance: textfield;
}
.cart-qty .qty-input::-webkit-outer-spin-button,
.cart-qty .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart-line-total {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 80px;
    text-align: right;
}

.cart-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px; height: 32px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: color 0.15s, background 0.15s;
}
.cart-remove:hover {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
}

.cart-summary { position: sticky; top: 90px; }
@media (max-width: 900px) { .cart-summary { position: static; } }

/* ══════════ Wishlist remove button ══════════ */
.product-card-wrap {
    position: relative;
}
.wish-remove {
    position: absolute;
    top: 10px; right: 10px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    z-index: 2;
    transition: background 0.15s, color 0.15s;
}
.wish-remove:hover {
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
}

/* ══════════ Reviews "verified" pill ══════════ */
.verified-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    font-size: 11px;
    font-weight: 500;
    margin-left: 4px;
}


/* ══════════ Checkout ══════════ */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 22px;
    align-items: start;
}
@media (max-width: 900px) {
    .checkout-layout { grid-template-columns: 1fr; }
}

.checkout-form .card { padding: 22px 24px; }
.checkout-h {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
    color: var(--text-primary);
}

.checkout-form textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: vertical;
    min-height: 70px;
}
.checkout-form textarea:focus {
    border-color: var(--accent);
    background: var(--bg-elev);
}

.pay-list {
    display: flex; flex-direction: column; gap: 8px;
}
.pay-option {
    cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s, background 0.15s;
}
.pay-option:hover { border-color: var(--border-strong); background: var(--bg-elev); }
.pay-option input[type="radio"] {
    accent-color: var(--accent);
    width: 16px; height: 16px;
}
.pay-option:has(input:checked) {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.08);
}
.pay-option-body {
    display: flex; align-items: center; gap: 10px;
    font-size: 14px;
    font-weight: 500;
}
.pay-icon {
    color: var(--accent-light);
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.12);
}

.checkout-summary { position: sticky; top: 90px; }
@media (max-width: 900px) { .checkout-summary { position: static; } }
.checkout-summary .card { padding: 22px 24px; }

.ck-items {
    display: flex; flex-direction: column; gap: 6px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--text-secondary);
}
.ck-item {
    display: flex; justify-content: space-between; gap: 10px;
}
.ck-item span:last-child {
    color: var(--text-primary);
    font-weight: 500;
    flex-shrink: 0;
}
.ck-row {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}
.ck-row.total {
    font-size: 18px;
    color: var(--text-primary);
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 6px;
    margin-bottom: 18px;
}
