/* ===================================================================
   STYLE.CSS — کافه دارک | منوی دیجیتال لوکس
   طراحی: Glassmorphism گرم، بر پایه پالت قهوه‌ای، موبایل‌فرست
   =================================================================== */

/* -------------------- توکن‌های طراحی (Design Tokens) -------------------- */
:root{
  /* پالت اصلی داده‌شده در بریف */
  --espresso-900:#2C1810;
  --espresso-700:#4E342E;
  --mocha-500:#6D4C41;
  --latte-300:#A1887F;
  --cream-100:#EFEBE9;
  --ivory-50:#FFF8F0;

  /* لهجه طلایی — امضای بصری صفحه (مهر مومی قیمت + جزئیات لوکس) */
  --gold:#C9A227;
  --gold-soft:rgba(201,162,39,.35);
  --gold-glow:rgba(201,162,39,.55);

  /* تایپوگرافی */
  --font-fa:'Vazirmatn', sans-serif;
  --font-accent:'Cormorant Garamond', serif;

  /* هندسه */
  --radius-lg:28px;
  --radius-md:18px;
  --radius-sm:12px;
  --radius-pill:999px;

  /* زمان‌بندی انیمیشن */
  --ease:cubic-bezier(.22,1,.36,1);
  --speed-fast:.2s;
  --speed-med:.45s;
  --speed-slow:.9s;

  --header-h:72px;
}

/* -------------------- تم تیره (پیش‌فرض) -------------------- */
[data-theme="dark"]{
  --bg:#1E120C;
  --bg-elevated:#2C1810;
  --surface-rgb:78,52,46;      /* espresso-700 برای شیشه‌ای‌سازی */
  --text-strong:var(--ivory-50);
  --text:#EFEBE9;
  --text-muted:#C9BDB8;
  --border-soft:rgba(161,136,127,.28);
  --card-shadow:0 20px 45px -20px rgba(0,0,0,.65);
  --glass-blur:18px;
}

/* -------------------- تم روشن -------------------- */
[data-theme="light"]{
  --bg:var(--ivory-50);
  --bg-elevated:#FFFFFF;
  --surface-rgb:255,255,255;
  --text-strong:var(--espresso-900);
  --text:#3B2620;
  --text-muted:#7A5F55;
  --border-soft:rgba(109,76,65,.18);
  --card-shadow:0 20px 40px -22px rgba(78,52,46,.35);
  --glass-blur:14px;
}

/* -------------------- ریست پایه -------------------- */
*,*::before,*::after{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }
body{
  font-family:var(--font-fa);
  background:var(--bg);
  color:var(--text);
  line-height:1.7;
  overflow-x:hidden;
  transition:background var(--speed-med) var(--ease), color var(--speed-med) var(--ease);
}
img{ display:block; max-width:100%; }
button{ font-family:inherit; cursor:pointer; border:none; background:none; color:inherit; }
input{ font-family:inherit; }
a{ color:inherit; text-decoration:none; }
::selection{ background:var(--gold-soft); color:var(--espresso-900); }

/* اسکرول‌بار ظریف */
::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-thumb{ background:var(--latte-300); border-radius:99px; }
::-webkit-scrollbar-track{ background:transparent; }

/* کلاس کمکی جهت غیرفعال کردن اسکرول پشت مودال */
body.modal-open{ overflow:hidden; }

/* =====================================================================
   لودر اولیه صفحه
   ===================================================================== */
#page-loader{
  position:fixed; inset:0; z-index:9999;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:18px;
  background:radial-gradient(120% 120% at 50% 20%, var(--espresso-700) 0%, var(--espresso-900) 70%);
  transition:opacity .6s var(--ease), visibility .6s var(--ease);
}
#page-loader.loader-hide{ opacity:0; visibility:hidden; pointer-events:none; }
.loader-cup{ position:relative; font-size:3rem; color:var(--gold); }
.loader-cup i{ animation:cup-tilt 1.6s ease-in-out infinite; display:inline-block; }
@keyframes cup-tilt{ 0%,100%{ transform:rotate(0deg);} 50%{ transform:rotate(-8deg);} }
.loader-steam{
  position:absolute; top:-18px; width:3px; height:16px; border-radius:99px;
  background:rgba(239,235,233,.7); filter:blur(1px);
  animation:steam-rise 1.8s ease-in-out infinite;
}
.loader-steam.s1{ left:6px; animation-delay:0s; }
.loader-steam.s2{ left:16px; animation-delay:.3s; }
.loader-steam.s3{ left:26px; animation-delay:.6s; }
@keyframes steam-rise{
  0%{ transform:translateY(0) scaleY(1); opacity:0; }
  30%{ opacity:.8; }
  100%{ transform:translateY(-22px) scaleY(1.4); opacity:0; }
}
.loader-text{ font-size:.9rem; color:var(--ivory-50); letter-spacing:.3px; opacity:.85; }

/* =====================================================================
   هدر
   ===================================================================== */
.site-header{
  position:fixed; inset-inline:0; top:0; z-index:500;
  height:var(--header-h);
  background:rgba(var(--surface-rgb),.55);
  backdrop-filter:blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter:blur(var(--glass-blur)) saturate(160%);
  border-bottom:1px solid var(--border-soft);
  transition:background var(--speed-med) var(--ease), border-color var(--speed-med) var(--ease);
}
.header-inner{
  height:100%; max-width:1200px; margin:0 auto; padding:0 18px;
  display:flex; align-items:center; justify-content:space-between;
}
.brand{ display:flex; align-items:center; gap:10px; }
.brand-icon{
  width:42px; height:42px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(145deg, var(--mocha-500), var(--espresso-900));
  color:var(--gold); font-size:1.1rem;
  box-shadow:0 6px 16px -6px rgba(0,0,0,.5), inset 0 0 0 1px var(--gold-soft);
}
.brand-text{ display:flex; flex-direction:column; line-height:1.25; }
.brand-text strong{ font-size:1.05rem; color:var(--text-strong); font-weight:800; }
.brand-text small{
  font-family:var(--font-accent); font-style:italic; letter-spacing:1.5px;
  font-size:.65rem; color:var(--gold); text-transform:uppercase;
}
.icon-btn{
  width:42px; height:42px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:rgba(var(--surface-rgb),.5);
  border:1px solid var(--border-soft);
  color:var(--text-strong); font-size:1rem;
  transition:transform var(--speed-fast) var(--ease), background var(--speed-fast) var(--ease);
}
.icon-btn:hover{ transform:translateY(-2px) scale(1.05); background:rgba(var(--surface-rgb),.8); }
.icon-btn:active{ transform:scale(.94); }

#theme-toggle{ position:relative; overflow:hidden; }
#theme-toggle .sun-icon,#theme-toggle .moon-icon{
  position:absolute; transition:transform var(--speed-med) var(--ease), opacity var(--speed-med) var(--ease);
}
[data-theme="dark"] #theme-toggle .sun-icon{ transform:translateY(-140%); opacity:0; }
[data-theme="dark"] #theme-toggle .moon-icon{ transform:translateY(0); opacity:1; color:var(--gold); }
[data-theme="light"] #theme-toggle .sun-icon{ transform:translateY(0); opacity:1; color:#E3A61A; }
[data-theme="light"] #theme-toggle .moon-icon{ transform:translateY(140%); opacity:0; }

/* =====================================================================
   هیرو
   ===================================================================== */
.hero{
  position:relative;
  min-height:92vh;
  display:flex; align-items:center; justify-content:center;
  text-align:center;
  padding:calc(var(--header-h) + 40px) 20px 80px;
  overflow:hidden;
  isolation:isolate;
}
.hero-media{
  position:absolute; inset:0; z-index:-2;
  background-image:url('https://images.unsplash.com/photo-1495474472287-4d71bcdd2085?q=80&w=1600&auto=format&fit=crop');
  background-size:cover; background-position:center 65%;
  animation:hero-zoom 18s ease-in-out infinite alternate;
}
@keyframes hero-zoom{ from{ transform:scale(1); } to{ transform:scale(1.12); } }
.hero-overlay{
  position:absolute; inset:0; z-index:-1;
  background:
    linear-gradient(180deg, rgba(20,12,8,.55) 0%, rgba(20,12,8,.75) 55%, var(--bg) 100%),
    linear-gradient(90deg, rgba(20,12,8,.5), rgba(20,12,8,.2));
}
.hero-steam{ position:absolute; bottom:38%; right:50%; z-index:0; pointer-events:none; }
.hero-steam span{
  position:absolute; width:6px; height:60px; border-radius:99px;
  background:rgba(255,255,255,.35); filter:blur(3px);
  animation:hero-steam-rise 6s ease-in-out infinite;
}
.hero-steam span:nth-child(1){ left:-30px; animation-delay:0s; }
.hero-steam span:nth-child(2){ left:0px; animation-delay:1.4s; }
.hero-steam span:nth-child(3){ left:30px; animation-delay:2.8s; }
@keyframes hero-steam-rise{
  0%{ transform:translateY(0) scaleY(1) rotate(0deg); opacity:0; }
  20%{ opacity:.5; }
  100%{ transform:translateY(-160px) scaleY(1.8) rotate(6deg); opacity:0; }
}

.hero-eyebrow{
  display:inline-block; margin-bottom:18px;
  font-family:var(--font-accent); font-style:italic; font-size:.95rem;
  letter-spacing:2px; color:var(--gold);
  padding:6px 20px; border:1px solid var(--gold-soft); border-radius:var(--radius-pill);
  background:rgba(20,12,8,.35); backdrop-filter:blur(6px);
  animation:fade-up .9s var(--ease) both;
}
.hero-title{
  color:var(--ivory-50);
  font-weight:800;
  font-size:clamp(2.3rem, 8vw, 4.2rem);
  line-height:1.25;
  text-shadow:0 12px 40px rgba(0,0,0,.45);
}
.hero-title .line{ display:block; overflow:hidden; }
.hero-title .line span, .hero-title .line{ }
.hero-title .line-1{ animation:fade-up .9s var(--ease) .1s both; }
.hero-title .line-2{
  color:var(--gold);
  animation:fade-up .9s var(--ease) .28s both;
}
@keyframes fade-up{
  from{ opacity:0; transform:translateY(28px); }
  to{ opacity:1; transform:translateY(0); }
}
.hero-sub{
  max-width:520px; margin:22px auto 0;
  color:rgba(239,235,233,.85); font-size:1.02rem;
  animation:fade-up .9s var(--ease) .42s both;
}
.hero-cta{
  display:inline-flex; align-items:center; gap:10px;
  margin-top:34px; padding:14px 30px;
  border-radius:var(--radius-pill);
  background:linear-gradient(135deg, var(--gold), #a9821f);
  color:#241505; font-weight:700; font-size:.95rem;
  box-shadow:0 14px 30px -10px var(--gold-glow);
  animation:fade-up .9s var(--ease) .56s both;
  transition:transform var(--speed-fast) var(--ease), box-shadow var(--speed-fast) var(--ease);
}
.hero-cta i{ transition:transform var(--speed-fast) var(--ease); }
.hero-cta:hover{ transform:translateY(-3px); box-shadow:0 18px 36px -8px var(--gold-glow); }
.hero-cta:hover i{ transform:translateY(3px); }

.scroll-cue{
  position:absolute; bottom:26px; left:50%; transform:translateX(-50%);
  width:26px; height:42px; border:2px solid rgba(239,235,233,.5); border-radius:20px;
}
.scroll-cue span{
  position:absolute; top:6px; left:50%; transform:translateX(-50%);
  width:4px; height:8px; border-radius:99px; background:var(--gold);
  animation:cue-scroll 1.6s ease-in-out infinite;
}
@keyframes cue-scroll{
  0%{ opacity:1; top:6px; } 70%{ opacity:0; top:22px; } 100%{ opacity:0; top:6px; }
}

/* =====================================================================
   نوار جستجو + دسته‌بندی چسبان
   ===================================================================== */
.sticky-nav{
  position:sticky; top:var(--header-h); z-index:400;
  padding:14px 16px 12px;
  background:rgba(var(--surface-rgb),.6);
  backdrop-filter:blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter:blur(var(--glass-blur)) saturate(160%);
  border-bottom:1px solid var(--border-soft);
  transition:background var(--speed-med) var(--ease);
}
.search-bar{
  display:flex; align-items:center; gap:10px;
  max-width:640px; margin:0 auto 12px;
  padding:12px 18px;
  border-radius:var(--radius-pill);
  background:rgba(var(--surface-rgb),.55);
  border:1px solid var(--border-soft);
  transition:border-color var(--speed-fast) var(--ease), box-shadow var(--speed-fast) var(--ease);
}
.search-bar:focus-within{ border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-soft); }
.search-bar i{ color:var(--text-muted); }
.search-bar input{
  flex:1; background:transparent; border:none; outline:none;
  color:var(--text-strong); font-size:.95rem;
}
.search-bar input::placeholder{ color:var(--text-muted); }
.search-clear{ opacity:0; pointer-events:none; transition:opacity var(--speed-fast) var(--ease); color:var(--text-muted); }
.search-bar.has-value .search-clear{ opacity:1; pointer-events:auto; }

.category-nav{
  display:flex; gap:10px; overflow-x:auto; scrollbar-width:none;
  max-width:1100px; margin:0 auto; padding:2px;
}
.category-nav::-webkit-scrollbar{ display:none; }
.cat-chip{
  flex:0 0 auto; display:flex; align-items:center; gap:8px;
  padding:10px 18px; border-radius:var(--radius-pill);
  background:rgba(var(--surface-rgb),.45);
  border:1px solid var(--border-soft);
  color:var(--text); font-size:.85rem; font-weight:500; white-space:nowrap;
  transition:all var(--speed-fast) var(--ease);
}
.cat-chip i{ color:var(--gold); }
.cat-chip:hover{ transform:translateY(-2px); border-color:var(--gold-soft); }
.cat-chip.active{
  background:linear-gradient(135deg, var(--mocha-500), var(--espresso-900));
  color:var(--ivory-50);
  border-color:var(--gold);
  box-shadow:0 8px 20px -8px rgba(0,0,0,.5);
}
.cat-chip.active i{ color:var(--gold); }

/* =====================================================================
   بدنه منو
   ===================================================================== */
main{ max-width:1200px; margin:0 auto; padding:30px 18px 60px; }
.menu-wrapper{ display:flex; flex-direction:column; gap:52px; }

.menu-section{ scroll-margin-top:calc(var(--header-h) + 148px); }
.section-heading{
  display:flex; align-items:center; gap:14px; margin-bottom:22px;
  animation:fade-up .7s var(--ease) both;
}
.section-heading .sec-icon{
  width:48px; height:48px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(145deg, var(--mocha-500), var(--espresso-900));
  color:var(--gold); font-size:1.15rem; flex:0 0 auto;
  box-shadow:0 8px 20px -10px rgba(0,0,0,.5);
}
.section-heading h2{
  font-size:1.35rem; color:var(--text-strong); font-weight:800;
}
.section-heading .sec-count{
  font-family:var(--font-accent); font-style:italic; color:var(--text-muted); font-size:.9rem;
}
.section-heading .sec-divider{
  flex:1; height:1px;
  background:linear-gradient(90deg, var(--border-soft), transparent);
}

.card-grid{
  display:grid; grid-template-columns:1fr; gap:22px;
}
@media (min-width:560px){ .card-grid{ grid-template-columns:repeat(2,1fr); } }
@media (min-width:900px){ .card-grid{ grid-template-columns:repeat(3,1fr); } }
@media (min-width:1180px){ .card-grid{ grid-template-columns:repeat(4,1fr); } }

/* -------------------- کارت محصول -------------------- */
.menu-card{
  position:relative;
  border-radius:var(--radius-lg);
  background:rgba(var(--surface-rgb),.5);
  border:1px solid var(--border-soft);
  backdrop-filter:blur(var(--glass-blur));
  -webkit-backdrop-filter:blur(var(--glass-blur));
  box-shadow:var(--card-shadow);
  overflow:hidden;
  display:flex; flex-direction:column;
  transition:transform var(--speed-med) var(--ease), box-shadow var(--speed-med) var(--ease), border-color var(--speed-med) var(--ease);
  animation:card-in .6s var(--ease) both;
}
@keyframes card-in{ from{ opacity:0; transform:translateY(24px) scale(.97);} to{ opacity:1; transform:translateY(0) scale(1);} }
.menu-card:hover{
  transform:translateY(-8px);
  border-color:var(--gold-soft);
  box-shadow:0 30px 55px -22px rgba(0,0,0,.5), 0 0 0 1px var(--gold-soft);
}
.menu-card.is-selected{ border-color:var(--gold); box-shadow:0 0 0 2px var(--gold-soft), var(--card-shadow); }

.card-media{ position:relative; height:190px; overflow:hidden; }
.card-media img{
  width:100%; height:100%; object-fit:cover;
  transition:transform .7s var(--ease), filter .5s var(--ease);
}
.menu-card:hover .card-media img{ transform:scale(1.08); }
.card-media::after{
  content:''; position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(20,12,8,0) 55%, rgba(20,12,8,.55) 100%);
}
.card-media.img-loading img{ opacity:0; }
.card-media .media-skeleton{
  position:absolute; inset:0;
  background:linear-gradient(100deg, rgba(161,136,127,.15) 30%, rgba(161,136,127,.35) 50%, rgba(161,136,127,.15) 70%);
  background-size:200% 100%;
  animation:shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer{ from{ background-position:200% 0; } to{ background-position:-200% 0; } }

/* مهر قیمت به سبک مهر موم روی بسته قهوه — عنصر امضای این طراحی */
.price-seal{
  position:absolute; top:12px; left:12px; z-index:2;
  width:58px; height:58px; border-radius:50%;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  background:radial-gradient(circle at 35% 30%, #e0b640, var(--gold) 55%, #8a6a17 100%);
  color:#241505; font-weight:800;
  box-shadow:0 8px 18px -6px rgba(0,0,0,.55), inset 0 0 0 2px rgba(255,255,255,.25);
  border:2px dashed rgba(36,21,5,.35);
  transform:rotate(-8deg);
  transition:transform var(--speed-fast) var(--ease);
}
.menu-card:hover .price-seal{ transform:rotate(0deg) scale(1.06); }
.price-seal .seal-amount{ font-size:.85rem; line-height:1; }
.price-seal .seal-currency{ font-size:.5rem; opacity:.85; }

.card-body{ padding:18px 18px 16px; display:flex; flex-direction:column; gap:10px; flex:1; }
.card-name{ font-size:1.08rem; font-weight:700; color:var(--text-strong); }
.card-desc{ font-size:.85rem; color:var(--text-muted); line-height:1.75; }

.card-ingredients{ display:flex; flex-wrap:wrap; gap:6px; margin-top:2px; }
.ingredient-pill{
  font-size:.7rem; padding:4px 10px; border-radius:var(--radius-pill);
  background:rgba(161,136,127,.16); color:var(--text-muted);
  border:1px solid var(--border-soft);
}

.card-footer{
  margin-top:auto; padding-top:12px;
  display:flex; align-items:center; justify-content:space-between;
  border-top:1px dashed var(--border-soft);
}
.card-footer .footer-price{ font-family:var(--font-accent); font-style:italic; font-size:1.1rem; color:var(--gold); font-weight:600; }
.card-footer .footer-price small{ font-size:.65rem; color:var(--text-muted); font-style:normal; }

/* -------------------- چک‌باکس سفارشی به شکل فنجان -------------------- */
.select-check{ position:relative; width:44px; height:44px; }
.select-check input{
  position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; margin:0; z-index:2;
}
.select-check .check-visual{
  width:100%; height:100%; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:rgba(161,136,127,.14);
  border:1.5px solid var(--border-soft);
  color:var(--text-muted); font-size:1rem;
  transition:all var(--speed-fast) var(--ease);
}
.select-check input:checked ~ .check-visual{
  background:linear-gradient(135deg, var(--mocha-500), var(--espresso-900));
  border-color:var(--gold); color:var(--gold);
  transform:scale(1.08);
  animation:check-pop .4s var(--ease);
}
@keyframes check-pop{ 0%{ transform:scale(.7); } 60%{ transform:scale(1.18); } 100%{ transform:scale(1.08); } }
.select-check input:focus-visible ~ .check-visual{ outline:2px solid var(--gold); outline-offset:2px; }

/* =====================================================================
   وضعیت خالی
   ===================================================================== */
.empty-state{ text-align:center; padding:70px 20px; color:var(--text-muted); }
.empty-state i{ font-size:2.6rem; color:var(--gold); margin-bottom:16px; }
.empty-state h3{ color:var(--text-strong); margin-bottom:8px; font-size:1.15rem; }

/* =====================================================================
   فوتر
   ===================================================================== */
.site-footer{
  text-align:center; padding:50px 20px 40px;
  background:linear-gradient(180deg, transparent, rgba(0,0,0,.12));
  border-top:1px solid var(--border-soft);
  color:var(--text-muted);
}
.footer-brand{ display:flex; align-items:center; justify-content:center; gap:8px; color:var(--text-strong); font-size:1.1rem; margin-bottom:8px; }
.footer-brand i{ color:var(--gold); }
.footer-socials{ display:flex; justify-content:center; gap:14px; margin:16px 0; }
.footer-socials a{
  width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:rgba(161,136,127,.14); border:1px solid var(--border-soft); transition:all var(--speed-fast) var(--ease);
}
.footer-socials a:hover{ background:var(--gold); color:#241505; transform:translateY(-3px); }
.site-footer small{ display:block; margin-top:14px; font-size:.72rem; opacity:.7; }

/* =====================================================================
   دکمه شناور «انتخاب من»
   ===================================================================== */
.selection-fab{
  position:fixed; bottom:22px; left:22px; z-index:600;
  display:flex; align-items:center; gap:10px;
  padding:14px 22px 14px 18px; border-radius:var(--radius-pill);
  background:linear-gradient(135deg, var(--gold), #a9821f);
  color:#241505; font-weight:700; font-size:.9rem;
  box-shadow:0 16px 34px -12px var(--gold-glow);
  transition:transform var(--speed-fast) var(--ease), box-shadow var(--speed-fast) var(--ease);
  animation:fab-in .5s var(--ease) both;
}
/* همان اصلاح حیاتی بالا: بدون این خط، دکمه شناور حتی با hidden=true
   به‌خاطر display:flex هرگز واقعاً مخفی نمی‌شود. */
.selection-fab[hidden]{ display:none !important; }
@keyframes fab-in{ from{ opacity:0; transform:translateY(20px) scale(.8); } to{ opacity:1; transform:translateY(0) scale(1); } }
.selection-fab:hover{ transform:translateY(-4px); box-shadow:0 22px 42px -10px var(--gold-glow); }
.selection-fab .fab-icon{ font-size:1.15rem; animation:fab-bounce 2.4s ease-in-out infinite; }
@keyframes fab-bounce{ 0%,100%{ transform:translateY(0);} 50%{ transform:translateY(-3px);} }
.fab-badge{
  min-width:22px; height:22px; padding:0 6px; border-radius:50%;
  background:var(--espresso-900); color:var(--gold);
  display:flex; align-items:center; justify-content:center; font-size:.72rem; font-weight:800;
}

/* =====================================================================
   مودال انتخاب‌ها (سبک برگه‌ی رسید / بلیط)
   ===================================================================== */
.modal-backdrop{
  position:fixed; inset:0; z-index:800;
  background:rgba(10,6,4,.6);
  backdrop-filter:blur(6px);
  display:flex; align-items:flex-end; justify-content:center;
  animation:backdrop-in .3s var(--ease);
}
/* نکته حیاتی: چون display:flex بالا مستقیم روی کلاس ست شده، باید صراحتاً
   وقتی ویژگی hidden فعال است نمایش را خاموش کنیم؛ در غیر این‌صورت
   استایل نویسنده (author) همیشه بر قانون پیش‌فرض مرورگر برای [hidden]
   غالب می‌شود و مودال هرگز واقعاً بسته نمی‌شود. */
.modal-backdrop[hidden]{ display:none !important; }
@keyframes backdrop-in{ from{ opacity:0;} to{ opacity:1;} }
@media (min-width:640px){ .modal-backdrop{ align-items:center; } }

.selection-modal{
  position:relative;
  width:100%; max-width:480px;
  max-height:85vh;
  background:var(--bg-elevated);
  border:1px solid var(--border-soft);
  border-radius:26px 26px 0 0;
  display:flex; flex-direction:column;
  box-shadow:0 -20px 60px rgba(0,0,0,.4);
  animation:modal-up .45s var(--ease);
}
@media (min-width:640px){
  .selection-modal{ border-radius:var(--radius-lg); animation:modal-pop .35s var(--ease); }
}
@keyframes modal-up{ from{ transform:translateY(60px); opacity:0; } to{ transform:translateY(0); opacity:1; } }
@keyframes modal-pop{ from{ transform:scale(.92); opacity:0; } to{ transform:scale(1); opacity:1; } }

.ticket-notch{
  position:absolute; inset-inline:0; height:14px;
  background:radial-gradient(circle at 10px 50%, transparent 8px, var(--bg) 9px) repeat-x;
  background-size:24px 14px;
}
.ticket-notch.top{ top:-1px; transform:rotate(180deg); display:none; }
.ticket-notch.bottom{ bottom:-1px; display:none; }
@media (min-width:640px){ .ticket-notch.bottom{ display:block; } }

.modal-header{
  display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
  padding:22px 22px 14px; border-bottom:1px dashed var(--border-soft);
}
.modal-header h2{ font-size:1.1rem; color:var(--text-strong); display:flex; align-items:center; gap:8px; }
.modal-header h2 i{ color:var(--gold); }
.modal-header small{ display:block; margin-top:4px; color:var(--text-muted); font-size:.72rem; }

.modal-body{ padding:14px 22px; overflow-y:auto; flex:1; display:flex; flex-direction:column; gap:12px; }

.selection-row{
  display:flex; align-items:center; gap:12px;
  padding:10px; border-radius:var(--radius-md);
  background:rgba(161,136,127,.1);
  border:1px solid var(--border-soft);
  animation:row-in .35s var(--ease) both;
}
@keyframes row-in{ from{ opacity:0; transform:translateX(14px);} to{ opacity:1; transform:translateX(0);} }
.selection-row img{ width:54px; height:54px; border-radius:12px; object-fit:cover; flex:0 0 auto; }
.selection-row .row-info{ flex:1; min-width:0; }
.selection-row .row-name{ font-size:.92rem; font-weight:700; color:var(--text-strong); }
.selection-row .row-price{ font-size:.78rem; color:var(--gold); font-family:var(--font-accent); font-style:italic; }
.selection-row .row-remove{
  width:34px; height:34px; border-radius:50%; flex:0 0 auto;
  display:flex; align-items:center; justify-content:center;
  background:rgba(161,136,127,.15); color:var(--text-muted);
  transition:all var(--speed-fast) var(--ease);
}
.selection-row .row-remove:hover{ background:#c0392b; color:#fff; transform:scale(1.08); }

.modal-empty{ text-align:center; padding:40px 20px; color:var(--text-muted); }
.modal-empty i{ font-size:2.2rem; color:var(--gold); margin-bottom:12px; display:block; }

.modal-footer{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:16px 22px 22px; border-top:1px dashed var(--border-soft);
}
.btn-ghost{
  display:flex; align-items:center; gap:8px;
  padding:10px 16px; border-radius:var(--radius-pill);
  background:rgba(161,136,127,.12); color:var(--text-muted);
  border:1px solid var(--border-soft); font-size:.8rem;
  transition:all var(--speed-fast) var(--ease);
}
.btn-ghost:hover{ background:#c0392b; color:#fff; border-color:#c0392b; }
.modal-total{ text-align:left; }
.modal-total span{ display:block; font-size:.72rem; color:var(--text-muted); }
.modal-total strong{ font-size:1.25rem; color:var(--gold); }

.modal-close{ flex:0 0 auto; }

/* =====================================================================
   واکنش‌گرایی نهایی و جزئیات دسترس‌پذیری
   ===================================================================== */
@media (max-width:420px){
  .selection-fab .fab-label{ display:none; }
  .selection-fab{ padding:14px; }
}

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

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
}
