/* ── Custom Properties ───────────────────────────────────────────────── */
:root {
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --accent: #dc2626;
  --gold: #f59e0b;
  --glass-bg: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.15);
  --shadow-lg: 0 25px 50px -12px rgba(0,0,0,0.25);
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.dark {
  --glass-bg: rgba(0,0,0,0.25);
  --glass-border: rgba(255,255,255,0.08);
}

/* ── Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Vazirmatn', 'Segoe UI', sans-serif;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}
body.en, body.en * { font-family: 'Inter', 'Segoe UI', sans-serif !important; }
body.ar, body.ar * { font-family: 'Cairo', 'Vazirmatn', sans-serif !important; }

/* ── Glassmorphism ───────────────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
}
.glass-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  transition: var(--transition);
}
.dark .glass-card {
  background: rgba(30,58,138,0.2);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* ── Navbar ──────────────────────────────────────────────────────────── */
#navbar {
  transition: var(--transition);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
}
#navbar.scrolled {
  background: rgba(255,255,255,0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}
.dark #navbar.scrolled {
  background: rgba(15,23,42,0.95) !important;
}
#navbar.scrolled .nav-link { color: #1e3a8a !important; }
.dark #navbar.scrolled .nav-link { color: #e2e8f0 !important; }

/* Scrolled state: all white text/icons inside navbar become dark in light mode */
#navbar.scrolled .navbar-control { color: #1e3a8a !important; }
#navbar.scrolled .navbar-control:hover { color: #1e40af !important; background: rgba(30,58,138,0.08) !important; }
#navbar.scrolled .navbar-logo-text { color: #1e3a8a !important; text-shadow: none !important; }
#navbar.scrolled .navbar-logo-sub { color: #d97706 !important; }
.dark #navbar.scrolled .navbar-control { color: #e2e8f0 !important; }
.dark #navbar.scrolled .navbar-control:hover { color: #fff !important; background: rgba(255,255,255,0.1) !important; }
.dark #navbar.scrolled .navbar-logo-text { color: #e2e8f0 !important; text-shadow: none !important; }
.dark #navbar.scrolled .navbar-logo-sub { color: #fbbf24 !important; }
.nav-link {
  position: relative;
  transition: var(--transition);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%; right: 50%;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-link:hover::after,
.nav-link.active::after {
  left: 0; right: 0;
}

/* ── Hero ─────────────────────────────────────────────────────────────  */
.hero-gradient {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
}
.hero-pattern {
  background-image:
    radial-gradient(circle at 20% 80%, rgba(59,130,246,0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(220,38,38,0.2) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(245,158,11,0.1) 0%, transparent 70%);
}
.floating {
  animation: floating 6s ease-in-out infinite;
}
@keyframes floating {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-15px); }
}

/* ── Counters ────────────────────────────────────────────────────────── */
.counter-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}
.counter-card:hover {
  background: rgba(255,255,255,0.18);
  transform: scale(1.04);
}

/* ── Service cards ───────────────────────────────────────────────────── */
.service-icon {
  width: 64px; height: 64px;
  border-radius: 1rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  transition: var(--transition);
}
.glass-card:hover .service-icon { transform: scale(1.12) rotate(5deg); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(59,130,246,0.35);
}
.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  font-weight: 700;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(245,158,11,0.4);
}
.btn-outline {
  border: 2px solid rgba(255,255,255,0.6);
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  cursor: pointer;
}
.btn-outline:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}
.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
}

/* ── Form inputs ─────────────────────────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: var(--transition);
  background: #fff;
  color: #1e293b;
  font-family: inherit;
}
.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
}
.dark .form-input {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
.dark .form-input:focus { border-color: #60a5fa; }
.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
  font-size: 0.9rem;
}
.dark .form-label { color: #94a3b8; }

/* ── Toast ───────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}
[dir="rtl"] #toast-container { right: 1.5rem; }
[dir="ltr"] #toast-container { left: 1.5rem; }
.toast {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  pointer-events: auto;
  animation: slideIn 0.35s ease forwards;
}
.toast.success { background: #16a34a; color: #fff; }
.toast.error   { background: #dc2626; color: #fff; }
.toast.info    { background: #1e3a8a; color: #fff; }
.toast.warning { background: #d97706; color: #fff; }
.toast.hide    { animation: slideOut 0.35s ease forwards; }
@keyframes slideIn  { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }
[dir="rtl"] @keyframes slideIn  { from { transform: translateX(-120%); } to { transform: translateX(0); } }

/* ── Loading screen ──────────────────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#loading-screen.fade-out { opacity: 0; visibility: hidden; }
.spinner {
  width: 56px; height: 56px;
  border: 4px solid rgba(255,255,255,0.15);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Skeleton ────────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}
.dark .skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Section titles ──────────────────────────────────────────────────── */
.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
}
.dark .section-title { color: #f1f5f9; }
.section-subtitle {
  font-size: 1.1rem;
  color: #64748b;
  margin-top: 0.75rem;
}
.dark .section-subtitle { color: #94a3b8; }
.title-line {
  width: 60px; height: 4px;
  background: linear-gradient(90deg, #1e3a8a, #f59e0b);
  border-radius: 2px;
  margin: 1rem auto;
}
[dir="rtl"] .title-line { margin: 1rem 0; }

/* ── Blog cards ──────────────────────────────────────────────────────── */
.blog-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 0.75rem 0.75rem 0 0;
  transition: var(--transition);
}
.glass-card:hover .blog-img { transform: scale(1.03); }
.blog-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(30,58,138,0.1);
  color: #1e3a8a;
}
.dark .blog-category { background: rgba(96,165,250,0.15); color: #60a5fa; }

/* ── FAQ accordion ───────────────────────────────────────────────────── */
.faq-item { border-bottom: 1px solid #e2e8f0; }
.dark .faq-item { border-color: #334155; }
.faq-question {
  width: 100%;
  text-align: inherit;
  padding: 1.25rem 0;
  font-weight: 700;
  font-size: 1rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  transition: color 0.2s;
}
.dark .faq-question { color: #e2e8f0; }
.faq-question:hover { color: #1e3a8a; }
.dark .faq-question:hover { color: #60a5fa; }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
  color: #64748b;
  line-height: 1.7;
  font-size: 0.95rem;
}
.dark .faq-answer { color: #94a3b8; }
.faq-item.open .faq-answer { max-height: 300px; padding-bottom: 1rem; }
.faq-chevron { transition: transform 0.3s; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }

/* ── Status badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-confirmed{ background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-expired  { background: #f1f5f9; color: #475569; }
.dark .badge-pending   { background: rgba(245,158,11,0.2); color: #fbbf24; }
.dark .badge-confirmed { background: rgba(16,185,129,0.2); color: #34d399; }
.dark .badge-rejected  { background: rgba(239,68,68,0.2);  color: #f87171; }
.dark .badge-expired   { background: rgba(148,163,184,0.2); color: #94a3b8; }

/* ── Table ───────────────────────────────────────────────────────────── */
.table-container { overflow-x: auto; border-radius: 0.75rem; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th {
  background: #f8fafc;
  font-weight: 700;
  padding: 0.875rem 1rem;
  text-align: inherit;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.dark .data-table th { background: #1e293b; color: #94a3b8; border-color: #334155; }
.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  vertical-align: middle;
}
.dark .data-table td { border-color: #1e293b; color: #cbd5e1; }
.data-table tbody tr:hover { background: #f8fafc; }
.dark .data-table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ── Admin sidebar ───────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0f172a 0%, #1e3a8a 100%);
  position: fixed;
  top: 0;
  transition: var(--transition);
  z-index: 100;
  overflow-y: auto;
}
[dir="rtl"] .sidebar { right: 0; }
[dir="ltr"] .sidebar { left: 0; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: rgba(255,255,255,0.7);
  border-radius: 0.5rem;
  margin: 0.125rem 0.75rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
  font-size: 0.9rem;
}
.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.sidebar-link.active { box-shadow: 0 0 0 1px rgba(255,255,255,0.2) inset; }
.admin-content {
  transition: var(--transition);
  min-height: 100vh;
  background: #f8fafc;
}
.dark .admin-content { background: #0f172a; }
[dir="rtl"] .admin-content { margin-right: 260px; }
[dir="ltr"] .admin-content { margin-left: 260px; }

/* ── Pagination ──────────────────────────────────────────────────────── */
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
  text-decoration: none;
}
.page-link:hover, .page-link.active {
  background: #1e3a8a;
  color: #fff;
  border-color: #1e3a8a;
}
.dark .page-link { border-color: #334155; color: #94a3b8; }
.dark .page-link:hover, .dark .page-link.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.dark .modal-box { background: #1e293b; }
@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Scrollbar ───────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.dark ::-webkit-scrollbar-thumb { background: #334155; }

/* ── Utility ─────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-gradient {
  background: linear-gradient(135deg, #1e3a8a, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-pad { padding: 5rem 0; }
@media (max-width: 768px) {
  .section-pad { padding: 3rem 0; }
  .sidebar { transform: translateX(100%); }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  [dir="rtl"] .admin-content { margin-right: 0; }
  [dir="ltr"] .admin-content { margin-left: 0; }
  .section-title { font-size: 1.65rem; }
}


/* ==========================================================================
   ULTRA-RESPONSIVE LAYER
   Responsive-only overrides. Existing colors, typography, content,
   components and visual identity are intentionally preserved.
   ========================================================================== */

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

/* Never allow media to create horizontal scrolling */
img, video, canvas, svg, iframe, embed, object {
  max-width: 100%;
}

img, video {
  height: auto;
}

iframe {
  border: 0;
}

/* Long URLs / codes / generated values must remain inside their boxes */
a, button, input, textarea, select, option, td, th, p, span, div {
  min-width: 0;
}

a, p, td, th, code, pre {
  overflow-wrap: anywhere;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

input, textarea, select, button {
  max-width: 100%;
  font: inherit;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="url"],
input[type="search"],
textarea,
select {
  min-width: 0;
}

/* Tables stay usable instead of breaking the viewport */
table {
  max-width: 100%;
}

.table-responsive,
.overflow-x-auto {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

/* Prevent fixed/floating UI from becoming wider than small screens */
#toast-container {
  max-width: calc(100vw - 2rem);
}

.toast {
  max-width: min(420px, calc(100vw - 2rem));
  min-width: 0;
}

/* Mobile navigation */
@media (max-width: 1023px) {
  #navbar {
    width: 100%;
  }

  #navbar > .container,
  #navbar .nav-container {
    width: 100%;
    max-width: 100%;
  }

  .nav-container {
    gap: 8px;
  }

  .nav-brand {
    max-width: calc(100% - 70px);
    min-width: 0;
  }

  .nav-brand > div {
    min-width: 0;
    max-width: 100%;
  }

  .brand-title,
  .nav-brand-title {
    max-width: 100%;
    overflow-wrap: normal;
  }

  .nav-brand img {
    flex: 0 0 auto;
  }

  .nav-actions {
    flex: 0 0 auto;
  }

  .theme-btn {
    flex: 0 0 42px;
  }

  .floating-menu-btn {
    width: 48px;
    height: 48px;
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
  }

  #mobileMenu {
    width: min(300px, 86vw);
    max-width: calc(100vw - 20px);
    padding-top: max(1.5rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  #mobileOverlay {
    min-height: 100dvh;
  }
}

/* Tablets / small laptops */
@media (max-width: 900px) {
  .container {
    width: 100%;
    max-width: 100%;
  }

  .section-title {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
  }

  .section-subtitle {
    font-size: clamp(.95rem, 2.2vw, 1.1rem);
  }

  .btn-primary,
  .btn-gold,
  .btn-outline {
    max-width: 100%;
  }

  .glass-card:hover {
    transform: none;
  }
}

/* Phones */
@media (max-width: 640px) {
  html {
    scroll-padding-top: 76px;
  }

  body {
    overflow-x: hidden;
  }

  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .section-title {
    font-size: clamp(1.5rem, 7vw, 2rem);
    line-height: 1.35;
  }

  .section-subtitle {
    font-size: .95rem;
    line-height: 1.8;
  }

  .title-line {
    max-width: 60px;
  }

  /* Buttons wrap safely while preserving their original appearance */
  .btn-primary,
  .btn-gold,
  .btn-outline {
    width: auto;
    min-height: 44px;
    max-width: 100%;
    padding-left: 1.15rem;
    padding-right: 1.15rem;
    white-space: normal;
    text-align: center;
    justify-content: center;
  }

  /* Forms */
  .form-input {
    min-height: 46px;
    font-size: 16px; /* prevents iOS Safari zoom */
  }

  textarea.form-input {
    min-height: 110px;
  }

  /* Hero elements must never force a horizontal scroll */
  .hero-gradient,
  .hero-pattern {
    max-width: 100%;
    overflow: hidden;
  }

  .hero-gradient [class*="w-"],
  .hero-pattern [class*="w-"] {
    max-width: 100%;
  }

  /* Keep very long hero headings inside narrow screens */
  h1, h2, h3, h4, h5, h6 {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  /* Existing nowrap text can otherwise overflow tiny phones */
  .whitespace-nowrap {
    white-space: normal !important;
  }

  /* Cards and grids */
  .glass-card,
  .counter-card {
    max-width: 100%;
  }

  /* Safe full-width media */
  .blog-img {
    width: 100%;
    max-width: 100%;
  }

  /* Fixed toast respects notches and small screens */
  #toast-container {
    left: max(1rem, env(safe-area-inset-left));
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: auto;
  }

  [dir="rtl"] #toast-container,
  [dir="ltr"] #toast-container {
    left: max(1rem, env(safe-area-inset-left));
    right: max(1rem, env(safe-area-inset-right));
  }

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

  /* Avoid hover-only movement on touch devices */
  .btn-primary:hover,
  .btn-gold:hover,
  .btn-outline:hover,
  .payment-btn:hover,
  .glass-card:hover {
    transform: none;
  }
}

/* Very small phones: 320px–375px */
@media (max-width: 375px) {
  .container {
    padding-left: max(.75rem, env(safe-area-inset-left));
    padding-right: max(.75rem, env(safe-area-inset-right));
  }

  .nav-container {
    padding-top: .75rem !important;
    padding-bottom: .75rem !important;
  }

  .nav-brand {
    gap: 7px;
  }

  .nav-brand img {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  .brand-title {
    font-size: 12px;
    line-height: 1.35;
  }

  .theme-btn {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .floating-menu-btn {
    width: 44px;
    height: 44px;
  }

  .section-title {
    font-size: 1.45rem;
  }

  .btn-primary,
  .btn-gold,
  .btn-outline {
    padding-left: .9rem;
    padding-right: .9rem;
    font-size: .9rem;
  }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  #mobileMenu {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .hero-gradient {
    min-height: auto;
  }
}

/* Foldables / unusual viewport sizes */
@media (max-width: 280px) {
  .nav-brand-title,
  .brand-title {
    font-size: 10px;
  }

  .nav-brand img {
    width: 36px;
    height: 36px;
  }

  .theme-btn {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .floating-menu-btn {
    width: 40px;
    height: 40px;
  }
}

/* Touchscreen devices: make controls comfortable without restyling them */
@media (hover: none) and (pointer: coarse) {
  a,
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  select {
    touch-action: manipulation;
  }
}

/* Reduced motion: accessibility + low-power devices */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast / forced colors support */
@media (forced-colors: active) {
  button,
  a {
    forced-color-adjust: auto;
  }
}
