:root {
  --bg-cream: #faf6f0;
  --bg-card: #ffffff;
  --bg-soft: #f2ebe1;
  --espresso: #1c110b;
  --espresso-mid: #2f2018;
  --gold: #c8923e;
  --gold-light: #f3d59b;
  --text-main: #231812;
  --text-muted: #6f5d52;
  --border-soft: #e6dccf;
  --radius: 16px;
  --shadow-sm: 0 2px 10px rgba(28, 18, 13, 0.08);
  --shadow-md: 0 12px 32px rgba(28, 18, 13, 0.2);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* إزالة تأخير اللمس 350ms (مهم بعد السماح بالتكبير في الـ viewport) */
button,
a,
input,
select,
textarea,
.cat-tab,
.choice-chip {
  touch-action: manipulation;
}

body {
  font-family: "Cairo", system-ui, -apple-system, sans-serif;
  background-color: var(--espresso);
  color: var(--text-main);
  line-height: 1.55;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

/* حلقة تركيز مرئية للوحة المفاتيح (البحث ليه ring خاص أعلى) */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.ui-ico {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.18em;
  flex-shrink: 0;
  display: inline-block;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.phone-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Keyframe Animations */
@keyframes sealFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(1.5deg); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes backdropFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetUp {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Coffee & Chocolate SVG Animations */
.wisp {
  fill: #fff;
  filter: url(#smoke);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: rise 6s ease-out infinite;
}
.wisp:nth-child(2) { animation-delay: 2s; animation-duration: 6.6s; }
.wisp:nth-child(3) { animation-delay: 4s; animation-duration: 5.6s; }
@keyframes rise {
  0% { opacity: 0; transform: translate(0, 30px) scale(0.5, 0.4); }
  25% { opacity: 0.4; }
  100% { opacity: 0; transform: translate(12px, -100px) scale(1.5, 1.8); }
}

.rip {
  fill: none;
  stroke: #e9b77d;
  stroke-width: 1.4;
  transform-box: fill-box;
  transform-origin: center;
  animation: rip 2.4s ease-out infinite;
  opacity: 0;
}
.rip:nth-of-type(2) { animation-delay: 0.8s; }
.rip:nth-of-type(3) { animation-delay: 1.6s; }
@keyframes rip {
  0% { transform: scale(0.2); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.foam circle {
  fill: rgba(255, 226, 180, 0.5);
  animation: bub 4s ease-in-out infinite alternate;
}
.foam circle:nth-child(2n) { animation-delay: 1s; }
.foam circle:nth-child(3n) { animation-delay: 2s; }
@keyframes bub {
  from { transform: scale(0.7); opacity: 0.3; }
  to { transform: scale(1.15); opacity: 0.65; }
}

.drip {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: drip 5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.drip:nth-of-type(2) { animation-delay: 1.5s; animation-duration: 6s; }
.drip:nth-of-type(3) { animation-delay: 3s; animation-duration: 5.4s; }
@keyframes drip {
  0% { transform: scaleY(0.35); }
  70%, 100% { transform: scaleY(1); }
}

.bead {
  fill: url(#chGrad);
  animation: bead 5s cubic-bezier(0.5, 0, 1, 0.6) infinite;
}
.bead:nth-of-type(2) { animation-delay: 1.5s; animation-duration: 6s; }
.bead:nth-of-type(3) { animation-delay: 3s; animation-duration: 5.4s; }
@keyframes bead {
  0%, 68% { transform: translateY(0) scale(0); opacity: 0; }
  72% { opacity: 1; transform: translateY(0) scale(1); }
  100% { transform: translateY(110px) scale(0.8, 1.3); opacity: 0; }
}

/* Stage & Canvas */
.stage { position: relative; overflow: hidden; }

.stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Header / Hero */
.hero {
  background: radial-gradient(ellipse at 50% 85%, #4a2a19, #1c110b 72%);
  color: #fff;
  padding: 14px 16px 26px;
  border-bottom: 3px solid var(--gold);
}

.pdf-corner-wave {
  position: absolute;
  top: -36px;
  inset-inline-start: -36px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle at 35% 35%, #e5ccb0 0%, #9b734e 58%, transparent 72%);
  border-radius: 44% 56% 62% 38% / 44% 40% 60% 56%;
  opacity: 0.25;
  z-index: 1;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
}

.hero-top-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

/* Modern Segmented Sliding Language Switch */
.lang-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(243, 213, 155, 0.35);
  border-radius: 999px;
  padding: 3px;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.35);
}

.lang-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  inset-inline-start: 3px;
  width: calc(50% - 3px);
  background: linear-gradient(135deg, #f3d59b, #c8923e);
  border-radius: 999px;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(200, 146, 62, 0.45);
}

html[dir="rtl"] .lang-switch.is-en .lang-thumb {
  transform: translateX(-100%);
}

html[dir="ltr"] .lang-switch.is-en .lang-thumb {
  transform: translateX(100%);
}

.lang-opt {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  color: #e6d5c1;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 14px; /* هدف لمس داخل المفتاح */
  cursor: pointer;
  transition: color 0.2s;
  min-width: 54px;
}

.lang-opt.active {
  color: var(--espresso);
}

/* صف واحد في كل الأحجام — النص جنب الفنجان (كان عمودي في الموبايل
   فكان البخار والسكب بيوصلوا لحدود النص فوق) */
.hero-grid {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

@media (min-width: 720px) {
  .hero-grid {
    gap: 14px;
  }
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0; /* يسمح للنص بالالتفاف بدل ما يدفّع الفنجان برّا */
}

@media (min-width: 720px) {
  .brand-row {
    gap: 14px;
  }
}

.brand-seal {
  position: relative; /* لكنة اللوجو فوق الختم */
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  animation: sealFloat 4.5s ease-in-out infinite;
}

@media (min-width: 720px) {
  .brand-seal {
    width: 76px;
    height: 76px;
  }
}

.seal-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

/* لوجو الشركة — دائر مقصوص (الصورة أصلية مربعة بخلفية سوداء) */
.brand-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

.brand-text h1 {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
}

.tagline {
  font-size: 0.92rem;
  color: #f0e4d6;
  margin-top: 2px;
}

.shop-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #decbb6;
}

.phone-pill {
  background: rgba(200, 146, 62, 0.22);
  border: 1px solid rgba(243, 213, 155, 0.5);
  color: var(--gold-light);
  padding: 2px 10px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.hero-art {
  width: min(124px, 33vw);
  flex-shrink: 0;
  padding: 10px 8px 4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 163, 89, 0.18) 0%, transparent 68%);
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
}

@media (min-width: 720px) {
  .hero-art {
    width: 185px;
    padding: 12px 10px 4px;
  }
}

.hero-art svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

/* Sticky Nav */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(28, 17, 11, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(200, 146, 62, 0.3);
  padding: 10px 16px 12px;
}

/* ظل خفيف أول ما الشريط يلزق بالأعلى (أضافه app.js عند التمرير) */
.sticky-nav.is-stuck {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.nav-container {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  inset-inline-start: 14px;
  font-size: 0.95rem;
  pointer-events: none;
}

#search-input {
  width: 100%;
  padding: 10px 40px;
  border: 1.5px solid rgba(200, 146, 62, 0.38);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 146, 62, 0.22);
}

/* إخفاء زر ✕ الأصلى في ويبكت — في زر مخصص جنبه */
#search-input::-webkit-search-cancel-button,
#search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.clear-btn {
  position: absolute;
  inset-inline-end: 10px;
  background: var(--bg-soft);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* منطقة لمس أكبر من الحجم البصري (~44px) */
.clear-btn::after {
  content: "";
  position: absolute;
  inset: -9px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}

.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  border: 1.5px solid rgba(243, 213, 155, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #f3e8da;
  padding: 7px 14px;
  min-height: 42px; /* هدف لمس مريح */
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  scroll-snap-align: center;
}

@media (hover: hover) {
  .cat-tab:hover {
    border-color: var(--gold-light);
    transform: translateY(-1px);
  }
}

.cat-tab.active {
  background: var(--gold);
  color: var(--espresso);
  border-color: var(--gold-light);
  box-shadow: 0 4px 14px rgba(200, 146, 62, 0.35);
}

/* Main Menu & PDF-Matched Section Themes */
.menu-main { width: 100%; }

.category-section {
  position: relative;
  padding: 26px 16px 32px;
}

.section-inner {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
}

.theme-dark-roast {
  background: radial-gradient(circle at 85% 15%, #301b10 0%, #150c07 78%);
  color: #f5ebdd;
  border-bottom: 1px solid rgba(200, 146, 62, 0.22);
}

.theme-dark-roast .category-header { border-bottom-color: rgba(200, 146, 62, 0.32); }
.theme-dark-roast .category-header h2, .theme-dark-roast .group-title { color: var(--gold-light); }
.theme-dark-roast .item-card { background: rgba(34, 21, 14, 0.88); border-color: rgba(200, 146, 62, 0.28); backdrop-filter: blur(6px); }
.theme-dark-roast .item-card:hover { border-color: var(--gold-light); box-shadow: 0 8px 24px rgba(200, 146, 62, 0.2); }
.theme-dark-roast .item-name { color: #fff6ea; }
.theme-dark-roast .item-desc { color: #d4c2ae; }
.theme-dark-roast .item-tag { background: rgba(243, 213, 155, 0.12); color: var(--gold-light); }
.theme-dark-roast .item-bottom { border-top-color: rgba(243, 213, 155, 0.16); }
.theme-dark-roast .item-price { color: var(--gold-light); }
.theme-dark-roast .item-price small { color: #cbb7a2; }
.theme-dark-roast .details-btn { background: rgba(200, 146, 62, 0.18); color: var(--gold-light); border: 1px solid rgba(243, 213, 155, 0.4); }
@media (hover: hover) { .theme-dark-roast .details-btn:hover { background: var(--gold); color: var(--espresso); } }

.theme-cream-latte {
  background: linear-gradient(180deg, #faf3ea 0%, #f1e4d3 100%);
  color: var(--text-main);
  border-bottom: 1px solid var(--border-soft);
}

.theme-iced {
  background: linear-gradient(180deg, #edf4f7 0%, #f6efe6 100%);
  color: var(--text-main);
  border-bottom: 1px solid var(--border-soft);
}

.theme-chocolate {
  background: radial-gradient(ellipse at 50% 85%, #52261a, #25100a 72%);
  color: #f5ebdd;
}

.theme-chocolate .category-header { border-bottom-color: rgba(243, 213, 155, 0.3); }
.theme-chocolate .category-header h2, .theme-chocolate .group-title { color: var(--gold-light); }
.theme-chocolate .item-card { background: rgba(37, 16, 10, 0.88); border-color: rgba(243, 213, 155, 0.28); backdrop-filter: blur(6px); }
.theme-chocolate .item-name { color: #fff6ea; }
.theme-chocolate .item-desc { color: #dfc9b7; }
.theme-chocolate .item-tag { background: rgba(243, 213, 155, 0.14); color: var(--gold-light); }
.theme-chocolate .item-bottom { border-top-color: rgba(243, 213, 155, 0.18); }
.theme-chocolate .item-price { color: var(--gold-light); }
.theme-chocolate .details-btn { background: rgba(200, 146, 62, 0.2); color: var(--gold-light); border: 1px solid rgba(243, 213, 155, 0.4); }
@media (hover: hover) { .theme-chocolate .details-btn:hover { background: var(--gold); color: var(--espresso); } }

.choc-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  text-align: center;
}

.choc-art { width: min(170px, 44vw); }
.choc-art svg { width: 100%; height: auto; display: block; overflow: visible; }
.choc-banner-text h3 { font-size: 1.25rem; font-weight: 900; color: var(--gold-light); }
.choc-banner-text p { font-size: 0.88rem; color: #ebd8c8; margin-top: 2px; }

/* Section Headers & Cards */
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border-soft);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.category-header h2 { font-size: 1.3rem; font-weight: 800; color: var(--espresso); }
.group-block { margin-bottom: 22px; }

.group-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--espresso-mid);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-title::before {
  content: "";
  width: 4px;
  height: 18px;
  background: var(--gold);
  border-radius: 4px;
}

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

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  opacity: 0;
  animation: cardIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--card-index, 0) * 35ms);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .item-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(200, 146, 62, 0.16);
  }
}

/* أثناء/بعد البحث: الكروت تظهر فوراً بدون إعادة تشغيل حركة الدخول */
.menu-main.no-enter .item-card {
  animation: none;
  opacity: 1;
}

.item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.item-name { font-size: 1.02rem; font-weight: 800; color: var(--espresso); }

.item-badge {
  flex-shrink: 0;
  background: #fdf3e1;
  color: #8a5a12; /* 5.4:1 على #fdf3e1 (كان 4.17 وتحت حد WCAG) */
  border: 1px solid #eed29c;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.item-desc { font-size: 0.81rem; color: var(--text-muted); margin-top: 4px; line-height: 1.45; }

.item-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.item-tag { font-size: 0.7rem; font-weight: 700; background: var(--bg-soft); color: var(--espresso-mid); padding: 2px 7px; border-radius: 6px; }

.item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-soft);
}

.item-price { font-size: 0.98rem; font-weight: 800; color: var(--espresso-mid); }
.item-price small { font-weight: 600; color: var(--text-muted); font-size: 0.78rem; }

.details-btn {
  background: var(--bg-soft);
  color: var(--espresso);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 8px 14px;
  min-height: 38px; /* هدف لمس */
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

@media (hover: hover) {
  .details-btn:hover { background: var(--espresso); color: var(--gold-light); }
}

.empty-state { text-align: center; padding: 48px 16px; color: #e2d2c0; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 26px 16px calc(26px + env(safe-area-inset-bottom));
  color: #d4c2ae;
  background: var(--espresso);
  font-size: 0.85rem;
  border-top: 2px solid rgba(200, 146, 62, 0.35);
}

.site-footer a { color: var(--gold-light); font-weight: 700; text-decoration: none; }

.footer-admin-wrap { display: none; } /* اللوحة مخفية عن العملاء — الدخول بالضغط المضاعف على الشعار */

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 11, 8, 0.66);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: backdropFade 0.2s ease-out;
}

@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 16px; }
}

.modal-sheet {
  background: var(--bg-cream);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  max-height: 90dvh; /* ارتفاع ثابت مع شريط عنوان الموبايل المتغير */
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: sheetUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 640px) {
  .modal-sheet { border-radius: 20px; }
}

.modal-header {
  background: #fff;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 { font-size: 1.12rem; font-weight: 800; color: var(--espresso); }
.modal-sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

.icon-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
  color: var(--espresso);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.modal-desc { font-size: 0.92rem; color: var(--text-muted); line-height: 1.75; }
.option-group { margin-bottom: 16px; }
.option-group-title { font-size: 0.9rem; font-weight: 800; color: var(--espresso); margin-bottom: 8px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

.choice-chip {
  border: 1.5px solid var(--border-soft);
  background: #fff;
  color: var(--text-main);
  padding: 9px 14px;
  min-height: 40px; /* هدف لمس */
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.choice-chip.selected {
  background: var(--espresso);
  color: var(--gold-light);
  border-color: var(--espresso);
}

.price-only-footer {
  background: #fff;
  padding: 14px 18px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom)); /* تجنب منطقة Home على الآيفون */
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
}

.modal-price-display {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--espresso);
  background: #fdf3e1;
  border: 1px solid #eed29c;
  padding: 4px 14px;
  border-radius: 10px;
}

/* ضغطة اللمس: استجابة فورية على الشاشات اللمسية */
.cat-tab:active,
.details-btn:active,
.choice-chip:active,
.lang-opt:active,
.icon-close:active,
.admin-link:active {
  transform: scale(0.95);
}

/* ===== تحسينات الهاتف ===== */
@media (max-width: 640px) {
  /* 16px يمنع الزوم التلقائي على iOS عند دخول حقل البحث */
  #search-input {
    font-size: 16px;
  }

  .sticky-nav {
    padding: 8px 12px 10px;
  }

  .category-tabs {
    scroll-snap-type: x proximity;
  }

  /* مقبض الشيت السفلي — إحساس مودال موبايل أصلي */
  .modal-sheet::before {
    content: "";
    flex: 0 0 auto;
    width: 42px;
    height: 4px;
    border-radius: 99px;
    background: rgba(28, 17, 11, 0.16);
    margin: 8px auto 0;
  }

  .brand-text h1,
  .category-header h2 {
    text-wrap: balance;
  }

  /* منع سطر "يتيم" في العنوان + تكبير سطر يسمح للعنوان في سطرين */
  .shop-meta {
    font-size: 0.78rem;
  }

  #shop-address {
    text-wrap: pretty;
  }
}

/* أجهزة صغيرة (360px وأقل): نعطي النص مساحة إضافية على حساب الختم والفنجان */
@media (max-width: 400px) {
  .brand-seal {
    width: 52px;
    height: 52px;
  }

  .hero-art {
    width: min(118px, 31vw);
  }

  .tagline {
    font-size: 0.85rem;
  }

  .shop-meta {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, .wisp, .rip, .foam circle, .drip, .bead {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
