/* ============================================================
   PriceTrack — Redesigned UI
   Aesthetic: Utility-first dark, editorial type, sharp details
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ── Design System ──────────────────────────────────────────── */
:root {
    /* Backgrounds — very dark, almost black, with subtle warmth */
    --bg-base: #0a0a0b;
    --bg-surface: #111114;
    --bg-raised: #18181c;
    --bg-hover: #1f1f24;
    --bg-input: #141417;

    /* Borders */
    --border-dim: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);

    /* Brand — amber/tangerine, not blue */
    --brand: #f5a623;
    --brand-dim: rgba(245, 166, 35, 0.12);
    --brand-glow: rgba(245, 166, 35, 0.25);

    /* Semantic */
    --green: #34d399;
    --green-dim: rgba(52, 211, 153, 0.12);
    --red: #f87171;
    --red-dim: rgba(248, 113, 113, 0.12);
    --blue: #60a5fa;
    --blue-dim: rgba(96, 165, 250, 0.12);

    /* Text */
    --text-1: #f0f0f2;
    --text-2: #8c8c96;
    --text-3: #4a4a54;

    /* Type */
    --font-sans: 'Space Grotesk', system-ui, sans-serif;
    --font-mono: 'Space Mono', monospace;

    /* Geometry */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;

    /* Motion */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --dur: 180ms;
}

/* ── Light Mode ─────────────────────────────────────────────── */
[data-theme='light'] {
    /* Warm off-white, not pure white — easier on eyes, more premium */
    --bg-base: #f2f0eb;
    --bg-surface: #faf9f6;
    --bg-raised: #ebe9e3;
    --bg-hover: #e2dfd8;
    --bg-input: #f4f2ee;

    --border-dim: rgba(60, 55, 45, 0.08);
    --border-default: rgba(60, 55, 45, 0.14);
    --border-strong: rgba(60, 55, 45, 0.26);

    --text-1: #1a1915;
    --text-2: #5a5750;
    --text-3: #9a9690;

    /* Keep brand vivid on light bg */
    --brand-dim: rgba(245, 166, 35, 0.15);
    --green-dim: rgba(22, 163, 74, 0.12);
    --red-dim: rgba(220, 38, 38, 0.10);
    --blue-dim: rgba(37, 99, 235, 0.10);
}

/* ── Reset ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-1);
    padding-top: 68px;
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-raised);
    border-radius: 99px;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
    background: transparent !important;
    border-bottom: none;
    padding: 10px 0;
    height: auto;
}

.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(10, 10, 11, 0.82);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid var(--border-default);
    border-radius: 14px;
    height: 52px;
    position: relative;
}

[data-theme='light'] .navbar-inner {
    background: rgba(242, 240, 235, 0.88);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-1) !important;
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 20px;
    padding: 0;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--brand);
    border-radius: var(--r-sm);
    color: #000;
    font-size: 12px;
}

.brand-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: -0.5px;
}

.navbar-collapse {
    flex: 1;
    align-items: center;
}

@media (min-width: 768px) {
    .navbar-collapse {
        display: flex !important;
    }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    flex-direction: row !important;
    padding: 0;
    margin: 0;
    list-style: none;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-direction: row !important;
    padding: 0;
    margin: 0 0 0 auto;
    list-style: none;
}

/* Nav links */
.nav-link {
    color: var(--text-2) !important;
    font-weight: 500;
    font-size: 0.84rem;
    padding: 5px 10px !important;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color var(--dur), background var(--dur);
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-1) !important;
    background: var(--bg-raised);
}

.nav-link.active {
    color: var(--brand) !important;
    background: var(--brand-dim);
}

/* User chip */
.nav-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--text-2);
    background: var(--bg-raised);
    border: 1px solid var(--border-dim);
    border-radius: 99px;
    padding: 3px 10px 3px 7px;
    white-space: nowrap;
}

.nav-user-chip i {
    color: var(--brand);
    font-size: 0.9rem;
}

/* Vertical separator */
.nav-sep {
    width: 1px;
    height: 18px;
    background: var(--border-default);
    margin: 0 4px;
}

/* Icon-only buttons (theme, lang) */
.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-2);
    border-radius: var(--r-sm);
    padding: 5px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.icon-btn:hover {
    background: var(--bg-raised);
    border-color: var(--border-default);
    color: var(--text-1);
}

.icon-btn i {
    font-size: 0.88rem;
}

.lang-btn {
    font-weight: 700;
    font-size: 0.76rem;
    letter-spacing: 0.4px;
}

/* Hamburger */
.navbar-toggler {
    border: 1px solid var(--border-default) !important;
    background: transparent;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    margin-left: auto;
}

/* Mobile collapse */
@media (max-width: 767.98px) {
    body {
        padding-top: 80px;
    }

    .navbar {
        padding: 8px 16px;
    }

    .navbar-inner {
        border-radius: 12px;
        height: auto;
        flex-wrap: wrap;
        padding: 10px 14px;
        gap: 0;
    }

    .navbar-collapse {
        flex-direction: column !important;
        align-items: stretch;
        width: 100%;
        gap: 6px;
        padding-top: 10px;
    }

    .nav-links,
    .nav-controls {
        flex-direction: column !important;
        gap: 2px;
        width: 100%;
    }

    .nav-link,
    .icon-btn,
    .btn {
        width: 100%;
        justify-content: center;
    }

    .nav-sep {
        width: 100%;
        height: 1px;
        margin: 4px 0;
    }

    .nav-controls {
        margin-left: 0;
        padding-top: 4px;
        border-top: 1px solid var(--border-dim);
    }
}

/* ── Layout Helpers ─────────────────────────────────────────── */
.container {
    max-width: 1100px;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.w-100 {
    width: 100%;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 20px;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 20px;
}

.me-1 {
    margin-right: 4px;
}

.ms-auto {
    margin-left: auto;
}

/* ── Surface / Cards ────────────────────────────────────────── */
.card-dark {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--r-lg);
    transition: border-color var(--dur) var(--ease);
}

.card-dark:hover {
    border-color: var(--border-strong);
}

.card-body {
    padding: 24px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.86rem;
    letter-spacing: 0.01em;
    border-radius: var(--r-md);
    padding: 9px 18px;
    border: none;
    cursor: pointer;
    transition: all var(--dur) var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--brand);
    color: #000;
    font-weight: 700;
}

.btn-primary:hover {
    background: #f7b740;
    color: #000;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-amazon {
    background: #ff9900;
    color: #000;
    font-weight: 700;
}

.btn-amazon:hover {
    background: #ffac2e;
    color: #000;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-default) !important;
    color: var(--text-2);
}

.btn-outline:hover {
    border-color: var(--border-strong) !important;
    color: var(--text-1);
    background: var(--bg-raised);
}

.btn-danger-soft {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.2) !important;
}

.btn-danger-soft:hover {
    background: rgba(248, 113, 113, 0.2);
    color: var(--red);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--r-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 0.95rem;
}

/* ── Form Elements ──────────────────────────────────────────── */
.form-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-2);
    margin-bottom: 8px;
    display: block;
}

.form-control,
.form-select {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-default) !important;
    color: var(--text-1) !important;
    border-radius: var(--r-md) !important;
    padding: 11px 14px !important;
    font-size: 0.93rem !important;
    font-family: var(--font-sans) !important;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease) !important;
}

.form-control::placeholder {
    color: var(--text-3) !important;
}

.form-control:focus,
.form-select:focus {
    outline: none !important;
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px var(--brand-glow) !important;
    background: var(--bg-raised) !important;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.03em;
}

.badge-blue {
    background: var(--blue-dim);
    color: var(--blue);
}

.badge-green {
    background: var(--green-dim);
    color: var(--green);
}

.badge-red {
    background: var(--red-dim);
    color: var(--red);
}

.badge-yellow {
    background: var(--brand-dim);
    color: var(--brand);
}

.badge-gray {
    background: var(--bg-raised);
    color: var(--text-2);
}

/* ── Alert Boxes ────────────────────────────────────────────── */
.alert-box {
    border-radius: var(--r-md);
    padding: 12px 16px;
    font-size: 0.86rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.alert-error {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.alert-success {
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.alert-info {
    background: var(--blue-dim);
    color: var(--blue);
    border: 1px solid rgba(96, 165, 250, 0.2);
}

/* ── Price Display ──────────────────────────────────────────── */
.price-big {
    font-family: var(--font-mono);
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -2px;
    color: var(--text-1);
    line-height: 1;
}

.price-currency {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-3);
    margin-right: 2px;
    vertical-align: top;
    line-height: 2.6;
}

.price-error {
    color: var(--red);
    font-size: 0.84rem;
}

/* ── Hero Section ───────────────────────────────────────────── */
.hero {
    padding: 72px 0 52px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand-dim);
    color: var(--brand);
    border: 1px solid rgba(245, 166, 35, 0.2);
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1.05;
    margin-bottom: 16px;
    color: var(--text-1);
}

.hero h1 em {
    font-style: normal;
    color: var(--brand);
}

.hero p {
    color: var(--text-2);
    font-size: 1rem;
    max-width: 440px;
    margin: 0 auto 36px;
    line-height: 1.65;
}

/* ── Form Card ──────────────────────────────────────────────── */
.form-card {
    max-width: 560px;
    margin: 0 auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--r-lg);
    padding: 28px 32px 32px;
}

.form-card-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.form-card-sub {
    color: var(--text-2);
    font-size: 0.84rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Divider with label */
.form-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-3);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-dim);
}

/* ── Stats Row (Feature Row) ────────────────────────────────── */
.stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 560px;
    margin: 28px auto 0;
}

.stat-card {
    flex: 1;
    min-width: 130px;
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    border-radius: var(--r-md);
    padding: 16px 18px;
    transition: border-color var(--dur) var(--ease);
}

.stat-card:hover {
    border-color: var(--border-default);
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    margin-bottom: 6px;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.5px;
}

.stat-icon {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* ── Product Grid ───────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.product-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.product-card-image {
    height: 170px;
    background: var(--bg-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-dim);
}

.product-card-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    padding: 16px;
}

.product-card-image .no-image {
    color: var(--text-3);
    font-size: 2rem;
}

.product-card-body {
    padding: 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-card-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-1);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -1px;
}

.product-card-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-dim);
    display: flex;
    gap: 8px;
}

/* ── Detail Page ────────────────────────────────────────────── */
.detail-image-wrap {
    background: var(--bg-raised);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border-dim);
}

.detail-image-wrap img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    padding: 20px;
}

.detail-title {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    line-height: 1.4;
    margin-bottom: 16px;
    color: var(--text-1);
}

/* ── Current Price Block ────────────────────────────────────── */
.price-block {
    margin-bottom: 20px;
}

.price-block-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin-bottom: 6px;
    font-family: var(--font-mono);
}

/* ── Inline Stats on Detail ─────────────────────────────────── */
.price-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

.price-stat {
    background: var(--bg-raised);
    border: 1px solid var(--border-dim);
    border-radius: var(--r-md);
    padding: 12px 14px;
}

.price-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.price-stat-value {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* ── History Table ──────────────────────────────────────────── */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.history-table thead th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-3);
    border-bottom: 1px solid var(--border-dim);
    font-family: var(--font-mono);
}

.history-table tbody tr {
    border-bottom: 1px solid var(--border-dim);
    transition: background var(--dur) var(--ease);
}

.history-table tbody tr:last-child {
    border-bottom: none;
}

.history-table tbody tr:hover {
    background: var(--bg-raised);
}

.history-table tbody td {
    padding: 10px 14px;
    color: var(--text-2);
}

.history-table tbody td.mono {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.5px;
}

/* ── Range Buttons ──────────────────────────────────────────── */
.range-btn {
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-dim);
    background: transparent;
    color: var(--text-3);
    font-size: 0.72rem;
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all var(--dur) var(--ease);
}

.range-btn:hover {
    border-color: var(--border-default);
    color: var(--text-2);
}

.range-btn-active {
    border-color: var(--brand) !important;
    background: var(--brand-dim) !important;
    color: var(--brand) !important;
}

/* ── Section heading inside cards ───────────────────────────── */
.card-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-2);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-section-title i {
    color: var(--text-3);
}

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.8px;
    color: var(--text-1);
}

.page-header p {
    color: var(--text-2);
    margin-top: 4px;
    font-size: 0.88rem;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-3);
}

.empty-state .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: block;
    color: var(--text-3);
}

.empty-state p {
    font-size: 0.92rem;
    margin-bottom: 24px;
    color: var(--text-2);
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
    margin-top: 80px;
    padding: 24px 0;
    border-top: 1px solid var(--border-dim);
    color: var(--text-3);
    font-size: 0.78rem;
    text-align: center;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-content {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-default) !important;
    border-radius: var(--r-lg) !important;
    color: var(--text-1) !important;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb-link {
    color: var(--text-2);
    text-decoration: none;
    font-size: 0.83rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color var(--dur) var(--ease);
}

.breadcrumb-link:hover {
    color: var(--text-1);
}

/* ── Inline help text ───────────────────────────────────────── */
.field-hint {
    color: var(--text-3);
    font-size: 0.76rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Canvas ─────────────────────────────────────────────────── */
canvas {
    border-radius: var(--r-md);
}

/* ── Utility: text colours ──────────────────────────────────── */
.text-green {
    color: var(--green);
}

.text-red {
    color: var(--red);
}

.text-brand {
    color: var(--brand);
}

.text-muted {
    color: var(--text-2);
}

.text-dimmed {
    color: var(--text-3);
}

.mono {
    font-family: var(--font-mono);
}

/* ── Bootstrap overrides ────────────────────────────────────── */
.row {
    --bs-gutter-x: 20px;
}

/* ── Language Toggle ────────────────────────────────────────── */
#lang-toggle {
    background: var(--bg-raised);
    border-color: var(--border-default);
    color: var(--text-1);
    cursor: pointer;
    transition: all 0.2s;
}

#lang-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--brand);
    color: var(--brand);
}

/* ── Theme Toggle Button ─────────────────────────────────────── */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 10px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    min-width: auto;
}

.theme-toggle-btn i {
    font-size: 0.82rem;
}

.theme-toggle-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

/* ── Toast Notifications ───────────────────────────────────── */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-notification {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--r-md);
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-1);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 380px;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-hide {
    opacity: 0;
    transform: translateX(40px);
}

.toast-success {
    border-left: 3px solid var(--green);
}

.toast-success i {
    color: var(--green);
}

.toast-error {
    border-left: 3px solid var(--red);
}

.toast-error i {
    color: var(--red);
}

.toast-info {
    border-left: 3px solid var(--blue);
}

.toast-info i {
    color: var(--blue);
}

/* ── How It Works ──────────────────────────────────────────── */
.how-it-works {
    max-width: 780px;
    margin: 64px auto 0;
    text-align: center;
}

.hiw-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-2);
    letter-spacing: -0.3px;
    margin-bottom: 32px;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.hiw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.hiw-step {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    border-radius: var(--r-lg);
    padding: 28px 20px 24px;
    position: relative;
    transition: border-color 0.2s;
}

.hiw-step:hover {
    border-color: var(--border-default);
}

.hiw-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--brand-dim);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.hiw-num {
    position: absolute;
    top: 12px;
    right: 14px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-3);
    opacity: 0.5;
}

.hiw-step h3 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}

.hiw-step p {
    font-size: 0.8rem;
    color: var(--text-2);
    line-height: 1.5;
    margin: 0;
}

/* ── Skeleton Loader ───────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-raised) 25%, var(--bg-hover) 50%, var(--bg-raised) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--r-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 14px;
    width: 70%;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 18px;
    width: 85%;
    margin-bottom: 12px;
}

.skeleton-price {
    height: 28px;
    width: 40%;
}

.skeleton-img {
    height: 140px;
    width: 100%;
    border-radius: var(--r-md) var(--r-md) 0 0;
}

/* ── Mobile Navbar ─────────────────────────────────────────── */
.nav-divider {
    margin-left: 8px;
    border-left: 1px solid var(--border-dim);
    padding-left: 12px;
}

.nav-user {
    color: var(--text-2);
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

@media (max-width: 767.98px) {
    .navbar-nav {
        padding: 16px 0 !important;
        gap: 4px !important;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    .navbar-nav .nav-link {
        padding: 10px 12px !important;
        border-radius: var(--r-sm);
    }

    .navbar-nav .nav-link:hover {
        background: var(--bg-hover);
    }

    .nav-divider {
        margin-left: 0;
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border-dim);
        padding-top: 8px;
        margin-top: 4px;
    }

    .navbar-nav .btn {
        width: 100%;
        justify-content: center;
    }

    #lang-toggle {
        width: 100% !important;
        justify-content: center;
    }

    .hiw-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #toast-container {
        right: 12px;
        left: 12px;
    }

    .toast-notification {
        max-width: 100%;
    }
}

/* ── Price Drop Badge ─────────────────────────────────────── */
.drop-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--green);
    color: #000;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 3px 8px;
    border-radius: var(--r-sm);
    letter-spacing: 0.3px;
    line-height: 1.5;
}

.drop-badge-up {
    background: var(--red);
    color: #fff;
}

/* ── List Controls (Search + Sort) ───────────────────────── */
.list-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.list-search {
    flex: 1;
    position: relative;
}

.list-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    font-size: 0.82rem;
    pointer-events: none;
}

.list-search input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--r-md);
    padding: 9px 12px 9px 34px;
    color: var(--text-1);
    font-size: 0.86rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s;
}

.list-search input:focus {
    border-color: var(--brand);
}

.list-sort-select {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--r-md);
    color: var(--text-1);
    font-size: 0.84rem;
    font-family: var(--font-sans);
    padding: 9px 12px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.list-sort-select:focus {
    border-color: var(--brand);
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.page-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-2);
    border-radius: var(--r-sm);
    padding: 7px 13px;
    font-size: 0.84rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s;
    min-width: 36px;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--brand);
    color: var(--brand);
}

.page-btn-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #000;
    font-weight: 700;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ── Daily Deals ───────────────────────────────────────────── */
.deals-section {
    margin: 48px auto;
    max-width: 1200px;
}

.deals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 24px;
}

.deals-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.deals-nav {
    display: flex;
    gap: 8px;
}

.deals-nav-btn {
    background: var(--bg-raised);
    border: 1px solid var(--border-default);
    color: var(--text-2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.deals-nav-btn:hover {
    color: var(--text-1);
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.deals-track-wrapper {
    position: relative;
    padding: 0 24px;
}

.deals-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 16px;
}

.deals-track::-webkit-scrollbar {
    display: none;
}

.deal-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}

.deal-card:hover {
    border-color: var(--brand);
    transform: translateY(-4px);
}

.deal-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--green);
    color: #000;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    z-index: 2;
}

html[dir="rtl"] .deal-badge {
    right: auto;
    left: 12px;
}

.deal-img-wrap {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.deal-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.deal-img-placeholder {
    color: #ccc;
    font-size: 2rem;
}

.deal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.deal-title {
    font-size: 0.9rem;
    color: var(--text-2);
    margin-bottom: auto;
    line-height: 1.4;
    min-height: 2.8em;
}

.deal-prices {
    margin-top: 12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.deal-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-1);
    font-family: var(--font-mono);
}

.deal-original {
    font-size: 0.85rem;
    color: var(--text-3);
    text-decoration: line-through;
}

.deal-store-badge {
    align-self: flex-start;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-3);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border-dim);
    padding: 24px 0 32px;
    margin-top: 48px;
}

.footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.footer-brand {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-2);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}

.footer-links a {
    color: var(--text-3);
    text-decoration: none;
    transition: color var(--dur) var(--ease);
}

.footer-links a:hover {
    color: var(--brand);
}

.footer-sep {
    color: var(--border-default);
}

.footer-disclosure {
    font-size: 0.75rem;
    color: var(--text-3);
    line-height: 1.6;
    margin: 0;
}