/* ═══════════════════════════════════════════════
   Global Design System (white-label)
   Dark (standart) + Light tema
   Tema <html data-theme="dark|light"> ilə idarə olunur.
   ═══════════════════════════════════════════════ */

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

/* ─── DARK (standart) ─── */
:root, :root[data-theme="dark"] {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #263348;
    --bg-input: #1e293b;
    --bg-surface: #162032;
    --border: #334155;
    --border-light: #475569;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-soft: rgba(59,130,246,0.12);
    --accent: #10b981;
    --accent-soft: rgba(16,185,129,0.12);
    --danger: #ef4444;
    --danger-soft: rgba(239,68,68,0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245,158,11,0.12);
    --stock-low: #facc15;                 /* az qalıq — sarı (narıncı xəbərdarlıqdan fərqlənsin) */
    --stock-low-soft: rgba(250,204,21,0.14);
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --transition: 0.2s cubic-bezier(0.4,0,0.2,1);

    /* Əvvəllər hardcoded olan rənglər — light tema üçün tokenləşdirildi */
    --link-hover: #60a5fa;
    --topbar-from: #1e293b;
    --topbar-to: #162032;
    --thead-from: #1e293b;
    --thead-to: #0f172a;
    --heading-from: #60a5fa;
    --heading-to: #a78bfa;
    --primary-grad-to: #6366f1;
    --accent-grad-to: #059669;
    --danger-grad-to: #dc2626;
    --warning-grad-to: #d97706;
    --on-primary: #fff;
    --on-warning: #000;
    --row-border: rgba(51,65,85,0.5);
    --overlay: rgba(0,0,0,0.75);
}

/* ─── LIGHT ─── */
:root[data-theme="light"] {
    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --bg-surface: #e9eef5;
    --border: #d5dde7;
    --border-light: #bcc7d4;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: rgba(37,99,235,0.10);
    --accent: #059669;
    --accent-soft: rgba(5,150,105,0.12);
    --danger: #dc2626;
    --danger-soft: rgba(220,38,38,0.10);
    --warning: #b45309;
    --warning-soft: rgba(180,83,9,0.12);
    --stock-low: #a16207;                 /* açıq temada sarı oxunmur — tünd sarı */
    --stock-low-soft: rgba(250,204,21,0.30);
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --shadow: 0 4px 20px rgba(15,23,42,0.08);
    --shadow-lg: 0 12px 34px rgba(15,23,42,0.12);

    --link-hover: #1d4ed8;
    --topbar-from: #ffffff;
    --topbar-to: #eef2f7;
    --thead-from: #eef2f7;
    --thead-to: #e2e8f0;
    --heading-from: #1d4ed8;
    --heading-to: #7c3aed;
    --primary-grad-to: #4f46e5;
    --accent-grad-to: #047857;
    --danger-grad-to: #b91c1c;
    --warning-grad-to: #92400e;
    --on-primary: #fff;
    --on-warning: #fff;
    --row-border: rgba(148,163,184,0.35);
    --overlay: rgba(15,23,42,0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ─── Avto hissələri naxışı (fon) ───
   Bütün səhifələrdə sabit (fixed) qat kimi təkrarlanır. Blend rejimi
   naxışın ağ/qara fonunu "şəffaf" edir, beləcə --bg rəngi qorunur. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url("assets/bg/parts-dark.jpg");
    background-repeat: repeat;
    background-size: 520px auto;
    mix-blend-mode: screen;
    opacity: .07;
}
:root[data-theme="light"] body::before {
    background-image: url("assets/bg/parts-light.jpg");
    mix-blend-mode: multiply;
    opacity: .09;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--link-hover); }

/* ═══════════════ TOPBAR ═══════════════ */
.top-bar {
    background: linear-gradient(180deg, var(--topbar-from) 0%, var(--topbar-to) 100%);
    border-bottom: 1px solid var(--border);
    padding: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;          /* masaüstündə həmişə bir sətir */
    gap: 16px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 10px 20px;
}
.top-bar .logo,
.top-bar .navigation,
.top-bar .user-info { flex-shrink: 0; }

.top-bar .logo a { text-decoration: none; }
.top-bar .logo img {
    display: block;
    height: 60px;               /* enli (≈3.8:1) loqo — ~230px en */
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
    transition: transform var(--transition);
}
.top-bar .logo img:hover { transform: scale(1.05); }

/* Mətn loqosu — SITE_LOGO təyin olunmayanda brend adından yaranır */
.top-bar .brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}
.top-bar .brand-link:hover { color: var(--text); }
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--primary), var(--primary-grad-to));
    color: var(--on-primary);
    font-size: 20px;
    box-shadow: 0 6px 16px var(--primary-soft);
}
.brand-word {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.top-bar .navigation ul {
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
}
.top-bar .navigation a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    letter-spacing: 0.02em;
    transition: all var(--transition);
}
.top-bar .navigation a:hover {
    color: var(--text);
    background: var(--primary-soft);
}

.top-bar .user-info {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
    font-size: 13px;
}
.top-bar .user-info a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}
.top-bar .user-info a:hover {
    color: var(--text);
    background: var(--primary-soft);
}
/* ─── Kompakt rejim ───
   Topbar bir sətrə sığmayanda (uzun RU/AZ mətnləri, dar ekran) topbar.php-dəki
   skript <html>-ə data-topbar səviyyəsi qoyur:
     1 → əməliyyat linklərinin yazısı gizlənir (ikon + tooltip qalır), USD hissəsi gizlənir
     2 → əlavə olaraq əsas naviqasiyanın yazıları da gizlənir
   Məlumat daşıyan linklər (ad, səbət məbləği, balans) .tb-keep ilə həmişə görünür. */
html[data-topbar="1"] .top-bar .user-info .tb-label,
html[data-topbar="1"] .top-bar .tb-extra,
html[data-topbar="2"] .top-bar .tb-label,
html[data-topbar="2"] .top-bar .tb-extra { display: none; }

html[data-topbar="1"] .top-bar .user-info a:not(.tb-keep),
html[data-topbar="2"] .top-bar a:not(.tb-keep) { padding-left: 8px; padding-right: 8px; }

/* Topbar ikonları — yazıdan bir az böyük, kompakt rejimdə daha da böyük */
.top-bar .navigation a > i,
.top-bar .user-info a > i { font-size: 17px; width: 20px; text-align: center; }
html[data-topbar] .top-bar a:not(.tb-keep) > i { font-size: 19px; }

/* ─── Topbar axtarışı ─── */
.tb-search {
    flex: 1 1 240px;
    min-width: 150px;
    max-width: 380px;
    display: flex;
    align-items: center;
    height: 40px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.tb-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tb-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 6px 0 16px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
}
.tb-search input::placeholder { color: var(--text-muted); }
.tb-search input::-webkit-search-cancel-button { cursor: pointer; }
.tb-search button {
    flex-shrink: 0;
    width: 44px;
    height: 100%;
    border: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-grad-to));
    color: var(--on-primary);
    font-size: 15px;
    cursor: pointer;
    transition: filter var(--transition);
}
.tb-search button:hover { filter: brightness(1.12); }

/* ─── Endirimli / Yeni gələn düymələri: zoom-in / zoom-out döyüntüsü ─── */
.tb-deals { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tb-deal {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 14px;
    border-radius: 99px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    animation: dealPulse 1.4s ease-in-out infinite;
    will-change: transform;
}
.tb-deal:hover { color: #fff; animation-play-state: paused; filter: brightness(1.1); }
.tb-deal i { font-size: 14px; }
.tb-deal-sale { background: linear-gradient(135deg, #ef4444, #f97316); --deal-glow: rgba(239,68,68,.55); }
.tb-deal-new  { background: linear-gradient(135deg, #10b981, #0ea5e9); --deal-glow: rgba(16,185,129,.55); animation-delay: .7s; }
@keyframes dealPulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 var(--deal-glow); }
    50%      { transform: scale(1.12); box-shadow: 0 0 0 6px transparent, 0 4px 16px var(--deal-glow); }
}
@media (prefers-reduced-motion: reduce) { .tb-deal { animation: none; } }

/* Yer çatmayanda düymələrin yazısı gizlənir, ikon qalır */
html[data-topbar="2"] .tb-deal-label { display: none; }
html[data-topbar="2"] .tb-deal { width: 36px; padding: 0; justify-content: center; }

/* Topbar əlaqə nömrəsi */
.tb-phone {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
/* Nömrə menyunun yanında (solda) qalır; boşluğu istifadəçi bloku özünə alıb sağa sıxılır */
@media (min-width: 901px) {
    .top-bar .user-info { margin-left: auto; }
}
.tb-phone-call,
.tb-phone-wa {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    transition: all var(--transition);
}
.tb-phone-call:hover { color: var(--text); background: var(--primary-soft); }
.tb-phone-wa { color: #25D366; font-size: 17px; }
.tb-phone-wa:hover { color: #25D366; background: rgba(37,211,102,.14); }
.tb-phone-call > i { font-size: 15px; }

/* Yer çatmayanda nömrənin yazısı gizlənir, ikonlar qalır */
html[data-topbar="2"] .tb-phone-num { display: none; }

/* Mobil elementlər masaüstündə gizli; menyu qabı düzülüşə təsir etmir */
.tb-mobile { display: none; }
.tb-menu { display: contents; }

/* ─── Mobil: loqo + səbət + ☰ bir sətirdə, qalan hər şey açılan menyuda ─── */
@media (max-width: 900px) {
    .top-bar .container { flex-wrap: wrap; justify-content: space-between; gap: 0; padding: 8px 14px; }
    .top-bar .logo img { height: 44px; }

    .tb-mobile { display: flex; align-items: center; gap: 8px; }

    /* Axtarış və endirim/yeni düymələri menyuda gizlənmir — ikinci sətirdə */
    .top-bar .logo { order: 1; }
    .tb-mobile     { order: 2; }
    .tb-search     { order: 3; flex: 1 1 auto; max-width: none; margin-top: 10px; height: 42px; }
    .tb-deals      { order: 4; margin: 10px 0 0 8px; gap: 6px; }
    .tb-menu       { order: 5; }
    .tb-deal       { width: 42px; height: 42px; padding: 0; justify-content: center; }
    .tb-deal i     { font-size: 17px; }
    .tb-deal-label { display: none; }
    .tb-mobile-cart {
        position: relative;
        display: inline-flex; align-items: center; gap: 8px;
        height: 42px; padding: 0 14px;
        border-radius: 99px;
        background: var(--accent-soft);
        color: var(--accent);
        font-weight: 700; font-size: 14px;
        white-space: nowrap;
    }
    .tb-mobile-cart .tb-cart-ico > i { font-size: 20px; }
    .tb-mobile-cart:hover { color: var(--accent); }
    .tb-burger {
        width: 42px; height: 42px;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: var(--bg-card);
        color: var(--text);
        font-size: 20px;
        cursor: pointer;
    }

    .tb-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 6px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--border);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    html.nav-open .tb-menu { display: flex; }

    .top-bar .navigation ul,
    .top-bar .user-info { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 2px; }
    .top-bar .navigation a,
    .top-bar .user-info > a {
        display: flex; width: 100%;
        gap: 12px;
        padding: 12px 12px;
        font-size: 15px;
        border-radius: 10px;
        white-space: normal;
    }
    .top-bar .navigation a > i,
    .top-bar .user-info > a > i { font-size: 18px; width: 22px; }
    .top-bar .tb-label { display: inline; }
    .tb-phone { width: 100%; margin: 6px 0 0; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 10px; }
    .tb-phone-call { flex: 1; font-size: 15px; padding: 12px; }
    .tb-phone-num { display: inline !important; }
    .tb-phone-wa { font-size: 20px; padding: 12px 14px; }
    .top-bar .tb-extra { display: inline; }
    .top-bar .tb-desktop-cart { display: none !important; }   /* səbət yuxarı sətirdədir */
    .top-bar .navigation { border-bottom: 1px solid var(--border); padding-bottom: 6px; }

    .top-bar .topbar-tools {
        justify-content: space-between;
        margin: 6px 0 4px;
        padding: 10px 4px 0;
        border-top: 1px solid var(--border);
    }
    .top-bar .lang-switch a { padding: 8px 14px; font-size: 14px; }
    .top-bar .tt-track { transform: scale(1.15); transform-origin: right center; }
}

.top-bar .user-info .separator {
    color: var(--border);
    font-size: 11px;
}

/* ═══════════════ PAGE LAYOUT ═══════════════ */
.page-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

.page-title {
    text-align: center;
    margin-bottom: 28px;
}
.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--heading-from), var(--heading-to));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}
.page-title .subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ═══════════════ CARDS ═══════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-body {
    padding: 24px;
}
.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}
.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

/* ═══════════════ FORMS ═══════════════ */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* Auth forms (login, register, profile) */
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    max-width: 440px;
    margin: 40px auto;
    box-shadow: var(--shadow-lg);
}
.auth-card h2 {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--heading-from), var(--heading-to));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
}

/* ═══════════════ BUTTONS ═══════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-grad-to));
    color: var(--on-primary);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(59,130,246,0.35); }

.btn-success {
    background: linear-gradient(135deg, var(--accent), var(--accent-grad-to));
    color: var(--on-primary);
}
.btn-success:hover { box-shadow: 0 6px 20px rgba(16,185,129,0.35); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-grad-to));
    color: var(--on-primary);
}
.btn-danger:hover { box-shadow: 0 6px 20px rgba(239,68,68,0.35); }

.btn-warning {
    background: linear-gradient(135deg, var(--warning), var(--warning-grad-to));
    color: var(--on-warning);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-xs { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }

.btn-submit {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-grad-to));
    color: var(--on-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59,130,246,0.35);
}

/* ═══════════════ DATA TABLE ═══════════════ */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.table-scroll { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table thead th {
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--thead-from), var(--thead-to));
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}
.data-table tbody tr {
    transition: background var(--transition);
}
.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(51,65,85,0.5);
    font-size: 14px;
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }

.data-table th.center,
.data-table td.center { text-align: center; }

/* ═══════════════ STATUS BADGES ═══════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge .dot {
    width: 6px; height: 6px; border-radius: 50%;
}
.badge-success { background: var(--accent-soft); color: var(--accent); }
.badge-success .dot { background: var(--accent); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-warning .dot { background: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-danger .dot { background: var(--danger); }
.badge-info { background: var(--primary-soft); color: var(--primary); }
.badge-info .dot { background: var(--primary); }

/* ═══════════════ FILTERS ═══════════════ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.filter-bar label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.filter-bar input[type="date"] {
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
}
.filter-bar input[type="date"]:focus { outline: none; border-color: var(--primary); }

/* ═══════════════ FLASH MESSAGES ═══════════════ */
.flash {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: flashIn 0.3s ease-out;
}
@keyframes flashIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.flash-success { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(16,185,129,0.2); }
.flash-error { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }

/* ═══════════════ CONTACT ═══════════════ */
.contact-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 40px;
}
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    min-width: 260px;
}
.contact-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 32px rgba(59,130,246,0.15);
}
.contact-card .phone-icon {
    font-size: 32px;
    margin-bottom: 12px;
}
.contact-card .phone-number {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

/* ═══════════════ EMPTY STATE ═══════════════ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 16px; }

/* ═══════════════ PAGINATION ═══════════════ */
.pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 28px 0;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px; height: 38px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
}
.page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}
.page-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-grad-to));
    border-color: transparent;
    color: var(--on-primary);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

/* ═══════════════ TOAST ═══════════════ */
.toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 99999;
    animation: toastIn 0.3s ease-out, toastOut 0.3s ease-in 2.7s forwards;
    pointer-events: none;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(20px); } }

/* ═══════════════ FOOTER ═══════════════ */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    text-align: center;
    padding: 18px 12px;
    font-size: 13px;
    margin-top: auto;
}

/* ═══════════════ RESPONSIVE ═══════════════ */
/* Topbar-ın responsiv qaydaları TOPBAR bölməsindədir (kompakt rejim + mobil menyu) */
@media (max-width: 992px) {
    .filter-bar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 768px) {
    .page-wrap { padding: 16px 12px 40px; }
    .page-title h1 { font-size: 22px; }
    .auth-card { margin: 20px 12px; padding: 24px 20px; }
    .data-table td { padding: 10px 10px; font-size: 13px; }
    .data-table thead th { padding: 10px; font-size: 10px; }
    .contact-grid { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
    .btn { font-size: 12px; padding: 8px 14px; }
}

/* ═══════════════ QİYMƏT & STOK (qlobal) ═══════════════
   Əvvəllər yalnız product_display_search.php-in daxili <style>-ində idi;
   cart, onecart, order səhifələrində də lazım olduğu üçün bura köçürüldü. */

.product-name {
    font-weight: 600;
    color: var(--text);
}

.price-tag {
    display: inline-block;
    padding: 5px 11px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: var(--radius-xs);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.price-cost {
    display: inline-block;
    padding: 5px 11px;
    background: var(--warning-soft);
    color: var(--warning);
    border-radius: var(--radius-xs);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

/* Sayı bitən malda qiymət əvəzinə göstərilir */
.price-hidden {
    display: inline-block;
    padding: 5px 11px;
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-xs);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    cursor: help;
}

.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.stock-badge.available { background: var(--accent-soft);  color: var(--accent); }
.stock-badge.low       { background: var(--stock-low-soft); color: var(--stock-low); }
.stock-badge.out       { background: var(--danger-soft);  color: var(--danger); }
.stock-badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.stock-badge.available .dot { background: var(--accent); }
.stock-badge.low .dot       { background: var(--stock-low); }
.stock-badge.out .dot       { background: var(--danger); }

/* Müştəriyə tətbiq olunan faiz göstəricisi */
.percent-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 99px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

/* Təcili sifariş nişanı */
.badge-urgent {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 99px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

/* ═══════════════ DİL & TEMA SEÇİCİ ═══════════════ */

.topbar-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
}

.lang-switch {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    overflow: hidden;
    background: var(--bg-surface);
}
.lang-switch a {
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.2;
    transition: background var(--transition), color var(--transition);
}
.lang-switch a:hover { background: var(--primary-soft); color: var(--primary); }
.lang-switch a.active { background: var(--primary); color: var(--on-primary); }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: 99px;
    -webkit-tap-highlight-color: transparent;
}
.theme-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* Gecə (standart) */
.tt-track {
    position: relative;
    display: block;
    width: 60px;
    height: 30px;
    border-radius: 99px;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border: 1px solid rgba(165,180,252,.35);
    box-shadow: inset 0 2px 6px rgba(0,0,0,.45);
    transition: background .45s ease, border-color .45s ease;
    overflow: hidden;
}
/* Ulduzlar — yalnız gecə görünür */
.tt-track::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(1.2px 1.2px at 14px 8px,  #fff 99%, transparent),
        radial-gradient(1px 1px     at 22px 19px, #fff 99%, transparent),
        radial-gradient(1.4px 1.4px at 9px 20px,  #c7d2fe 99%, transparent),
        radial-gradient(1px 1px     at 27px 10px, #fff 99%, transparent);
    transition: opacity .45s ease, transform .45s ease;
}
.tt-ico {
    position: absolute; top: 50%;
    font-size: 12px !important;
    transform: translateY(-50%);
    transition: opacity .35s ease;
    opacity: .55;
}
.tt-sun  { left: 9px;  color: #fbbf24; }
.tt-moon { right: 9px; color: #c7d2fe; opacity: 0; }

.tt-knob {
    position: absolute; top: 2px; left: 2px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: linear-gradient(145deg, #e0e7ff, #a5b4fc);
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
    transform: translateX(30px);                       /* gecə: sağda */
    transition: transform .45s cubic-bezier(.68,-.35,.27,1.35), background .45s ease;
}
.tt-knob i {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px !important;
    transition: opacity .3s ease, transform .45s ease;
}
.tt-k-moon { color: #3730a3; opacity: 1; transform: rotate(0); }
.tt-k-sun  { color: #fff;    opacity: 0; transform: rotate(-120deg) scale(.5); }

.theme-toggle:hover .tt-knob { box-shadow: 0 0 0 4px rgba(165,180,252,.25), 0 2px 6px rgba(0,0,0,.4); }
.theme-toggle:active .tt-knob { width: 28px; transform: translateX(26px); }

/* Gündüz */
:root[data-theme="light"] .tt-track {
    background: linear-gradient(135deg, #7dd3fc, #bae6fd);
    border-color: rgba(14,165,233,.35);
    box-shadow: inset 0 2px 5px rgba(2,132,199,.25);
}
:root[data-theme="light"] .tt-track::before { opacity: 0; transform: translateY(-8px); }
:root[data-theme="light"] .tt-sun  { opacity: 0; }
:root[data-theme="light"] .tt-moon { opacity: .7; color: #0369a1; }
:root[data-theme="light"] .tt-knob {
    transform: translateX(0);                          /* gündüz: solda */
    background: linear-gradient(145deg, #fde047, #f59e0b);
    box-shadow: 0 0 10px rgba(251,191,36,.7), 0 2px 5px rgba(0,0,0,.2);
}
:root[data-theme="light"] .tt-k-sun  { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="light"] .tt-k-moon { opacity: 0; transform: rotate(120deg) scale(.5); }
:root[data-theme="light"] .theme-toggle:active .tt-knob { width: 28px; transform: translateX(0); }

/* Tema dəyişəndə səhifə rəngləri də yumşaq keçsin (JS 450ms üçün qoyur) */
html.theme-anim,
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
    transition: background-color .4s ease, color .4s ease, border-color .4s ease, box-shadow .4s ease !important;
}
/* ...amma açarın öz hərəkəti pozulmasın */
html.theme-anim .tt-knob { transition: transform .45s cubic-bezier(.68,-.35,.27,1.35), background .45s ease, box-shadow .45s ease !important; }
html.theme-anim .tt-knob i,
html.theme-anim .tt-ico,
html.theme-anim .tt-track::before { transition: opacity .35s ease, transform .45s ease !important; }

@media (prefers-reduced-motion: reduce) {
    .tt-knob, .tt-knob i, .tt-ico, .tt-track, .tt-track::before { transition: none !important; }
}

/* Tema keçidi zamanı yumşaq animasiya (istifadəçi azaldılmış hərəkət istəyirsə söndürülür) */
@media (prefers-reduced-motion: no-preference) {
    body, .top-bar, .card, .table-card, .data-table thead th, .form-input, .auth-card {
        transition: background-color var(--transition), border-color var(--transition), color var(--transition);
    }
}

/* ═══════════════ ADMİN ENDİRİMİ ═══════════════ */
.flash-info    { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--border-light); }
.flash-warning { background: var(--warning-soft); color: var(--warning); border: 1px solid var(--border-light); }

.price-old {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 12px;
    white-space: nowrap;
}
.discount-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 99px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    vertical-align: middle;
}
.discount-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 10px);
    color: var(--text-secondary);
    font-size: 14px;
}
.discount-toolbar .form-input { padding: 6px 8px; }
.discount-notify { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; cursor: pointer; }
.discount-input { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); }
.discount-input .form-input { width: 72px; padding: 6px; text-align: center; }

/* ═══════════════ SƏBƏT PANELİ (sağdan açılan) ═══════════════ */
.cart-drawer-backdrop {
    position: fixed; inset: 0; z-index: 1990;
    background: rgba(0,0,0,.45);
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease, visibility .2s;
}
.cart-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 2000;
    width: 420px; max-width: 100vw;
    display: flex; flex-direction: column;
    background: var(--bg-card);
    color: var(--text);
    border-left: 1px solid var(--border);
    box-shadow: -12px 0 40px rgba(0,0,0,.25);
    transform: translateX(100%);
    transition: transform .25s ease;
}
html.cart-open .cart-drawer { transform: none; }
html.cart-open .cart-drawer-backdrop { opacity: 1; visibility: visible; }
html.cart-open, html.cart-open body { overflow: hidden; }

.cart-drawer-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}
.cart-drawer-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.cart-drawer-head .count { color: var(--text-muted); font-weight: 500; font-size: 14px; }
.cart-drawer-close {
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid var(--border); background: transparent; color: var(--text-secondary);
    cursor: pointer; font-size: 15px;
}
.cart-drawer-close:hover { color: var(--text); border-color: var(--border-light); }

.cart-drawer-body { flex: 1; overflow-y: auto; padding: 6px 18px; }
.cart-drawer-item {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--row-border, var(--border));
}
.cart-drawer-item:last-child { border-bottom: 0; }
.cart-drawer-item.is-out { opacity: .75; }
.cart-drawer-item.is-new { animation: cartFlash 1.6s ease; }
@keyframes cartFlash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
.cart-drawer-item .name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.cart-drawer-item .meta { margin-top: 4px; font-size: 12px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cart-drawer-item .right { text-align: right; white-space: nowrap; }
.cart-drawer-item .qty { font-size: 12px; color: var(--text-muted); }
.cart-drawer-item .sum { font-weight: 700; color: var(--accent); margin-top: 4px; }
.cart-drawer-item .stock-badge { padding: 2px 8px; font-size: 11px; }
.cart-drawer-empty { text-align: center; color: var(--text-muted); padding: 48px 0; }
.cart-drawer-empty i { font-size: 36px; display: block; margin-bottom: 10px; opacity: .6; }

.cart-drawer-foot { padding: 16px 18px; border-top: 1px solid var(--border); background: var(--bg-surface); }
.cart-drawer-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-weight: 600; }
.cart-drawer-total strong { font-size: 20px; color: var(--accent); }
.cart-drawer-note { font-size: 12px; color: var(--warning); margin: -4px 0 12px; }
.cart-drawer-foot .btn { width: 100%; justify-content: center; }

/* ═══════════════ ƏN ÇOX AXTARILANLAR ═══════════════ */
.top-searches {
    margin-bottom: 18px;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 10px);
}
.top-searches h2 { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top-searches h2 small { font-weight: 400; color: var(--text-muted); font-size: 13px; }
.top-search-list { display: flex; flex-wrap: wrap; gap: 8px; }
.top-search {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 8px 6px 12px;
    border-radius: 99px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: monospace;
    font-size: 13px;
    text-decoration: none;
}
.top-search:hover, .top-search.active { border-color: var(--primary); color: var(--primary); }
.top-search .n {
    font-family: inherit;
    min-width: 24px; padding: 1px 7px;
    border-radius: 99px;
    background: var(--primary-soft); color: var(--primary);
    font-weight: 700; font-size: 12px; text-align: center;
}
.top-search.hot .n { background: var(--danger-soft); color: var(--danger); }
.top-search .u { color: var(--text-muted); font-size: 11px; font-family: inherit; }
.repeat-badge {
    display: inline-block; margin-left: 6px;
    padding: 1px 6px; border-radius: 99px;
    background: var(--warning-soft); color: var(--warning);
    font-size: 11px; font-weight: 700; font-family: inherit;
}


/* ═══════════════ MİQDAR ADDIM DÜYMƏLƏRİ (− 1 +) ═══════════════ */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--bg-surface);
    overflow: hidden;
}
.qty-stepper .qty-btn {
    width: 30px; height: 32px;
    border: 0; background: transparent;
    color: var(--text-secondary);
    font-size: 15px; line-height: 1;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.qty-stepper .qty-btn:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary); }
.qty-stepper .qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.qty-stepper input {
    width: 48px; height: 32px;
    border: 0; border-inline: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    text-align: center;
    font-size: 14px; font-weight: 600;
    -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper input:focus { outline: none; background: var(--primary-soft); }

/* Sütun başlığındakı "hamısını seç" */
.th-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
}
.th-select input { cursor: pointer; }

/* OEM yanındakı şəkil axtarışı ikonu */
.img-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    margin-left: 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 12px;
    vertical-align: middle;
    transition: all var(--transition);
}
.img-search:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* ═══════════════ ƏLAQƏ: ÜNVAN & XƏRİTƏ ═══════════════ */
.contact-location {
    margin-top: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.contact-address {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px;
}
.map-frame {
    display: block;
    width: 100%;
    height: 340px;
    border: 0;
    border-top: 1px solid var(--border);
    filter: saturate(.9);
}
:root:not([data-theme="light"]) .map-frame { filter: saturate(.85) brightness(.92); }

/* Sayt ayarları səhifəsi */
.settings-row {
    display: grid;
    grid-template-columns: 28px 1fr 150px 150px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.settings-num {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 12px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
@media (max-width: 700px) {
    .settings-row { grid-template-columns: 1fr 1fr; }
    .settings-num { display: none; }
    .settings-row input[type="tel"] { grid-column: 1 / -1; }
}

/* Toplu WhatsApp: alıcı siyahısı */
.wa-people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
}
.wa-person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    cursor: pointer;
    transition: border-color var(--transition);
}
.wa-person:hover { border-color: var(--primary); }
.wa-person strong { display: block; font-size: 14px; }
.wa-person small { color: var(--text-muted); font-size: 12px; font-family: monospace; }

/* Giriş səhifəsində ayırıcı */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 14px;
    color: var(--text-muted);
    font-size: 13px;
}
.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ═══════════════ SƏBƏT XƏBƏRDARLIĞI (sirena) ═══════════════ */
/* Səbətdə məhsul olanda ikon, məbləğ və say nişanı birlikdə qırmızı yanıb-sönür
   ki, müştəri sifarişi unutmasın. Say — WhatsApp bildirişi kimi ikonun küncündə
   qırmızı yumru içində. */
.tb-cart-ico {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.tb-count {
    position: absolute;
    top: -10px;
    right: -12px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 99px;
    background: var(--danger);
    color: #fff;
    border: 2px solid var(--topbar-from);
    box-sizing: border-box;
    font-size: 10px;
    line-height: 14px;
    font-weight: 800;
    text-align: center;
    font-style: normal;
}
/* Nişan ikonun sağından çıxır — məbləğin üstünə düşməsin */
.cart-alert .tb-cart-ico { margin-right: 8px; }

/* İkon həmişə iri; siren zamanı nəzərəçarpacaq dərəcədə böyüyüb-kiçilir */
.tb-cart-ico > i { font-size: 20px; width: 22px; text-align: center; }
.cart-alert .tb-cart-ico > i {
    animation: cartSirenIcon 1.1s ease-in-out infinite;
    transform-origin: center;
}
.cart-alert .tb-cart-sum {
    animation: cartSiren 1.1s ease-in-out infinite;
    transform-origin: center;
}
.cart-alert .tb-cart-sum { display: inline-block; }
.cart-alert .tb-count { animation: cartSirenBadge 1.1s ease-in-out infinite; }

@keyframes cartSiren {
    0%,
    100% { color: var(--danger); text-shadow: 0 0 0 rgba(239,68,68,0); transform: scale(1); }
    45%  { color: #ff5f5f;       text-shadow: 0 0 12px rgba(239,68,68,.95), 0 0 22px rgba(239,68,68,.55); transform: scale(1.1); }
    70%  { color: var(--danger); text-shadow: 0 0 4px rgba(239,68,68,.45); transform: scale(1.02); }
}
@keyframes cartSirenIcon {
    0%,
    100% { color: var(--danger); text-shadow: 0 0 0 rgba(239,68,68,0); transform: scale(1); }
    45%  { color: #ff5f5f;       text-shadow: 0 0 12px rgba(239,68,68,.95), 0 0 22px rgba(239,68,68,.55); transform: scale(1.35); }
    70%  { color: var(--danger); text-shadow: 0 0 4px rgba(239,68,68,.45); transform: scale(1.08); }
}
@keyframes cartSirenBadge {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(239,68,68,0); }
    45%      { transform: scale(1.18); box-shadow: 0 0 0 4px rgba(239,68,68,.25), 0 0 14px rgba(239,68,68,.8); }
}

/* Mobil səbət düyməsi: fon da yüngülcə qırmızıya çalır */
.tb-mobile-cart.cart-alert {
    background: rgba(239,68,68,.14);
    color: var(--danger);
    animation: cartSirenBg 1.1s ease-in-out infinite;
}
@keyframes cartSirenBg {
    0%, 100% { background: rgba(239,68,68,.12); box-shadow: 0 0 0 0 rgba(239,68,68,0); }
    45%      { background: rgba(239,68,68,.26); box-shadow: 0 0 0 4px rgba(239,68,68,.16); }
}

/* Hərəkət azaldılıbsa: yanıb-sönmə yox, sadəcə qırmızı qalır */
@media (prefers-reduced-motion: reduce) {
    .cart-alert .tb-cart-ico > i,
    .cart-alert .tb-cart-sum,
    .cart-alert .tb-count,
    .tb-mobile-cart.cart-alert { animation: none; }
    .cart-alert .tb-cart-ico > i,
    .cart-alert .tb-cart-sum,
    .tb-mobile-cart.cart-alert { color: var(--danger); }
}

/* ═══════════════ MARKA / MODEL AÇILAN SİYAHISI ═══════════════ */
.mm-cell { min-width: 150px; }
.mm-drop { display: block; margin: 2px 0; }
.mm-drop + .mm-drop { margin-top: 5px; }
.mm-drop summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
    transition: all var(--transition);
}
.mm-drop summary::-webkit-details-marker { display: none; }
.mm-drop summary:hover { border-color: var(--primary); color: var(--primary); }
.mm-drop[open] summary { border-color: var(--primary); color: var(--primary); }
.mm-drop summary > i { font-size: 11px; opacity: .8; }
.mm-count {
    padding: 0 6px;
    border-radius: 99px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
}
.mm-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    padding: 8px;
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
}
.mm-list a,
.mm-list span {
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}
.mm-list a:hover { background: var(--primary-soft); color: var(--primary); }
.mm-models .mm-count { background: var(--accent-soft); color: var(--accent); }

/* ═══════════════ TƏSDİQ PƏNCƏRƏSİ (modal) ═══════════════ */
html.modal-open, html.modal-open body { overflow: hidden; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 6, 23, .62);
    animation: fadeIn .16s ease;
}
.modal-backdrop[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }

.modal-box {
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 30px 70px rgba(0,0,0,.5);
    overflow: hidden;
    animation: modalIn .22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }

.modal-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--border);
}
.modal-icon {
    width: 44px; height: 44px;
    flex-shrink: 0;
    border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-grad-to));
    color: var(--on-primary);
    font-size: 19px;
    box-shadow: 0 8px 18px var(--primary-soft);
}
.modal-head h2 { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.25; }
.modal-sub { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.modal-close {
    margin-left: auto;
    width: 32px; height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.modal-close:hover { color: var(--text); border-color: var(--border-light); background: var(--bg-surface); }

.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-hint { margin: 0 0 14px; font-size: 13px; color: var(--text-muted); }

.modal-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
}

/* Xülasə zolağı */
.order-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}
.order-summary strong { font-size: 19px; color: var(--accent); }

/* Sifariş növü kartları */
.order-types { display: flex; flex-direction: column; gap: 10px; }
.order-type {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 15px;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: var(--bg-surface);
    cursor: pointer;
    transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.order-type:hover { transform: translateY(-1px); border-color: var(--border-light); }
.order-type input { position: absolute; opacity: 0; pointer-events: none; }

.order-type-icon {
    width: 44px; height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px;
    transition: all .14s ease;
}
.order-type.delivery .order-type-icon { background: var(--primary-soft); color: var(--primary); }
.order-type.pickup   .order-type-icon { background: var(--accent-soft);  color: var(--accent); }
.order-type.urgent   .order-type-icon { background: var(--danger-soft);  color: var(--danger); }

.order-type-text { flex: 1; min-width: 0; }
.order-type-text strong { display: block; font-size: 15px; margin-bottom: 2px; }
.order-type-text small  { color: var(--text-muted); font-size: 12px; line-height: 1.35; display: block; }

.order-type-check {
    width: 24px; height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    display: inline-flex; align-items: center; justify-content: center;
    color: transparent;
    font-size: 11px;
    transition: all .14s ease;
}

/* Seçilmiş kart */
.order-type:has(input:checked) { background: var(--bg-card); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.order-type.delivery:has(input:checked) { border-color: var(--primary); }
.order-type.pickup:has(input:checked)   { border-color: var(--accent); }
.order-type.urgent:has(input:checked)   { border-color: var(--danger); }
.order-type:has(input:checked) .order-type-icon { transform: scale(1.06); }
.order-type.delivery:has(input:checked) .order-type-check { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.order-type.pickup:has(input:checked)   .order-type-check { background: var(--accent);  border-color: var(--accent);  color: #fff; }
.order-type.urgent:has(input:checked)   .order-type-check { background: var(--danger);  border-color: var(--danger);  color: #fff; }

/* Klaviatura ilə gəzişəndə seçim görünsün */
.order-type:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Mobil: aşağıdan qalxan panel */
@media (max-width: 600px) {
    .modal-backdrop { padding: 0; align-items: flex-end; }
    .modal-box {
        max-width: none;
        max-height: 94vh;
        border-radius: 20px 20px 0 0;
        animation: sheetIn .24s cubic-bezier(.2,.9,.3,1.05);
    }
    @keyframes sheetIn { from { transform: translateY(100%); } }
    .modal-foot .btn { flex: 1; justify-content: center; }
    .order-type-text small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .modal-box, .modal-backdrop { animation: none; }
    .order-type:hover { transform: none; }
}

/* Sifariş qeydi (admin siyahısında) */
.order-note {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    background: var(--warning-soft);
    color: var(--warning);
    font-size: 11px;
    font-weight: 600;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* hidden atributu display təyinatlarını üstələməlidir
   (.flash, .modal-backdrop kimi elementlərdə display qoyulub) */
[hidden] { display: none !important; }

/* Səhv doldurulmuş sahə */
.form-input.input-error {
    border-color: var(--danger);
    background: var(--danger-soft);
}
.field-error {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
}

/* Şəkli olmayan məhsul: OEM koduna görə Google Şəkillər düyməsi */
.img-search-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 10px;
    border: 1px dashed var(--border-light);
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 18px;
    transition: all var(--transition);
}
.img-search-box:hover {
    color: var(--primary);
    border-color: var(--primary);
    border-style: solid;
    background: var(--primary-soft);
}

/* Söndürülmüş düymə: basıla bilmədiyi görünsün */
.btn:disabled,
.btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
    filter: grayscale(.35);
}

/* Qaimə səhifəsindəki admin əməliyyatları */
.order-actions {
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}
.order-actions-hint {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}
