/* ============================================================
   Arakta Digital Menu — Standalone Styles
   Dark luxury + glassmorphism, mobile-first, RTL
   ============================================================ */

:root {
  --gold: #C9A84C;
  --gold-light: #e8c96e;
  --gold-dim: rgba(201, 168, 76, 0.15);
  --navy: #0A1628;
  --navy-mid: #0f1f3d;
  --navy-card: rgba(15, 25, 55, 0.75);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f0ede6;
  --text-secondary: #a89f8e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-gold: 0 0 30px rgba(201, 168, 76, 0.25);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Vazirmatn', 'Tahoma', sans-serif;
  direction: rtl;
  background: var(--navy);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--navy-mid); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 4px; }

/* ============================================================
   LOGO — CSS filter masks for black PNG on white background
   ============================================================

   The source PNG is a full-black mark on a white background.
   We use filter chains to recolor it:

   .logo-gold   — invert white→transparent-dark, black→white,
                  then sepia+saturate shift white to warm gold (#C9A84C)
   .logo-white  — invert only: makes black→white so it reads on dark bg
   ============================================================ */

.logo-gold {
  /* Step 1: invert  → black logo becomes white, white bg becomes black   */
  /* Step 2: sepia   → push toward warm brownish-gold spectrum             */
  /* Step 3: saturate→ deepen the gold saturation                          */
  /* Step 4: hue-rotate → nudge toward #C9A84C yellow-gold (~10deg)       */
  /* Step 5: brightness → final brightness trim to match brand gold        */
  filter: invert(1) sepia(1) saturate(3) hue-rotate(8deg) brightness(0.88);
}

.logo-white {
  filter: invert(1);
}

/* ============================================================
   SECTION SELECT PAGE
   ============================================================ */

.menu-hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}

.menu-hero::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(201, 168, 76, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 90%, rgba(10, 22, 40, 0.9) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.menu-logo {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

.menu-logo__img {
  width: clamp(120px, 28vw, 180px);
  height: auto;
  display: block;
  margin: 0 auto 0.75rem;
  /* Gold recolor applied via .logo-gold class */
  /* drop-shadow adds a soft gold glow around the mark */
  filter: invert(1) sepia(1) saturate(3) hue-rotate(8deg) brightness(0.88)
          drop-shadow(0 0 12px rgba(201, 168, 76, 0.4));
}

.menu-logo p {
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-size: 1rem;
}

.sections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 680px;
  width: 100%;
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  .sections-grid { grid-template-columns: 1fr; gap: 1rem; }
}

.section-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  display: block;
  aspect-ratio: 4/3;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--glass-border);
}

.section-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-gold), 0 20px 40px rgba(0,0,0,0.4);
}

.section-card:active { transform: scale(0.97); }

.section-card__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}

.section-card:hover .section-card__bg {
  transform: scale(1.08);
}

.section-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(5, 10, 25, 0.92) 0%,
    rgba(5, 10, 25, 0.4) 50%,
    rgba(5, 10, 25, 0.1) 100%
  );
}

.section-card__content {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  padding: 1.25rem;
}

.section-card__icon {
  font-size: 2rem;
  margin-bottom: 0.4rem;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.section-card__name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  display: block;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.section-card__desc {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
  margin-top: 0.25rem;
  display: block;
}

.section-card__arrow {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity var(--transition);
}

.section-card:hover .section-card__arrow { opacity: 1; }

/* Animate in on load */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-card { animation: fadeUp 0.6s ease both; }
.section-card:nth-child(1) { animation-delay: 0.1s; }
.section-card:nth-child(2) { animation-delay: 0.2s; }
.section-card:nth-child(3) { animation-delay: 0.3s; }
.section-card:nth-child(4) { animation-delay: 0.4s; }

/* ============================================================
   MENU PAGE TOP BAR
   ============================================================ */

.menu-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.menu-topbar__back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
}
.menu-topbar__back:hover { color: var(--gold); }

.menu-topbar__logo {
  height: 32px;
  width: auto;
  display: block;
  /* White version so it reads cleanly on the dark semi-transparent topbar */
  filter: invert(1) drop-shadow(0 0 6px rgba(201, 168, 76, 0.3));
}

.menu-topbar__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.menu-topbar__cart {
  position: relative;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 12px;
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.menu-topbar__cart:hover {
  background: rgba(201, 168, 76, 0.25);
  box-shadow: var(--shadow-gold);
}

.cart-badge {
  background: var(--gold);
  color: var(--navy);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   CATEGORY TABS
   ============================================================ */

.category-tabs {
  display: flex;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: sticky;
  top: 58px;
  z-index: 99;
  background: var(--navy);
}
.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  padding: 0.5rem 1.1rem;
  border-radius: 40px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.cat-tab:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.cat-tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.4);
}

/* ============================================================
   MENU ITEMS GRID
   ============================================================ */

.menu-section-block {
  padding: 0 1rem 2rem;
  scroll-margin-top: 120px;
}

.menu-section-block h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  padding: 1.5rem 0.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 1rem;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

@media (max-width: 600px) {
  .items-grid { grid-template-columns: 1fr; }
}

/* ---- Item Card ---- */
.item-card {
  background: var(--navy-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
}

.item-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
  border-color: rgba(201, 168, 76, 0.3);
}

.item-card__badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--gold);
  color: var(--navy);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  z-index: 2;
}

.item-card__img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
  background: #0f1f3d;
}

.item-card__body {
  padding: 0.9rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-card__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.item-card__desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

.item-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.6rem;
}

.item-tag {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.item-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.15);
}

.item-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-light);
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}
.item-price small {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.btn-add {
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 10px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: background var(--transition), box-shadow var(--transition), transform 0.15s;
}
.btn-add:hover {
  background: var(--gold-light);
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.5);
}
.btn-add:active { transform: scale(0.93); }
.btn-add.added {
  background: #2d9e5f;
  color: #fff;
}

/* ============================================================
   CART DRAWER
   ============================================================ */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,10,25,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cart-overlay.open { opacity: 1; }

.cart-drawer {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 201;
  background: var(--navy-mid);
  border-top: 1px solid var(--glass-border);
  border-radius: 24px 24px 0 0;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.cart-drawer.open { transform: translateY(0); }

.cart-drawer__handle {
  width: 40px;
  height: 4px;
  background: var(--glass-border);
  border-radius: 4px;
  margin: 0.85rem auto 0;
  flex-shrink: 0;
}

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.5rem;
  flex-shrink: 0;
}

.cart-drawer__header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cart-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.cart-close:hover { border-color: var(--gold); color: var(--gold); }

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1.25rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--glass-border);
}

.cart-item__img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item__price {
  font-size: 0.8rem;
  color: var(--gold);
  margin-top: 0.15rem;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.qty-btn:hover { border-color: var(--gold); color: var(--gold); }

.qty-num {
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.cart-drawer__footer {
  padding: 1rem 1.25rem 1.5rem;
  flex-shrink: 0;
  border-top: 1px solid var(--glass-border);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.cart-total-row span { color: var(--text-secondary); font-size: 0.9rem; }
.cart-total-row strong {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-light);
}

.cart-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
}
.cart-empty span { font-size: 3rem; display: block; margin-bottom: 0.75rem; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-primary {
  display: block;
  width: 100%;
  padding: 0.9rem;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  text-align: center;
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--gold-light);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.5);
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: var(--glass);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }

/* ============================================================
   CART PAGE & ORDER CONFIRM
   ============================================================ */

.page-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.page-header a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.25rem;
  transition: color var(--transition);
}
.page-header a:hover { color: var(--gold); }

.page-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
}

.glass-card {
  background: var(--navy-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(10px);
  margin-bottom: 1rem;
}

.glass-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group {
  margin-bottom: 0.85rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  direction: rtl;
  outline: none;
  transition: border-color var(--transition);
}
.form-control:focus { border-color: var(--gold); }

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.9rem;
}
.summary-row:last-child { border-bottom: none; }
.summary-row .label { color: var(--text-secondary); }
.summary-row .val { font-weight: 600; }
.summary-row.total .val { font-size: 1.1rem; color: var(--gold-light); }

/* ---- Order Confirm ---- */

.confirm-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  text-align: center;
}

.confirm-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(45, 158, 95, 0.15);
  border: 2px solid #2d9e5f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin: 0 auto 1.5rem;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes scaleIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.confirm-wrap h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.confirm-wrap p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.confirm-order-id {
  display: inline-block;
  margin: 1rem 0 2rem;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 0.4rem 1.2rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
}

/* ============================================================
   FLOATING CART BUTTON (mobile)
   Dock wrapper avoids transform+fixed conflicts during scroll.
   ============================================================ */

.floating-cart-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0 1rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  /* Keep compositing layer stable while mobile chrome resizes on scroll */
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.floating-cart {
  pointer-events: auto;
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  max-width: min(92vw, 22rem);
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  color: var(--navy);
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  box-shadow:
    0 10px 28px rgba(201, 168, 76, 0.45),
    0 2px 0 rgba(255, 255, 255, 0.25) inset;
  transition: background var(--transition), box-shadow var(--transition), filter var(--transition);
}

.floating-cart:hover,
.floating-cart:active {
  background: linear-gradient(135deg, #f0d78a 0%, var(--gold-light) 100%);
  box-shadow:
    0 14px 34px rgba(201, 168, 76, 0.55),
    0 2px 0 rgba(255, 255, 255, 0.3) inset;
  filter: brightness(1.03);
}

.floating-cart__icon { font-size: 1.05rem; line-height: 1; }
.floating-cart__label { white-space: nowrap; }
.floating-cart__total {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.85;
  white-space: nowrap;
  padding-inline-start: 0.35rem;
  border-inline-start: 1px solid rgba(10, 22, 40, 0.2);
}

.floating-cart-dock[style*="display: none"] { display: none !important; }

[x-cloak] { display: none !important; }

/* ============================================================
   PULSE ANIMATION for add-to-cart feedback
   ============================================================ */

@keyframes pulse-gold {
  0%   { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.7); }
  70%  { box-shadow: 0 0 0 12px rgba(201, 168, 76, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0); }
}

.pulse { animation: pulse-gold 0.6s ease; }

/* ============================================================
   UTILITIES
   ============================================================ */

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }

/* ============================================================
   LANGUAGE GATE — first screen: pick language, then continue
   ============================================================ */

.lang-gate-page {
  min-height: 100dvh;
  background: var(--navy);
  color: var(--text-primary);
}

.lang-gate {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  padding-top: max(2rem, env(safe-area-inset-top, 0px));
  padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
  position: relative;
  overflow: hidden;
}

.lang-gate__glow {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(201, 168, 76, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 100%, rgba(201, 168, 76, 0.06) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.lang-gate__logo,
.lang-gate__welcome,
.lang-gate__options {
  position: relative;
  z-index: 1;
}

.lang-gate__logo {
  margin-bottom: 1.75rem;
}

.lang-gate__welcome {
  text-align: center;
  margin-bottom: 2.25rem;
}

.lang-gate__title {
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.lang-gate__subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.lang-gate__hint {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 22rem;
  margin: 0 auto;
}

.lang-gate__options {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lang-gate__card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--navy-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.lang-gate__card:hover,
.lang-gate__card:focus-visible {
  border-color: rgba(201, 168, 76, 0.55);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

.lang-gate__card-code {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid rgba(201, 168, 76, 0.35);
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.lang-gate__card-name {
  flex: 1;
  font-size: 1.15rem;
  font-weight: 700;
}

.lang-gate__card-arrow {
  color: var(--gold);
  font-size: 1.1rem;
  opacity: 0.7;
  transition: opacity var(--transition), transform var(--transition);
}

.lang-gate__card:hover .lang-gate__card-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* ============================================================
   LANGUAGE SWITCHER — compact pill on inner pages only
   ============================================================ */

.lang-switch-dock--inner {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top, 0px));
  inset-inline-end: max(0.75rem, env(safe-area-inset-right, 0px));
  z-index: 150;
  pointer-events: none;
}

.lang-switch-dock--inner .lang-switch {
  pointer-events: auto;
}

body:has(.menu-topbar) .lang-switch-dock--inner {
  top: calc(3.75rem + env(safe-area-inset-top, 0px));
}

.lang-switch-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1rem;
  padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

.lang-switch {
  --lang-pad: 0.22rem;
  --lang-btn-w: 2.65rem;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, var(--lang-btn-w));
  gap: 0;
  padding: var(--lang-pad);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 40%, transparent 70%),
    rgba(8, 16, 32, 0.72);
  border: 1px solid rgba(201, 168, 76, 0.28);
  border-radius: 999px;
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
  isolation: isolate;
  overflow: hidden;
  flex-shrink: 0;
}

.lang-switch__glow {
  position: absolute;
  inset: -40% -20%;
  background: radial-gradient(circle at 30% 20%, rgba(201, 168, 76, 0.22), transparent 55%);
  pointer-events: none;
  z-index: 0;
  animation: langGlow 6s ease-in-out infinite alternate;
}

@keyframes langGlow {
  from { opacity: 0.55; transform: translateX(-6%); }
  to   { opacity: 1; transform: translateX(8%); }
}

.lang-switch__pill {
  position: absolute;
  top: var(--lang-pad);
  bottom: var(--lang-pad);
  left: var(--lang-pad); /* physical anchor — never jumps when dir changes */
  width: var(--lang-btn-w);
  border-radius: 999px;
  background: linear-gradient(145deg, var(--gold-light), var(--gold) 55%, #b8923a);
  box-shadow:
    0 4px 14px rgba(201, 168, 76, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.35) inset;
  z-index: 1;
  transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
  will-change: transform;
}

/*
  Grid column order is DOM order in both directions, but the visual layout flips:
    LTR: [فا=col0] [EN=col1] [ع=col2]   (left → right)
    RTL: [ع=col0]  [EN=col1] [فا=col2]  (right → left, so physically: col2=left…col0=right)
  Pill anchor is physical left, so we translate by the physical column index × btn-width.
*/

/* LTR: فا is leftmost (col0), EN is middle (col1), ع is rightmost (col2) */
html[dir="ltr"] .lang-switch[data-active="fa"] .lang-switch__pill { transform: translateX(0); }
html[dir="ltr"] .lang-switch[data-active="en"] .lang-switch__pill { transform: translateX(var(--lang-btn-w)); }
html[dir="ltr"] .lang-switch[data-active="ar"] .lang-switch__pill { transform: translateX(calc(2 * var(--lang-btn-w))); }

/* RTL: ع is leftmost physically (col0), EN is middle (col1), فا is rightmost (col2) */
html[dir="rtl"] .lang-switch[data-active="ar"] .lang-switch__pill { transform: translateX(0); }
html[dir="rtl"] .lang-switch[data-active="en"] .lang-switch__pill { transform: translateX(var(--lang-btn-w)); }
html[dir="rtl"] .lang-switch[data-active="fa"] .lang-switch__pill { transform: translateX(calc(2 * var(--lang-btn-w))); }

.lang-switch__btn {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.28rem 0.15rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: color 0.25s ease;
}

.lang-switch__code {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.lang-switch__name {
  display: none;
  font-size: 0.55rem;
  font-weight: 600;
  opacity: 0.85;
  line-height: 1;
  margin-top: 0.12rem;
}

.lang-switch__btn.is-active {
  color: var(--navy);
}

.lang-switch__btn:not(.is-active):hover {
  color: var(--gold-light);
}

.lang-switch__btn:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.menu-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

@media (min-width: 640px) {
  .lang-switch {
    --lang-btn-w: 4.35rem;
  }
  .lang-switch__name { display: block; }
  .lang-switch__btn { min-height: 2.55rem; }
}

@media (max-width: 420px) {
  .menu-topbar__title span:last-child {
    max-width: 28vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.menu-lang-ar,
body.menu-lang-ar {
  font-family: 'Noto Sans Arabic', 'Vazirmatn', sans-serif;
}

body.menu-lang-en {
  font-family: 'Vazirmatn', system-ui, sans-serif;
}

.divider {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 1rem 0;
}
