/* ============================================================
         یکپارچه‌سازی کامل با main.html – متغیرها، هدر، فوتر، منو
         ============================================================ */

      /* ----- ۱. متغیرهای CSS یکپارچه (دارک مد پیش‌فرض) ----- */
      :root {
        --bg: #090c10;
        --bg-2: #0d1117;
        --bg-card: #111720;
        --bg-hover: #141c26;
        --border: rgba(255, 255, 255, 0.065);
        --border-gold: rgba(201, 168, 76, 0.25);
        --gold: #c9a84c;
        --gold-lt: #e4c76b;
        --gold-dk: #a8863c;
        --gold-dim: rgba(201, 168, 76, 0.12);
        --gold-glow: rgba(201, 168, 76, 0.08);
        --t1: #eee9e0;
        --t2: #7d7870;
        --t3: #3f3c34;
        --green: #34d399;
        --red: #f87171;
        --blue: #60a5fa;
        --orange: #fb923c;
        --purple: #a78bfa;
        --radius: 10px;
        --ease: cubic-bezier(0.4, 0, 0.2, 1);
        --dur: 0.28s;
        --topbar-h: 56px;
        --navbar-h: 48px;
        --header-h: calc(var(--topbar-h) + var(--navbar-h));
        --shadow-card: 0 16px 45px rgba(0, 0, 0, 0.5);
        --shadow-topbar: 0 4px 40px rgba(0, 0, 0, 0.5);
        --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.6);
        --shadow-toast: 0 10px 40px rgba(0, 0, 0, 0.5);
      }

      /* ----- ۲. تم لایت (با کلاس .light-mode روی body) ----- */
      body.light-mode {
        --bg: #fafafa;
        --bg-2: #f4f4f4;
        --bg-card: #ffffff;
        --bg-hover: #eeeeee;
        --border: rgba(0, 0, 0, 0.06);
        --border-gold: rgba(201, 168, 76, 0.2);
        --t1: #1e1b16;
        --t2: #6b6560;
        --t3: #b5afa8;
        --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.08);
        --shadow-topbar: 0 4px 30px rgba(0, 0, 0, 0.04);
        --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.12);
        --shadow-toast: 0 10px 30px rgba(0, 0, 0, 0.08);
        --gold-dim: rgba(201, 168, 76, 0.08);
        --gold-glow: rgba(201, 168, 76, 0.04);
      }
      body.light-mode .gold-text-gradient {
        background: linear-gradient(135deg, var(--brand-name-a, #d9b85c), var(--brand-name-b, #b8963a));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
      }
      body.light-mode .brand-logo .name {
        background: linear-gradient(135deg, var(--brand-name-a, #d9b85c), var(--brand-name-b, #b8963a));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
      }
      body.light-mode .topbar {
        background: rgba(250, 250, 250, 0.92);
        backdrop-filter: blur(22px) saturate(1.6);
        border-bottom: 1px solid var(--border);
      }
      body.light-mode .navbar {
        background: rgba(250, 250, 250, 0.75);
        backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--border);
      }
      body.light-mode .search-box input {
        background: rgba(0, 0, 0, 0.02);
        border: 1px solid var(--border);
        color: var(--t1);
      }
      body.light-mode .search-box input:focus {
        border-color: var(--gold);
        box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
      }
      body.light-mode .search-dropdown {
        background: var(--bg-card);
        border: 1px solid var(--border);
        box-shadow: var(--shadow-modal);
      }
      body.light-mode .icon-btn:hover {
        color: var(--gold);
        background: rgba(0, 0, 0, 0.02);
      }
      body.light-mode .btn-sm.outline {
        border: 1px solid var(--border);
        color: var(--t2);
      }
      body.light-mode .btn-sm.outline:hover {
        border-color: var(--gold);
        color: var(--gold);
        background: var(--gold-dim);
      }
      body.light-mode .btn-sm.fill {
        background: var(--gold);
        color: #fff;
      }
      body.light-mode .btn-sm.fill:hover {
        opacity: 0.85;
        transform: translateY(-1px);
      }
      body.light-mode .btn-primary {
        background: var(--gold);
        color: #fff;
      }
      body.light-mode .btn-primary:hover {
        opacity: 0.85;
      }
      body.light-mode .btn-secondary {
        border: 1px solid var(--border);
        color: var(--t2);
      }
      body.light-mode .btn-secondary:hover {
        border-color: var(--gold);
        color: var(--gold);
        background: var(--gold-dim);
      }
      body.light-mode .footer {
        background: var(--bg);
        border-top: 1px solid var(--border);
      }
      body.light-mode .footer-grid h5 {
        color: var(--t1);
      }
      body.light-mode .footer-grid ul li a {
        color: var(--t2);
      }
      body.light-mode .footer-grid ul li a:hover {
        color: var(--gold-dk);
      }
      body.light-mode .footer-copy {
        border-top: 1px solid var(--border);
        color: var(--t2);
        opacity: 0.6;
      }
      body.light-mode .footer .col:first-child p {
        color: var(--t2);
      }
      body.light-mode ::-webkit-scrollbar-track {
        background: var(--bg);
      }
      body.light-mode ::-webkit-scrollbar-thumb {
        background: var(--gold-dim);
      }
      body.light-mode ::-webkit-scrollbar-thumb:hover {
        background: var(--gold);
      }

      /* دکمه بارشا */
      .theme-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: transparent;
        border: 1px solid var(--border);
        color: var(--t2);
        transition: all var(--dur) var(--ease);
        cursor: pointer;
        font-size: 18px;
      }
      .theme-toggle:hover {
        border-color: var(--gold);
        color: var(--gold);
        background: var(--gold-dim);
      }
      .theme-toggle .material-symbols-outlined {
        font-size: 22px;
      }

      /* ============================================================
           ریست و پایه
           ============================================================ */
      *,
      *::before,
      *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }
      html {
        scroll-behavior: smooth;
      }
      body {
        font-family: "Vazirmatn", sans-serif;
        background: var(--bg);
        color: var(--t1);
        overflow-x: hidden;
        -webkit-font-smoothing: antialiased;
        min-height: 100vh;
        padding-top: var(--header-h);
        padding-bottom: 80px;
        transition:
          background var(--dur) var(--ease),
          color var(--dur) var(--ease);
      }
      a {
        text-decoration: none;
        color: inherit;
      }
      img {
        max-width: 100%;
        display: block;
      }
      button {
        cursor: pointer;
        font-family: inherit;
        border: none;
        outline: none;
        background: none;
      }
      ul {
        list-style: none;
      }

      /* ============================================================
           اسکرول‌بار
           ============================================================ */
      ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
      }
      ::-webkit-scrollbar-track {
        background: var(--bg);
      }
      ::-webkit-scrollbar-thumb {
        background: var(--gold-dim);
        border-radius: 99px;
      }
      ::-webkit-scrollbar-thumb:hover {
        background: var(--gold);
      }

      /* ============================================================
           هدر یکپارچه با main.html
           ============================================================ */
      .topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 500;
        height: var(--topbar-h);
        display: flex;
        align-items: center;
        padding: 0 28px;
        background: rgba(9, 12, 16, 0.9);
        backdrop-filter: blur(22px) saturate(1.6);
        border-bottom: 1px solid var(--border);
        transition:
          box-shadow var(--dur) var(--ease),
          background var(--dur) var(--ease),
          border-color var(--dur) var(--ease);
      }
      .topbar.scrolled {
        box-shadow: var(--shadow-topbar);
      }
      .topbar .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        position: relative;
      }
      .brand-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
      }
      .brand-logo .mark {
        width: 32px;
        height: 32px;
        border-radius: var(--radius);
        background: var(--gold-dim);
        border: 1px solid var(--gold);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--gold);
      }
      .brand-logo .name {
        font-size: 19px;
        font-weight: 900;
        background: linear-gradient(135deg, var(--gold-lt), var(--gold));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
      }

      .search-box {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 420px;
        max-width: 40vw;
        z-index: 10;
      }
      .search-box input {
        width: 100%;
        height: 40px;
        border-radius: var(--radius);
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border);
        color: var(--t1);
        padding: 0 40px 0 14px;
        font-size: 13px;
        caret-color: var(--gold);
        transition: all var(--dur) var(--ease);
        outline: none;
      }
      .search-box input::placeholder {
        color: var(--t2);
      }
      .search-box input:focus {
        border-color: var(--gold);
        box-shadow: 0 0 0 3px var(--gold-dim);
      }
      .search-box .search-icon {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--t2);
        pointer-events: none;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .search-dropdown {
        position: absolute;
        top: calc(100% + 6px);
        right: 0;
        left: 0;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 0 0 var(--radius) var(--radius);
        z-index: 600;
        box-shadow: var(--shadow-modal);
        overflow: hidden;
        display: none;
      }
      .search-dropdown.open {
        display: block;
      }
      .search-empty {
        padding: 20px;
        text-align: center;
        color: var(--t2);
        font-size: 12px;
      }

      .topbar-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
        position: relative;
        z-index: 11;
      }
      .icon-btn {
        position: relative;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--t2);
        transition: all var(--dur) var(--ease);
        cursor: pointer;
      }
      .icon-btn:hover {
        color: var(--gold);
        background: rgba(255, 255, 255, 0.04);
      }
      .icon-btn .count {
        position: absolute;
        top: -2px;
        left: -2px;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        font-size: 10px;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
      }
      .icon-btn.wishlist .count {
        background: var(--red);
        color: #fff;
      }
      .icon-btn.cart .count {
        background: var(--gold);
        color: var(--bg);
      }

      .v-sep {
        width: 1px;
        height: 24px;
        background: var(--border);
      }
      .btn-sm {
        padding: 8px 16px;
        border-radius: var(--radius);
        font-size: 12px;
        font-weight: 600;
        transition: all var(--dur) var(--ease);
        cursor: pointer;
        border: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
      }
      .btn-sm.outline {
        border: 1px solid var(--border);
        color: var(--t2);
        background: transparent;
      }
      .btn-sm.outline:hover {
        border-color: var(--gold);
        color: var(--gold);
        background: var(--gold-dim);
      }
      .btn-sm.fill {
        background: var(--gold);
        color: var(--bg);
        font-weight: 700;
      }
      .btn-sm.fill:hover {
        opacity: 0.85;
        transform: translateY(-1px);
      }

      .theme-toggle {
        margin-left: 4px;
      }

      /* دکمه همبرگر (موبایل) */
      .hamburger-btn {
        display: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        color: var(--t2);
        transition: all var(--dur) var(--ease);
        cursor: pointer;
        background: transparent;
        border: none;
      }
      .hamburger-btn:hover {
        color: var(--gold);
        background: var(--gold-dim);
      }
      .hamburger-btn .material-symbols-outlined {
        font-size: 28px;
      }

      /* ===== دراور (منوی موبایل) ===== */
      .drawer-overlay {
        position: fixed;
        inset: 0;
        z-index: 999;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(8px);
        opacity: 0;
        visibility: hidden;
        transition: all var(--dur) var(--ease);
      }
      .drawer-overlay.open {
        opacity: 1;
        visibility: visible;
      }
      .drawer {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 85%;
        max-width: 380px;
        background: var(--bg-card);
        z-index: 1000;
        padding: 40px 28px;
        transform: translateX(100%);
        transition: transform 0.4s var(--ease);
        border-left: 1px solid var(--border);
        overflow-y: auto;
        box-shadow: var(--shadow-modal);
      }
      .drawer.open {
        transform: translateX(0);
      }
      .drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 40px;
      }
      .drawer-header .drawer-brand {
        font-size: 20px;
        font-weight: 900;
        color: var(--gold);
      }
      .drawer-close {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--t2);
        transition: all var(--dur) var(--ease);
        cursor: pointer;
        background: transparent;
        border: none;
      }
      .drawer-close:hover {
        color: var(--gold);
        background: var(--gold-dim);
      }
      .drawer-close .material-symbols-outlined {
        font-size: 28px;
      }
      .drawer-nav {
        display: flex;
        flex-direction: column;
        gap: 20px;
      }
      .drawer-nav a {
        font-size: 18px;
        font-weight: 600;
        color: var(--t2);
        transition: color var(--dur) var(--ease);
        padding: 8px 0;
        border-bottom: 1px solid var(--border);
      }
      .drawer-nav a:hover,
      .drawer-nav a.active {
        color: var(--gold);
      }
      .drawer-auth {
        margin-top: 32px;
        padding-top: 20px;
        border-top: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        gap: 12px;
      }
      .drawer-auth .btn-sm {
        width: 100%;
        justify-content: center;
      }

      /* ===== نوار ناوبری دسکتاپ ===== */
      .navbar {
        position: fixed;
        top: var(--topbar-h);
        left: 0;
        right: 0;
        z-index: 499;
        height: var(--navbar-h);
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(9, 12, 16, 0.7);
        backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--border);
        transition:
          background var(--dur) var(--ease),
          border-color var(--dur) var(--ease);
      }
      .nav-list {
        display: flex;
        align-items: center;
        gap: 4px;
      }
      .nav-item {
        position: relative;
      }
      .nav-link {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 0 16px;
        height: var(--navbar-h);
        font-size: 13px;
        color: var(--t2);
        transition: color var(--dur) var(--ease);
        white-space: nowrap;
        cursor: pointer;
      }
      .nav-link:hover,
      .nav-item.active .nav-link {
        color: var(--t1);
      }
      .nav-item.active .nav-link::after {
        content: "";
        position: absolute;
        bottom: 0;
        right: 16px;
        left: 16px;
        height: 2px;
        background: linear-gradient(90deg, var(--gold), var(--gold-lt));
      }

      /* ============================================================
           دکمه‌های یکپارچه
           ============================================================ */
      .btn-primary {
        padding: 14px 28px;
        border-radius: var(--radius);
        background: var(--gold);
        color: var(--bg);
        font-weight: 700;
        font-size: 15px;
        transition: all var(--dur) var(--ease);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border: none;
        cursor: pointer;
      }
      .btn-primary:hover {
        opacity: 0.85;
        transform: translateY(-2px);
      }
      .btn-primary:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        transform: none;
      }

      .btn-secondary {
        padding: 14px 24px;
        border-radius: var(--radius);
        border: 1px solid var(--border);
        color: var(--t2);
        font-weight: 600;
        font-size: 14px;
        transition: all var(--dur) var(--ease);
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: transparent;
        cursor: pointer;
      }
      .btn-secondary:hover {
        border-color: var(--gold);
        color: var(--gold);
        background: var(--gold-dim);
      }

      /* ============================================================
           استایل‌های فرم احراز هویت
           ============================================================ */
      .auth-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: calc(100vh - var(--header-h) - 160px);
        padding: 40px 20px;
      }

      .auth-box {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 40px 32px;
        max-width: 420px;
        width: 100%;
        box-shadow: var(--shadow-modal);
      }

      .auth-title {
        font-size: 24px;
        font-weight: 700;
        color: var(--gold);
        text-align: center;
        margin-bottom: 6px;
      }

      .auth-sub {
        font-size: 13px;
        color: var(--t2);
        text-align: center;
        margin-bottom: 28px;
      }

      .form-group {
        margin-bottom: 18px;
      }
      .form-group label {
        display: block;
        font-size: 12px;
        color: var(--t2);
        margin-bottom: 5px;
        font-weight: 600;
      }
      .form-group input {
        width: 100%;
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        color: var(--t1);
        font-size: 15px;
        transition: border-color var(--dur) var(--ease);
        outline: none;
        font-family: inherit;
      }
      .form-group input:focus {
        border-color: var(--gold);
        box-shadow: 0 0 0 3px var(--gold-dim);
      }
      .form-group input::placeholder {
        color: var(--t3);
      }

      .error-msg {
        color: var(--red);
        font-size: 12px;
        margin-top: 6px;
        display: none;
      }
      .success-msg {
        color: var(--green);
        font-size: 12px;
        margin-top: 6px;
        display: none;
      }

      .otp-row {
        display: flex;
        gap: 10px;
      }
      .otp-row input {
        flex: 1;
      }
      .otp-row .btn {
        flex: 0 0 auto;
        width: auto;
        padding: 12px 24px;
      }

      .step-indicator {
        display: flex;
        justify-content: center;
        gap: 12px;
        margin-bottom: 24px;
      }
      .step-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--t3);
        transition: background 0.3s;
      }
      .step-dot.active {
        background: var(--gold);
      }
      .step-dot.done {
        background: var(--green);
      }

      .timer {
        font-size: 12px;
        color: var(--t2);
        text-align: center;
        margin-top: 12px;
      }
      .timer span {
        color: var(--gold);
        font-weight: 600;
      }

      .resend-btn {
        background: none;
        border: none;
        color: var(--gold);
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        text-decoration: underline;
        margin-top: 6px;
      }
      .resend-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
      }

      .hidden {
        display: none !important;
      }

      .auth-footer {
        margin-top: 16px;
        text-align: center;
        font-size: 11px;
        color: var(--t3);
      }
      .auth-footer a {
        color: var(--gold);
      }

      /* ============================================================
           فوتر یکپارچه با main.html
           ============================================================ */
      .footer {
        background: var(--bg);
        padding-top: 40px;
        padding-bottom: 16px;
        border-top: 1px solid var(--border);
        margin-top: 60px;
        transition:
          background var(--dur) var(--ease),
          border-color var(--dur) var(--ease);
      }
      .footer .container {
        max-width: 1360px;
        margin: 0 auto;
        padding: 0 28px;
      }
      .footer-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        margin-bottom: 32px;
      }
      .footer-grid .col:first-child {
        max-width: 280px;
      }
      .footer-grid h5 {
        font-size: 18px;
        font-weight: 700;
        color: var(--t1);
        margin-bottom: 16px;
      }
      .footer-grid ul li {
        margin-bottom: 8px;
      }
      .footer-grid ul li a {
        font-size: 14px;
        color: var(--t2);
        transition: color var(--dur) var(--ease);
      }
      .footer-grid ul li a:hover {
        color: var(--gold);
      }
      .footer-copy {
        padding-top: 16px;
        border-top: 1px solid var(--border);
        text-align: center;
        font-size: 11px;
        color: var(--t2);
        opacity: 0.4;
        text-transform: uppercase;
        letter-spacing: 0.4em;
      }

      /* ============================================================
           Toast
           ============================================================ */
      #toast-container {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 9999;
        display: flex;
        flex-direction: column;
        gap: 10px;
      }
      .toast {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-right: 3px solid var(--gold);
        border-radius: var(--radius);
        padding: 12px 20px;
        color: var(--t1);
        font-size: 13px;
        box-shadow: var(--shadow-toast);
        animation: slideIn 0.3s var(--ease);
        min-width: 200px;
      }
      .toast.success {
        border-right-color: var(--green);
      }
      .toast.error {
        border-right-color: var(--red);
      }
      @keyframes slideIn {
        from {
          opacity: 0;
          transform: translateX(40px);
        }
        to {
          opacity: 1;
          transform: translateX(0);
        }
      }

      /* ============================================================
           واکنش‌گرایی
           ============================================================ */
      @media (max-width: 1024px) {
        .search-box {
          display: none;
        }
        .footer-grid {
          grid-template-columns: repeat(2, 1fr);
        }
      }

      @media (max-width: 600px) {
        .topbar {
          padding: 0 14px;
        }
        .brand-logo .name {
          font-size: 16px;
        }
        .topbar-actions .v-sep {
          display: none;
        }
        .btn-sm {
          font-size: 10px;
          padding: 4px 10px;
        }
        .hamburger-btn {
          display: flex !important;
        }
        .navbar {
          display: none !important;
        }
        body {
          padding-top: var(--topbar-h);
        }
        .footer-grid {
          grid-template-columns: 1fr;
        }
        .footer-grid .col:first-child {
          max-width: 100%;
        }
        .auth-box {
          padding: 24px 16px;
        }
        .auth-title {
          font-size: 20px;
        }
        .otp-row {
          flex-direction: column;
        }
        .otp-row .btn {
          width: 100%;
        }
        .drawer {
          padding: 30px 20px;
        }
        .drawer-nav a {
          font-size: 16px;
          padding: 6px 0;
        }
      }
