/*
Theme Name: Toorela
Theme URI: https://toorela.com
Description: منصة خصومات وعروض احترافية - مطاعم، مقاهي، صالونات، فنادق
Version: 1.0.1
Author: Toorela Team
Text Domain: toorela
Tags: rtl-language, custom-colors, custom-logo, custom-menu, featured-images, mobile-first
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
*/

/* ================================================================
   DESIGN TOKENS
   ================================================================ */
:root {
  /* Brand Colors */
  --navy:          #0D1B3E;
  --navy-dark:     #070F23;
  --navy-light:    #1A2E5A;
  --orange:        #F26B1D;
  --orange-dark:   #D4560E;
  --orange-light:  #FFF3EC;
  --white:         #FFFFFF;
  --off-white:     #F8F9FC;
  --grey-50:       #F9FAFB;
  --grey-100:      #F3F4F6;
  --grey-200:      #E5E7EB;
  --grey-300:      #D1D5DB;
  --grey-400:      #9CA3AF;
  --grey-500:      #6B7280;
  --grey-700:      #374151;
  --grey-900:      #111827;

  /* Semantic */
  --clr-primary:   var(--navy);
  --clr-action:    var(--orange);
  --clr-bg:        var(--off-white);
  --clr-text:      var(--grey-900);
  --clr-muted:     var(--grey-500);
  --clr-border:    var(--grey-200);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.16);
  --shadow-orange: 0 4px 20px rgba(242,107,29,0.35);

  /* Radii */
  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;

  /* Typography */
  --font: 'Cairo', 'Tajawal', system-ui, Arial, sans-serif;
  --fz-xs:   11px;
  --fz-sm:   13px;
  --fz-base: 15px;
  --fz-md:   17px;
  --fz-lg:   20px;
  --fz-xl:   24px;
  --fz-2xl:  30px;

  /* Layout */
  --header-h:    60px;
  --bottom-nav-h: 62px;
  --container:   1200px;
  --transition:  0.2s ease;
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overscroll-behavior-y: contain; /* منع تأثير الارتداد المطاطي — إحساس تطبيق */
}
body {
  font-family: var(--font);
  background: var(--clr-bg);
  color: var(--clr-text);
  direction: rtl;
  line-height: 1.65;
  overflow-x: hidden;
  overscroll-behavior-y: contain; /* منع تأثير الارتداد المطاطي — إحساس تطبيق */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a    { text-decoration: none; color: inherit; transition: color var(--transition); }
img  { max-width: 100%; height: auto; display: block; }

/* ================================================================
   إحساس التطبيق (App Feel) — رد فعل لمسي، بلا "طابع" المتصفح
   ================================================================ */
html, body {
  -webkit-tap-highlight-color: transparent; /* حذف الهايلايت الأزرق عند اللمس */
  -webkit-touch-callout: none; /* منع قائمة "فتح/تحميل/نسخ" عند الضغط المطول — إحساس تطبيق */
  -webkit-user-select: none;
  user-select: none; /* منع تحديد النص الأزرق عند السحب */
}
/* حقول الإدخال خصها تبقى قابلة للتحديد والنسخ عادي — المستخدم محتاج يصحح/ينسخ اللي كتب */
input, textarea, [contenteditable="true"] {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}
a, button, .hero-cat-pill, .cat-chip, .neigh-chip, .featured-card,
.offer-card, .card-fav, .cat-circle {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* يحذف تأخير 300ms ديال نقرة اللمس */
}
/* رد فعل خفيف عند الضغط — بحال تطبيق حقيقي */
.hero-cat-pill:active,
.cat-chip:active .cat-circle,
.neigh-chip:active,
.featured-card:active .featured-thumb,
.offer-card:active .card-thumb,
.card-fav:active {
  transform: scale(0.94);
}
.hero-cat-pill,
.neigh-chip,
.card-fav {
  transition: transform 0.12s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cat-circle,
.featured-thumb,
.card-thumb {
  transition: transform 0.12s ease;
}

/* شيمر خفيف خلف الصور أثناء التحميل — يختفي تلقائياً بمجرد رسم الصورة فوقه */
.card-thumb,
.featured-thumb {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200%;
  animation: shimmer 1.4s infinite;
}

/* ── 4K / Retina Image Quality ── */
.card-thumb img,
.gallery-slide img,
.tr-lb-slide img {
  image-rendering: -webkit-optimize-contrast; /* Safari — يمنع blur الـ upscaling */
  image-rendering: crisp-edges;               /* Firefox fallback */
  -webkit-backface-visibility: hidden;        /* GPU layer — يمنع blur على التحريك */
  backface-visibility: hidden;
  transform: translateZ(0);                   /* يفعّل GPU acceleration */
}
ul   { list-style: none; }
button, input, select, textarea { font-family: var(--font); font-size: 16px; }
button { cursor: pointer; }
h1,h2,h3,h4,h5,h6 { font-weight: 800; line-height: 1.25; color: var(--navy); }
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* ================================================================
   UTILITIES
   ================================================================ */
.container    { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-md); }
.sr-only      { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.text-center  { text-align: center; }
.text-orange  { color: var(--orange); }
.text-navy    { color: var(--navy); }
.text-muted   { color: var(--clr-muted); }
.fw-bold      { font-weight: 700; }
.fw-black     { font-weight: 900; }
.d-flex       { display: flex; align-items: center; }
.gap-sm       { gap: var(--sp-sm); }
.gap-md       { gap: var(--sp-md); }
.mt-sm        { margin-top: var(--sp-sm); }
.mt-md        { margin-top: var(--sp-md); }
.mt-lg        { margin-top: var(--sp-lg); }
.mb-md        { margin-bottom: var(--sp-md); }
.mb-lg        { margin-bottom: var(--sp-lg); }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--r-full);
  font-size: var(--fz-sm);
  font-weight: 700;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
  box-shadow: var(--shadow-orange);
}
.btn-primary:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(242,107,29,0.45);
}
.btn-primary:active { transform: scale(0.96); box-shadow: 0 3px 12px rgba(242,107,29,0.4); }
.btn-navy:active { transform: scale(0.96); }
.btn-outline:active { transform: scale(0.96); opacity: .85; }
.btn-navy {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-navy:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: var(--white); }
.btn-outline {
  background: transparent;
  color: var(--orange);
  border-color: var(--orange);
}
.btn-outline:hover { background: var(--orange); color: var(--white); }
.btn-ghost {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border-color: rgba(255,255,255,0.2);
}
.btn-ghost:hover { background: rgba(255,255,255,0.22); }
.btn-ghost:active { transform: scale(0.96); background: rgba(255,255,255,0.3); }
.btn-sm  { padding: 7px 16px; font-size: var(--fz-xs); }
.btn-lg  { padding: 14px 32px; font-size: var(--fz-base); }
.btn-block { width: 100%; border-radius: var(--r-md); }
.btn-icon {
  width: 42px; height: 42px; padding: 0; border-radius: 50%;
}

/* ================================================================
   HEADER
   ================================================================ */
#tr-header {
  position: sticky;
  top: 0;
  z-index: 800;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--navy);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition);
  box-sizing: border-box;
  overflow: hidden;   /* حماية: أي فائض غير متوقع يتقص هوني، ماشي يكسر عرض الصفحة كاملة */
}
.header-inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
  gap: var(--sp-sm);
  min-width: 0;
}

/* وضع التاجر: غير اللوجو باقي فالهيدر (بلا مدينة/بحث/لغة) — نوسطوه
   بدل ما نخليوه معلق فجهة وحدو مع فراغ عشوائي فالوسط */
.header-inner--merchant {
  justify-content: center;
}

/* Logo — حجم ثابت دائمًا (بلا تقلص، بلا قص)، بسقف أقصى للعرض كحماية أخيرة بس */
.site-branding { flex-shrink: 0; }
.tr-logo {
  font-size: 22px;
  font-weight: 900;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  text-decoration: none;
}
.tr-logo .logo-pct { color: var(--orange); font-size: 26px; }
.tr-logo img,
.tr-logo img.custom-logo {
  height: 38px;
  width: auto;
  max-height: 38px;
  max-width: 150px;   /* سقف احترازي: ما كيأثرش على شعار عادي، غير كيحمي من شعار كبير بزاف */
  flex-shrink: 0;
  display: block;
}

/* City Selector */
.city-selector {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r-full);
  padding: 6px 12px;
  color: var(--white);
  font-size: var(--fz-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 56px;   /* حد أدنى باش الـpill ما يختفيش كامل، غير النص جواه هو اللي كيتقص */
  overflow: hidden;
}
.city-selector:hover { background: rgba(255,255,255,0.18); }
.city-selector svg   { flex-shrink: 0; }
#city-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Language Switcher — نفس ستايل City Selector (pill) */
#lang-switcher-btn {
  width: auto;
  padding: 6px 10px;
  border-radius: var(--r-full);
  gap: 3px;
}
#lang-switcher-btn svg { flex-shrink: 0; }
#lang-current-label {
  font-size: 11px;
  font-weight: 700;
  margin-inline-start: 2px;
}

/* Header center / spacer */
.header-spacer { flex: 1; }

/* Merchant Shop Badge — بديل محدد المدينة/البحث/اللغة فوضع التاجر */
.merchant-shop-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--r-full);
  padding: 6px 14px;
  flex-shrink: 1;
  min-width: 0;
  max-width: 220px;
}
.merchant-shop-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.merchant-shop-dot.is-open   { background: #5DCAA5; }
.merchant-shop-dot.is-closed { background: #E24B4A; }
.merchant-shop-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}
.merchant-shop-name {
  color: var(--white);
  font-size: var(--fz-sm);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.merchant-shop-status {
  color: rgba(255,255,255,0.65);
  font-size: var(--fz-xs);
  white-space: nowrap;
}

/* Header Icons */
.header-icons { display: flex; align-items: center; gap: 4px; }
.header-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--white);
  font-size: 18px;
  transition: background var(--transition), transform .1s ease;
  cursor: pointer;
  position: relative;
}
.header-icon-btn:active { transform: scale(0.88); background: rgba(255,255,255,0.22); }
.header-icon-btn:hover { background: rgba(255,255,255,0.22); }
.header-icon-btn.is-enabled { background: rgba(34,197,94,0.18); border-color: rgba(34,197,94,0.35); }
.header-icon-btn.is-open { background: rgba(255,122,0,0.20); border-color: rgba(255,122,0,0.45); }
.header-icon-btn .badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--orange);
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--navy);
}
/* نقطة "إشعار جديد ماشفتيهش" — أحمر، صغيرة، بلا نص (بدّلات علامة الصح القديمة) */
.header-icon-btn .tr-notif-unread-dot {
  width: 12px; height: 12px;
  background: #EF4444;
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}

/* Search Bar — عائم فوق الصفحة (fixed)، ماكيدفعش المحتوى لتحت.
   كيتعمد على #tr-search-overlay باش يعتم الخلفية، بحال #tr-search-results بالضبط. */
#tr-search-bar {
  position: fixed;
  left: 0; right: 0;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  z-index: 790;
  background: transparent;
  padding: 10px var(--sp-md);
  display: none;
}
#tr-search-bar.open { display: block; }
/* Overlay خاص بالبحث — كيمسك الضغطة قبل ما توصل لعناصر الصفحة تحتو */
#tr-search-overlay {
  position: fixed; inset: 0; z-index: 785;
  background: rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
#tr-search-overlay.open { opacity: 1; pointer-events: all; }
/* Dropdown عائم — position:absolute باش مايأثرش على ارتفاع #tr-search-bar
   ولا يدفع محتوى الصفحة لتحت. الحجم ديالو دايما بحسب محتواه فقط. */
#tr-search-results {
  position: absolute;
  left: calc(var(--sp-md) + 10px);
  right: calc(var(--sp-md) + 10px);
  top: 100%;
  margin-top: 4px;
  background: #161d33; /* نفس اللون الأصلي: navy-dark + 8% أبيض، لكن opaque دابا لأنه عائم فوق الصفحة */
  border-radius: 12px;
  padding: 4px 0;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  line-height: 1.3;
}
.tr-search-suggestion { line-height: 1.3; }
.tr-search-suggestion:hover,
.tr-search-suggestion:focus-visible { background: rgba(255,255,255,0.06) !important; color: #fff !important; }
/* نتائج البحث الحي — hover/focus كانت ناقصة، الصفوف كانت بلا أي إشارة بصرية للتفاعل */
.tr-search-result-row:hover,
.tr-search-result-row:focus-visible { background: rgba(255,255,255,0.05); }
/* tr-spin معرّفة أصلا فالأسفل (.filter-spinner) — نفس الحركة كتخدم للـsearch spinner */
.search-input-wrap {
  display: flex;
  align-items: center;
  background: #161d33; /* opaque، نفس لون #tr-search-results — كانت شفافة (rgba(255,255,255,0.10)) وكان النص ديال البانر لي تحتها كيبين ويتضارب مع placeholder البحث */
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r-full);
  padding: 0 14px;
  transition: border-color var(--transition);
}
.search-input-wrap:focus-within { border-color: var(--orange); }
.search-input-wrap input {
  flex: 1; border: none; background: transparent;
  padding: 10px 10px 10px 0;
  font-size: 16px; font-family: var(--font); /* 16px يمنع الزوم التلقائي ديال iOS عند التركيز */
  color: var(--white); outline: none;
}
.search-input-wrap input::placeholder { color: rgba(255,255,255,0.5); }
.search-input-wrap svg { color: rgba(255,255,255,0.5); flex-shrink: 0; }

/* Filter button — دابا جوة شريط البحث، حجم أصغر باش يبان مزيان */
.search-input-wrap #filter-toggle {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  margin-inline-end: 4px;
}

/* Filter Drawer */
#filter-drawer {
  position: fixed;
  bottom: -100%; left: 0; right: 0;
  z-index: 1200;
  background: var(--white);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--sp-lg);
  padding-bottom: calc(var(--sp-lg) + env(safe-area-inset-bottom, 0px));
  transition: bottom 0.35s cubic-bezier(0.32,0.72,0,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
  max-height: 80vh;
  overflow-y: auto;
}
#filter-drawer.open { bottom: 0; }
#filter-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
#filter-overlay.open { opacity: 1; pointer-events: all; }
.drawer-handle {
  width: 40px; height: 4px; background: var(--grey-300);
  border-radius: var(--r-full); margin: 0 auto var(--sp-md);
}
.drawer-title { font-size: var(--fz-md); font-weight: 800; color: var(--navy); margin-bottom: var(--sp-md); }
.drawer-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-md); }
.drawer-title-row .drawer-title { margin-bottom: 0; }
.modal-close-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--grey-200);
  background: var(--grey-50); display: flex; align-items: center; justify-content: center;
  color: var(--grey-500); cursor: pointer; flex-shrink: 0; padding: 0;
}
.modal-close-btn:hover { background: var(--grey-100); color: var(--navy); }
.filter-group { margin-bottom: var(--sp-md); }
.filter-group-label { font-size: var(--fz-sm); font-weight: 700; color: var(--grey-500); margin-bottom: 8px; }

/* أيقونة الحي الموحدة (SVG pin) — كتاخد لون النص تلقائياً أينما استُعملت */
.tr-hood-pin {
  display: inline-block;
  vertical-align: -2px;
  flex-shrink: 0;
}
.filter-group-label .tr-hood-pin { width: 13px; height: 13px; vertical-align: -1px; }
.drawer-title .tr-drawer-title-icon { width: 17px; height: 17px; vertical-align: -3px; margin-inline-end: 2px; color: var(--orange); }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-pill {
  padding: 6px 14px;
  border-radius: var(--r-full);
  border: 2px solid var(--grey-200);
  background: var(--white);
  font-size: var(--fz-xs);
  font-weight: 700;
  color: var(--grey-700);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-pill:active { transform: scale(0.93); opacity: .8; }
.filter-pill:hover,
.filter-pill.active {
  border-color: var(--orange);
  background: var(--orange-light);
  color: var(--orange);
}

/* Filter Cascading Selects */
.filter-select-wrap {
  position: relative;
}
.filter-select-arrow {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  color: var(--grey-400);
  pointer-events: none;
  font-size: 18px;
  line-height: 1;
  font-weight: 300;
}
.filter-select {
  width: 100%;
  padding: 13px 16px 13px 40px;
  border: 2px solid var(--grey-200);
  border-radius: var(--r-md);
  background: var(--white);
  font-size: 16px; /* 16px يمنع الزوم التلقائي ديال iOS عند التركيز */
  font-weight: 600;
  color: var(--grey-700);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  direction: rtl;
  text-align: right;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  font-family: inherit;
}
.filter-select:focus { border-color: var(--orange); outline: none; box-shadow: 0 0 0 3px rgba(242,107,29,0.12); }
.filter-select.has-value { border-color: var(--orange); background: var(--orange-light); color: var(--orange); }
.filter-select.has-value + .filter-select-arrow { color: var(--orange); }
.filter-step-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--grey-400);
  font-size: var(--fz-xs);
  padding: 10px 4px;
}
.filter-spinner {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid var(--grey-200);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: tr-spin 0.65s linear infinite;
}
@keyframes tr-spin { to { transform: rotate(360deg); } }

/* ================================================================
   CITY MODAL
   ================================================================ */
#city-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
#city-modal.open { opacity: 1; pointer-events: all; }
#city-modal .modal-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.55);
}
.city-modal-inner {
  position: relative; z-index: 1;
  width: 100%; background: var(--white);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--sp-lg);
  padding-bottom: calc(var(--sp-lg) + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32,0.72,0,1);
}
#city-modal.open .city-modal-inner { transform: translateY(0); }
.city-list { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-sm); margin-top: var(--sp-md); }
.city-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-radius: var(--r-md);
  border: 2px solid var(--grey-200); background: var(--white);
  font-size: var(--fz-sm); font-weight: 700; color: var(--grey-700);
  cursor: pointer; transition: all var(--transition);
  font-family: var(--font);
}
.city-btn:hover,
.city-btn.active { border-color: var(--orange); background: var(--orange-light); color: var(--orange); }
.city-btn .city-flag { font-size: 20px; }

/* ================================================================
   PAGE WRAP
   ================================================================ */
#page-wrap {
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 10px) + 8px);
  min-height: 100vh;
}

/* ================================================================
   HERO / BANNER
   ================================================================ */
.tr-hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-light) 60%, #1E3A6E 100%);
  padding: 22px 0 22px;
  position: relative;
  overflow: hidden;
}
.tr-hero::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 10% 80%, rgba(242,107,29,0.15) 0%, transparent 55%),
              radial-gradient(circle at 90% 10%, rgba(255,255,255,0.04) 0%, transparent 40%);
}
.hero-inner { position: relative; z-index: 1; }
.hero-tagline {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(242,107,29,0.18);
  border: 1px solid rgba(242,107,29,0.35);
  color: #FFB085;
  padding: 4px 14px; border-radius: var(--r-full);
  font-size: var(--fz-xs); font-weight: 700;
  margin-bottom: 12px;
}
.hero-title {
  font-size: clamp(22px, 6vw, 38px);
  font-weight: 900; color: var(--white); line-height: 1.2; margin-bottom: 8px;
}
.hero-title .hl { color: var(--orange); }
.hero-sub { font-size: var(--fz-sm); color: rgba(255,255,255,0.65); margin-bottom: 22px; }
.hero-stats {
  display: flex; gap: 20px; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-n { font-size: 22px; font-weight: 900; color: var(--white); }
.hero-stat-l { font-size: 10px; color: rgba(255,255,255,0.5); }

/* ================================================================
   HERO — دوائر التصنيفات الرئيسية (hero-main-cats)
   أبعاد ثابتة محجوزة مسبقاً لمنع Cumulative Layout Shift (CLS)
   أثناء تحميل الصور — الأرقام مطابقة لـ CHANGELOG-hero-cat-circles-fix
   ================================================================ */
.hero-main-cats-wrap {
  position: relative;
  z-index: 1;
  margin-top: 18px;
}
.hero-main-cats {
  display: flex;
  gap: var(--sp-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hero-main-cats::-webkit-scrollbar { display: none; }
.hero-cat-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  width: 82px;
  background: transparent;
  border: none;
  padding: 0;
  scroll-snap-align: start;
  transition: transform var(--transition);
}
@media (hover: hover) and (pointer: fine) {
  .hero-cat-circle:hover { transform: translateY(-3px); }
}
.hero-cat-circle-media {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.9);
  flex-shrink: 0;
}
.hero-cat-circle-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.hero-cat-circle-fallback {
  font-size: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hero-cat-circle-label {
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
  text-align: center;
  white-space: nowrap;
}
.hero-cat-circle.active .hero-cat-circle-media {
  border-color: var(--orange);
}
.hero-cat-circle.active .hero-cat-circle-label {
  color: var(--orange);
}
@media (max-width: 480px) {
  .hero-cat-circle { width: 68px; }
  .hero-cat-circle-media { width: 68px; height: 68px; }
  .hero-cat-circle-label { font-size: 11px; }
}

/* ================================================================
   SECTION HEADER
   ================================================================ */
.sec-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-md);
}
.sec-hd h2 {
  font-size: var(--fz-md); font-weight: 800; color: var(--navy);
  display: flex; align-items: center; gap: 8px;
}
.sec-hd h2::before {
  content: '';
  display: inline-block;
  width: 4px; height: 20px;
  background: var(--orange);
  border-radius: var(--r-full);
}
.sec-hd a { font-size: var(--fz-xs); font-weight: 700; color: var(--orange); }

/* ================================================================
   CATEGORIES — Circular Icons
   ================================================================ */
.categories-section { padding: 0; background: var(--white); border-bottom: 1px solid var(--grey-100); }
.categories-scroll {
  display: flex;
  gap: var(--sp-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px var(--sp-md) 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.categories-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex-shrink: 0; cursor: pointer; text-decoration: none;
  scroll-snap-align: start;
  transition: transform var(--transition);
}
@media (hover: hover) and (pointer: fine) {
  .cat-chip:hover { transform: translateY(-3px); }
  .cat-chip:hover .cat-circle { border-color: var(--orange); background: var(--orange-light); color: var(--orange); }
}
.cat-circle {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--grey-100);
  border: 2px solid var(--grey-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: var(--navy);
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}
.cat-chip.active .cat-circle {
  background: var(--orange-light);
  border-color: var(--orange);
  color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242,107,29,0.15);
}
.tr-cat-png-icon { display: block; object-fit: contain; }
.tr-all-cat-icon { display: block; }
.cat-label {
  font-size: 11px; font-weight: 700; color: var(--grey-700);
  text-align: center; white-space: nowrap;
}
.cat-chip.active .cat-label { color: var(--orange); }

/* ================================================================
   OFFERS GRID — 2 Column, 4:3 Cards
   ================================================================ */
.offers-section { padding: var(--sp-md); }
.offers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-sm);
}

/* ================================================================
   OFFER CARD
   ================================================================ */
.offer-card {
  background: var(--white);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--grey-100);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  display: flex; flex-direction: column;
}
.offer-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* 4:3 image */
.card-thumb {
  position: relative;
  padding-top: 75%; /* 4:3 */
  overflow: hidden;
  background: var(--grey-100);
  flex-shrink: 0;
}
.card-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.offer-card:hover .card-thumb img { transform: scale(1.06); }
.card-no-img {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px;
  background: linear-gradient(135deg, var(--grey-100), #e0e5f0);
}

/* Discount Badge — Top Right */
.card-discount {
  position: absolute;
  top: 10px; right: 10px; /* RTL: right = visual left in RTL layouts, but here right means right side visually */
  background: var(--orange);
  color: var(--white);
  font-size: 12px; font-weight: 900;
  padding: 4px 9px;
  border-radius: var(--r-sm);
  box-shadow: 0 2px 8px rgba(242,107,29,0.4);
  line-height: 1;
  z-index: 2;
}

/* Favorite — Top Left */
.card-fav {
  position: absolute;
  top: 10px; left: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  z-index: 2;
}
.card-fav:hover { transform: scale(1.12); }
.card-fav.active { background: #FEE2E2; }
.card-fav.active svg { color: #EF4444; fill: #EF4444; }

/* Offer Type Badge — Bottom Left */
.card-type-badge {
  position: absolute;
  bottom: 10px; left: 10px;
  font-size: 10px; font-weight: 900;
  padding: 2px 8px;
  border-radius: 20px;
  color: var(--white);
  z-index: 2;
  transition: bottom var(--transition);
}
.card-type-hot       { background: #EF4444; }
.card-type-new       { background: #16A34A; }
.card-type-exclusive { background: #7C3AED; }

/* Closed-now Badge — Bottom Right (يبان غير إذا المحل مغلق دابا) */
.card-closed-badge {
  position: absolute;
  bottom: 10px; right: 10px;
  max-width: calc(100% - 20px);
  display: flex; align-items: center; gap: 4px;
  background: rgba(44,44,42,0.85);
  color: var(--white);
  font-size: 10px; font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-full);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}
.card-closed-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #B4B2A9;
  flex-shrink: 0;
}

/* Card Body */
.card-body {
  padding: 10px 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
  flex: 1;
}
.card-name {
  font-size: 13px; font-weight: 800; color: var(--navy);
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px;
}
.card-rating {
  display: flex; align-items: center; gap: 2px;
  color: var(--orange); font-weight: 700;
}
.card-neighborhood {
  color: var(--grey-500); font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 80px;
}
.card-category-tag {
  font-size: 10px; font-weight: 700;
  color: var(--orange);
  background: var(--orange-light);
  padding: 2px 7px; border-radius: var(--r-full);
  display: inline-block;
}

/* ================================================================
   SINGLE RESTAURANT PAGE
   ================================================================ */

/* Gallery Slider */
.single-gallery {
  position: relative;
  overflow: hidden;
  background: var(--navy);
}
/* ── Gallery Carousel — CSS Scroll Snap (Native Mobile Swipe) ── */
.gallery-slides {
  display: flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
  scroll-behavior: smooth;
  aspect-ratio: 4 / 3;           /* نسبة موحدة تتكيف مع كل شاشة */
  width: 100%;
}
.gallery-slides::-webkit-scrollbar { display: none; } /* Chrome/Safari */
.gallery-slide {
  min-width: 100%;
  flex-shrink: 0;
  scroll-snap-align: start;
  height: 100%;
}
.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
.gallery-nav {
  position: absolute; bottom: var(--sp-sm);
  left: 50%; transform: translateX(-50%);
  display: flex; gap: 2px; z-index: 2;
  align-items: center;
}
.gallery-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none; cursor: pointer; transition: all var(--transition);
  padding: 10px;
  background-clip: content-box;
  flex-shrink: 0;
}
.gallery-dot.active {
  background: var(--white);
  background-clip: content-box;
  width: 20px;
  border-radius: 4px;
}
/* عداد الصور */
.gallery-counter {
  position: absolute;
  top: var(--sp-md);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 3;
  white-space: nowrap;
  pointer-events: none;
}
.gallery-back-btn {
  position: absolute; top: var(--sp-md); right: var(--sp-md);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  border: none; color: var(--white); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 3;
  transition: transform .1s ease, opacity .1s ease;
}
.gallery-back-btn:active { transform: scale(0.88); opacity: .75; }
.gallery-fav-btn {
  position: absolute; top: var(--sp-md); left: var(--sp-md);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  border: none; color: var(--white); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 3;
  transition: all var(--transition);
}
.gallery-fav-btn:active { transform: scale(0.85); }
.gallery-fav-btn.active { background: rgba(239,68,68,0.8); }

/* Badge الخصم على الصورة */
.gallery-discount-badge {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: var(--orange);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow-orange);
  line-height: 1;
  z-index: 2;
  pointer-events: none;
}

/* Single Info */
.single-body { padding: var(--sp-md); padding-bottom: calc(80px + var(--bottom-nav-h)); }

.single-header { margin-bottom: var(--sp-md); }
.single-title  { font-size: var(--fz-xl); font-weight: 900; color: var(--navy); margin-bottom: 6px; }
.single-meta {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; font-size: var(--fz-sm);
}
.single-rating {
  display: flex; align-items: center; gap: 4px;
  color: var(--orange); font-weight: 700;
}
.single-cat  { color: var(--grey-500); }
.single-hood { color: var(--grey-500); }

/* Open/closed status badge (يعتمد على tr_hours_open/tr_hours_close) */
.tr-status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
}
.tr-status-badge.is-open   { background: #EAF3DE; color: #3B6D11; }
.tr-status-badge.is-closed { background: #F1EFE8; color: #5F5E5A; }
.tr-status-dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
  background: currentColor;
}

/* Usage counter badge (trust signal بارز بدل نص رمادي خافت) */
.tr-usage-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--orange-light); color: #993C1D;
  font-size: 13px; font-weight: 700;
  padding: 6px 12px; border-radius: 20px;
}
.tr-usage-badge--first { background: var(--grey-100, #F3F4F6); color: var(--grey-700); }
.tr-usage-icon { font-style: normal; font-size: 14px; }

/* شريحة المسافة — مخبية بالـ [hidden] افتراضياً، الـ JS كيبينها غير إذا الإذن مفعّل مسبقاً */
.tr-distance-chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 700; color: var(--navy);
  background: var(--grey-100, #F3F4F6);
  padding: 3px 9px; border-radius: 20px;
}
.tr-distance-chip[hidden] { display: none; }

/* شريحة المسافة داخل كارد الشبكة (offer-card.php) — أصغر من نسخة الصفحة المفردة */
.card-distance-chip {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 700; color: var(--navy);
  background: var(--grey-100, #F3F4F6);
  padding: 1px 7px; border-radius: 20px;
}
.card-distance-chip[hidden] { display: none; }

/* Action Buttons */
.single-actions {
  display: flex; flex-wrap: wrap; gap: var(--sp-sm) 4px; margin-bottom: var(--sp-md);
  justify-content: space-between;
}
.action-btn {
  flex: 1 1 60px; min-width: 60px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 2px 2px 0; border-radius: var(--r-md);
  font-size: 11px; font-weight: 600; color: var(--grey-700);
  background: transparent; border: 0;
  cursor: pointer; transition: transform var(--transition); text-decoration: none;
}
.action-btn:active { transform: scale(0.96); }
.action-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--grey-100); color: var(--grey-600);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.action-btn svg { width: 20px; height: 20px; }
.action-btn.call .action-icon        { background: #E6F1FB; color: #185FA5; }
.action-btn.whatsapp .action-icon    { background: #E1F5EE; color: #0F6E56; }
.action-btn.website .action-icon     { background: #EEEDFE; color: #534AB7; }
.action-btn.instagram .action-icon   { background: #FBEAF0; color: #993556; }
.action-label { line-height: 1.2; }

.directions-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px; margin-bottom: var(--sp-md);
  border-radius: var(--r-md); border: 0;
  background: var(--orange-light); color: var(--orange);
  font-size: var(--fz-sm); font-weight: 700; text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: background var(--transition);
}
.directions-bar:active { background: #FCE4D6; }

/* Description */
.single-desc {
  background: var(--white); border-radius: var(--r-md);
  padding: var(--sp-md); margin-bottom: var(--sp-md);
  border: 1px solid var(--grey-100); font-size: var(--fz-sm);
  color: var(--grey-700); line-height: 1.8;
}
.section-card {
  background: var(--white); border-radius: var(--r-md);
  padding: var(--sp-md); margin-bottom: var(--sp-md);
  border: 1px solid var(--grey-100);
}
.section-card-title {
  font-size: var(--fz-sm); font-weight: 800; color: var(--navy);
  margin-bottom: var(--sp-sm); display: flex; align-items: center; gap: 6px;
}

/* Menu strip (منيو المنتجات — اختياري) */
.menu-strip-section {
  background: var(--white); border-radius: var(--r-md);
  padding: var(--sp-md); margin-bottom: var(--sp-md);
  border: 1px solid var(--grey-100);
}
.menu-strip-title {
  font-size: var(--fz-sm); font-weight: 800; color: var(--navy);
  margin-bottom: var(--sp-sm);
}
.menu-strip-scroll {
  display: flex; gap: var(--sp-sm); overflow-x: auto;
  padding-bottom: 4px; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.menu-strip-scroll::-webkit-scrollbar { display: none; }
.menu-strip-item {
  flex: 0 0 128px; background: var(--white);
  border: none; border-radius: var(--r-md);
  overflow: hidden; box-shadow: 0 2px 6px rgba(13,27,62,0.10);
}
.menu-strip-img {
  width: 100%; height: 84px; background: var(--grey-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.menu-strip-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.menu-strip-body { padding: var(--sp-sm); }
.menu-strip-name {
  font-size: var(--fz-xs); font-weight: 800; color: var(--navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.menu-strip-prices { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.menu-strip-price-old { font-size: var(--fz-xs); color: var(--clr-muted); text-decoration: line-through; }
.menu-strip-price-new { font-size: var(--fz-sm); font-weight: 800; color: var(--orange); }
.menu-strip-badge {
  display: inline-block; margin-top: 4px;
  background: var(--orange-light); color: var(--orange-dark);
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
}

/* Map */
.map-container {
  border-radius: var(--r-md); overflow: visible;
  margin-bottom: var(--sp-sm); position: relative;
  background: var(--grey-100);
}
.map-container iframe {
  display: block; width: 100%; height: 200px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  border: 0;
}
.map-container img { width: 100%; height: 200px; object-fit: cover; }
.map-overlay {
  position: absolute; inset: 0;
  background: rgba(13,27,62,0.2);
  display: flex; align-items: center; justify-content: center;
}
.btn-maps {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); color: var(--navy);
  padding: 10px 20px; border-radius: var(--r-full);
  font-weight: 700; font-size: var(--fz-sm);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transition: all var(--transition);
}
.btn-maps:hover { background: var(--navy); color: var(--white); }

/* Sticky Get Discount Button */
#sticky-get-discount {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 10px + env(safe-area-inset-bottom, 0px));
  left: var(--sp-md); right: var(--sp-md);
  z-index: 700;
  background: var(--orange);
  color: var(--white);
  border: none;
  padding: 16px 24px;
  border-radius: var(--r-xl);
  font-size: var(--fz-md); font-weight: 800;
  font-family: var(--font);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--shadow-orange);
  cursor: pointer;
  transition: all var(--transition);
  animation: pulse-orange 2.5s infinite;
}
#sticky-get-discount:hover {
  background: var(--orange-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(242,107,29,0.5);
}
#sticky-get-discount:active {
  transform: scale(0.96);
  box-shadow: 0 4px 16px rgba(242,107,29,0.4);
  animation: none;
}
@keyframes pulse-orange {
  0%,100% { box-shadow: 0 4px 20px rgba(242,107,29,0.35); }
  50%      { box-shadow: 0 4px 32px rgba(242,107,29,0.6); }
}

/* ================================================================
   DISCOUNT POPUP / MODAL
   ================================================================ */
#discount-modal {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
#discount-modal.open { opacity: 1; pointer-events: all; }
#discount-modal .modal-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.6);
}
.discount-modal-inner {
  position: relative; z-index: 1; width: 100%;
  background: var(--white);
  border-radius: 28px 28px 0 0;
  padding: var(--sp-lg);
  padding-bottom: calc(var(--sp-lg) + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32,0.72,0,1);
  text-align: center;
}
#discount-modal.open .discount-modal-inner { transform: translateY(0); }

.modal-handle {
  width: 40px; height: 4px; background: var(--grey-300);
  border-radius: var(--r-full); margin: 0 auto 20px;
}
.modal-offer-logo {
  width: 72px; height: 72px; border-radius: var(--r-lg);
  object-fit: cover; margin: 0 auto 12px;
  border: 3px solid var(--grey-100);
  box-shadow: var(--shadow-sm);
}
.modal-offer-name { font-size: var(--fz-md); font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.modal-discount-text { font-size: 13px; color: var(--grey-500); margin-bottom: 22px; }

/* Coupon Code Box */
.coupon-display {
  background: var(--orange-light);
  border: 2px dashed var(--orange);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  position: relative;
}
.coupon-label { font-size: 11px; font-weight: 700; color: var(--grey-500); margin-bottom: 6px; }
.coupon-code-text {
  font-size: 28px; font-weight: 900; color: var(--orange);
  letter-spacing: 4px; font-family: monospace;
  display: block; margin-bottom: 10px;
}
.btn-copy-code {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--white); color: var(--orange);
  border: 2px solid var(--orange);
  padding: 7px 18px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all var(--transition); font-family: var(--font);
}
.btn-copy-code:hover { background: var(--orange); color: var(--white); }
.btn-copy-code.copied { background: var(--orange); color: var(--white); }

/* Confirm Button */
.btn-confirm-usage {
  width: 100%;
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 16px;
  border-radius: var(--r-xl);
  font-size: var(--fz-base); font-weight: 800;
  font-family: var(--font);
  cursor: pointer; transition: all var(--transition);
  margin-top: 8px;
}
.btn-confirm-usage:hover { background: var(--navy-dark); }
.btn-confirm-usage.confirmed {
  background: #16A34A;
  pointer-events: none;
}
.usage-count {
  font-size: 11px; color: var(--grey-400); margin-top: 10px;
}

/* ================================================================
   BOTTOM NAVIGATION BAR
   ================================================================ */
#bottom-nav {
  position: fixed;
  left: 14px; right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  background: var(--navy);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(13,27,62,0.35);
  display: flex; align-items: center;
  height: 58px;
  padding: 0 6px;
  transform: scale(1);
  transform-origin: center bottom;
  transition: transform 0.22s ease;
}

.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 6px 4px;
  color: rgba(255,255,255,0.5); text-decoration: none;
  cursor: pointer; border: none; background: none;
  font-family: var(--font); transition: color var(--transition);
  position: relative;
}
.nav-item svg   { width: 21px; height: 21px; stroke: currentColor; transition: all var(--transition); }
.nav-item span  { font-size: 9.5px; font-weight: 700; }
.nav-item:hover { color: var(--orange); }
.nav-item.active { color: var(--orange); }
.nav-item.active svg { transform: scale(1.1); }

/* رد فعل بصري عند الضغط — إحساس تطبيق أصلي عند تلامس الشريط السفلي */
.nav-item {
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition), transform .1s ease, opacity .1s ease;
}
.nav-item:active {
  transform: scale(0.9);
  opacity: .7;
}

/* ================================================================
   LAYOUT — Content + Sidebar
   ================================================================ */
.layout-wrap { padding: var(--sp-md) 0; }
.layout-inner {
  display: grid; grid-template-columns: 1fr 300px; gap: var(--sp-lg); align-items: start;
}

/* ================================================================
   SIDEBAR & WIDGETS
   ================================================================ */
.sidebar .widget {
  background: var(--white); border-radius: var(--r-lg);
  padding: var(--sp-md); margin-bottom: var(--sp-md);
  border: 1px solid var(--grey-100); box-shadow: var(--shadow-xs);
}
.sidebar .widget-title {
  font-size: var(--fz-sm); font-weight: 800; color: var(--navy);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--orange);
}
.sidebar .widget ul li {
  padding: 7px 0; border-bottom: 1px solid var(--grey-100);
  font-size: var(--fz-sm);
}
.sidebar .widget ul li:last-child { border: none; }
.sidebar .widget ul li a {
  color: var(--grey-700); display: flex;
  justify-content: space-between; align-items: center;
}
.sidebar .widget ul li a:hover { color: var(--orange); }
.sidebar .widget ul li .count {
  background: var(--grey-100); padding: 1px 8px;
  border-radius: var(--r-full); font-size: 11px; font-weight: 700;
}

/* ================================================================
   PROFILE PAGE
   ================================================================ */
.profile-wrap { padding: var(--sp-md); }
.profile-hero {
  background: var(--navy);
  border-radius: var(--r-xl);
  padding: var(--sp-lg);
  text-align: center; margin-bottom: var(--sp-md);
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 3px solid rgba(255,255,255,0.2);
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: rgba(255,255,255,0.6);
}
.profile-name { font-size: var(--fz-md); font-weight: 800; color: var(--white); margin-bottom: 4px; }
.profile-sub  { font-size: var(--fz-sm); color: rgba(255,255,255,0.55); margin-bottom: var(--sp-md); }
.profile-auth-btns { display: flex; gap: var(--sp-sm); justify-content: center; }

.profile-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px var(--sp-md);
  background: var(--white); border-radius: var(--r-md);
  margin-bottom: 8px; border: 1px solid var(--grey-100);
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; color: var(--grey-900);
  font-size: var(--fz-sm); font-weight: 700;
}
.profile-menu-item:hover { border-color: var(--orange); background: var(--orange-light); color: var(--orange); }
.profile-menu-item:active { transform: scale(0.98); background: var(--orange-light); }
.profile-menu-item .menu-icon { width: 38px; height: 38px; border-radius: var(--r-sm); background: var(--grey-100); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.profile-menu-item .menu-arrow { margin-right: auto; color: var(--grey-400); }

/* ================================================================
   ARCHIVE / SEARCH
   ================================================================ */
.archive-header {
  background: var(--navy); color: var(--white);
  padding: var(--sp-lg) var(--sp-md);
  margin-bottom: var(--sp-md);
}
.archive-header h1 { font-size: var(--fz-xl); font-weight: 900; color: var(--white); }
.archive-header p  { color: rgba(255,255,255,0.65); font-size: var(--fz-sm); margin-top: 4px; }

.tax-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
  font-size: var(--fz-sm);
}
.tax-breadcrumb a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 700;
}
.tax-breadcrumb a:hover { text-decoration: underline; }
.tax-breadcrumb-sep { color: rgba(255,255,255,0.4); }
.tax-breadcrumb-current { color: rgba(255,255,255,0.65); }

.hood-pill-wrap { position: absolute; top: var(--sp-md); left: var(--sp-md); z-index: 5; }
.hood-pill {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--white);
  border-radius: var(--r-lg);
  padding: 6px 12px;
  font-size: var(--fz-sm); font-weight: 700;
  cursor: pointer;
}
.hood-pill:hover { background: rgba(255,255,255,0.2); }
.hood-pill-arrow { font-size: 11px; opacity: 0.8; transition: transform .15s ease; }
.hood-pill[aria-expanded="true"] .hood-pill-arrow { transform: rotate(180deg); }
.hood-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--white); color: var(--navy);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  min-width: 180px; max-height: 260px; overflow-y: auto;
  padding: 6px;
}
.hood-item {
  display: block; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--navy); font-size: var(--fz-sm); font-weight: 600;
  text-decoration: none;
}
.hood-item:hover { background: var(--grey-100); }
.hood-item.active { background: var(--orange-light); color: var(--orange); }

/* ================================================================
   PAGINATION
   ================================================================ */
.tr-pagi { display: flex; justify-content: center; gap: 6px; padding: var(--sp-lg) 0; }
.tr-pagi .page-numbers {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--grey-200);
  background: var(--white); font-size: 14px; font-weight: 700;
  color: var(--grey-700); text-decoration: none;
  transition: all var(--transition);
}
.tr-pagi .page-numbers:hover,
.tr-pagi .page-numbers.current { background: var(--orange); border-color: var(--orange); color: var(--white); }
.tr-pagi .page-numbers:active { transform: scale(0.88); }

/* ================================================================
   LOADING SKELETON
   ================================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--grey-200) 25%, var(--grey-100) 50%, var(--grey-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { 0%{background-position:200%} 100%{background-position:-200%} }
.skeleton-card { border-radius: var(--r-lg); overflow: hidden; }
.skeleton-thumb { padding-top: 75%; }
.skeleton-text  { height: 12px; margin: 8px; }

/* ================================================================
   BREADCRUMB
   Reste dans le HTML pour le SEO (schema.org BreadcrumbList),
   mais caché visuellement pour garder le look "app mobile"
   (évite la répétition avec le pill de catégorie affiché plus bas
   sur single-offer). Technique .sr-only : invisible à l'écran mais
   lisible par Google, contrairement à display:none.
   ================================================================ */
.tr-breadcrumb {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.tr-breadcrumb ul {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--grey-400);
}
.tr-breadcrumb li + li::before { content: '›'; }
.tr-breadcrumb a { color: var(--grey-500); }
.tr-breadcrumb a:hover { color: var(--orange); }
.tr-breadcrumb li:last-child { color: var(--navy); font-weight: 700; }

/* ================================================================
   TOAST NOTIFICATION
   ================================================================ */
.tr-toast {
  position: fixed; top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 10px); left: 50%; transform: translateX(-50%);
  z-index: 9999; background: var(--navy);
  color: var(--white); padding: 10px 20px;
  border-radius: var(--r-full); font-size: var(--fz-sm); font-weight: 700;
  box-shadow: var(--shadow-lg); pointer-events: none;
  opacity: 0; transition: opacity 0.3s ease;
  white-space: nowrap;
}
.tr-toast.show { opacity: 1; }

/* ================================================================
   FOOTER (minimal — bottom nav replaces it on mobile)
   ================================================================ */
#tr-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  display: none; /* Hidden on mobile, shown on desktop */
  padding: 0;
}
#tr-footer a { color: rgba(255,255,255,0.6); text-decoration: none; transition: color 0.2s; }
#tr-footer a:hover { color: var(--orange); }

/* Footer inner grid */
.tr-footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 36px;
}

/* Brand column */
.tr-footer-logo-text {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}
.tr-footer-tagline {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,0.55);
  margin: 0 0 16px;
  max-width: 280px;
}
.tr-footer-social {
  display: flex;
  gap: 8px;
}
.tr-social-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7) !important;
  transition: background 0.2s, color 0.2s !important;
}
.tr-social-btn:hover {
  background: var(--orange) !important;
  color: #fff !important;
}
.tr-social-btn:active { transform: scale(0.88); }
/* أزرار الدخول عبر Google/Facebook فدرج حسابي */
.tr-oauth-btn { transition: transform .1s ease, opacity .1s ease; }
.tr-oauth-btn:active { transform: scale(0.97); opacity: .85; }

/* Columns */
.tr-footer-col-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.tr-footer-links {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.tr-footer-links li { font-size: 13px; }

/* Contact icons */
.tr-footer-contact li {
  display: flex; align-items: center; gap: 8px;
}
.tr-footer-contact svg { flex-shrink: 0; opacity: 0.6; }

/* Bottom bar */
.tr-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 16px 32px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}
.tr-footer-bottom p { margin: 0; }
.tr-footer-bottom strong { color: rgba(255,255,255,0.7); }
.tr-footer-bottom-links {
  display: flex; gap: 12px; align-items: center;
}
.tr-footer-bottom-links span { opacity: 0.3; }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
  text-align: center; padding: 60px 20px;
  background: var(--white); border-radius: var(--r-lg);
  border: 1px solid var(--grey-100);
}
.empty-state .empty-icon { font-size: 56px; margin-bottom: 14px; }
.empty-state h3 { font-size: var(--fz-lg); font-weight: 800; margin-bottom: 8px; }
.empty-state p  { color: var(--grey-500); font-size: var(--fz-sm); margin-bottom: 20px; }

/* ================================================================
   DESKTOP RESPONSIVE
   ================================================================ */
@media (min-width: 769px) {

  #bottom-nav { display: none; }
  #tr-footer  { display: block; }
  #page-wrap  { padding-bottom: 0; }
  #sticky-get-discount { max-width: 600px; left: 50%; transform: translateX(-50%); right: auto; }

  .offers-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-md); }
  .categories-scroll { justify-content: flex-start; padding: 4px 0; }
  .city-list   { grid-template-columns: repeat(3, 1fr); }

  .single-gallery { /* aspect-ratio handles sizing */ }
  .gallery-slide img { /* aspect-ratio: 4/3 already set */ }

  .archive-header { border-radius: var(--r-xl); margin: var(--sp-md); }
}

@media (min-width: 1024px) {
  .offers-grid { grid-template-columns: repeat(4, 1fr); }
  .single-body { max-width: 680px; margin: 0 auto; }
}

/* ================================================================
   MOBILE SPECIFIC
   ================================================================ */
@media (max-width: 768px) {

  #page-wrap { margin-top: 0; }
  .layout-inner { grid-template-columns: 1fr; }
  .sidebar { display: none; } /* hidden on mobile */

  .single-actions { gap: 8px; }
  .action-btn { font-size: 11px; }

  .hero-stats { gap: 14px; }
}

@media (max-width: 380px) {
  .card-name { font-size: 12px; }
  .offers-grid { gap: 8px; }
  .cat-circle { width: 54px; height: 54px; font-size: 24px; }
  .tr-cat-png-icon { width: 28px; height: 28px; }
  .tr-all-cat-icon { width: 24px; height: 24px; }
}

/* هيدر الشاشات الضيقة: مسافات أضيق شوية بس، بلا ما نحيد أو نضيق أي
   عنصر آخر (الشعار والمدينة والأيقونات باقيين بحجمهم الطبيعي) */
@media (max-width: 400px) {
  .header-inner { gap: 6px; }
}

/* ================================================================
   REVIEW PANEL — لوحة التقييم داخل مودال الخصم
   ================================================================ */

/* إخفاء المحتوى الأصلي عند عرض التقييم */
.discount-modal-inner.tr-hidden-panel {
  display: none !important;
}

/* لوحة التقييم — نفس تصميم discount-modal-inner تماماً */
.tr-review-panel {
  display: none;
  position: relative;
  z-index: 1;
  width: 100%;
  background: var(--white);
  border-radius: 28px 28px 0 0;
  padding: var(--sp-lg);
  padding-bottom: calc(var(--sp-lg) + env(safe-area-inset-bottom, 0px));
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32,0.72,0,1);
}
.tr-review-panel.tr-review-panel--open {
  display: block;
  transform: translateY(0);
}

.tr-review-success-icon {
  font-size: 52px;
  margin-bottom: 10px;
  animation: tr-bounce 0.5s ease;
}
@keyframes tr-bounce {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.tr-review-title {
  font-size: var(--fz-lg);
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 6px;
}
.tr-review-subtitle {
  font-size: 13px;
  color: var(--grey-400);
  margin-bottom: 20px;
}

/* نجوم التقييم التفاعلية */
.tr-stars-input {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
  direction: ltr;
}
.tr-star-btn {
  background: none;
  border: none;
  font-size: 38px;
  color: #d1d5db;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease, transform 0.15s ease;
  font-family: inherit;
  -webkit-text-stroke: 1px #9ca3af;
}
.tr-star-btn.active {
  color: var(--orange);
  -webkit-text-stroke: 0;
  transform: scale(1.15);
}
.tr-star-btn:active { transform: scale(0.85); }
.tr-star-btn:hover {
  transform: scale(1.2);
}

.tr-stars-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--orange);
  height: 20px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

/* حقل التعليق */
.tr-review-textarea {
  width: 100%;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--navy);
  resize: none;
  outline: none;
  background: var(--grey-50);
  box-sizing: border-box;
  margin-bottom: 14px;
  transition: border-color 0.2s;
  direction: rtl;
}
.tr-review-textarea:focus {
  border-color: var(--orange);
  background: var(--white);
}
.tr-review-textarea::placeholder {
  color: var(--grey-400);
}

.tr-review-submit {
  width: 100%;
  background: var(--grey-200);
  color: var(--grey-400);
  border: none;
  padding: 15px;
  border-radius: var(--r-xl);
  font-size: var(--fz-base);
  font-weight: 800;
  font-family: var(--font);
  cursor: not-allowed;
  transition: all var(--transition);
  margin-bottom: 10px;
}
.tr-review-submit:not(:disabled) {
  background: var(--orange);
  color: var(--white);
  cursor: pointer;
}
.tr-review-submit:not(:disabled):hover {
  background: var(--orange-dark, #d97706);
}
.tr-review-submit:disabled {
  background: var(--grey-200);
  color: var(--grey-400);
  cursor: not-allowed;
}

/* زر التخطي */
.tr-review-skip {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--grey-400);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  padding: 8px;
}

/* شاشة الشكر */
.tr-review-thankyou {
  padding: 40px var(--sp-md);
  text-align: center;
}

/* ================================================================
   REVIEWS LIST — قائمة التقييمات في صفحة العرض
   ================================================================ */
.tr-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tr-review-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--grey-100);
}
.tr-review-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.tr-review-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.tr-review-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange-light);
  color: var(--orange);
  font-size: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tr-review-author {
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
}
.tr-review-meta {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
}
.tr-review-text {
  font-size: 13px;
  color: var(--grey-600, #4b5563);
  line-height: 1.6;
  margin: 0;
}

/* ================================================================
   FLASH DEAL — كارد الشريط
   ================================================================ */
.tr-flash-strip {
  margin-top: 7px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.3;
}
.tr-flash-live  { background: #DCFCE7; color: #166534; }
.tr-flash-soon  { background: #FEF9C3; color: #713F12; }
.tr-flash-off   { background: #F1F5F9; color: #475569; }

.tr-flash-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tr-flash-dot-live { background: #166534; } /* نفس لون نص .tr-flash-live بالضبط */
.tr-flash-dot-soon { background: #713F12; } /* نفس لون نص .tr-flash-soon بالضبط */
.tr-flash-dot-off  { background: #475569; } /* نفس لون نص .tr-flash-off بالضبط */

@keyframes tr-pulse { 0%,100%{opacity:1} 50%{opacity:.55} }
.tr-flash-dot-live  { animation: tr-pulse 1.8s ease-in-out infinite; }

/* ================================================================
   FLASH DEAL — بانر صفحة العرض
   ================================================================ */
.tr-flash-banner {
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: var(--sp-md, 16px);
  font-size: 13px;
  font-weight: 700;
}
.tr-flash-banner-live { background: #0F172A; color: #fff; }
.tr-flash-banner-soon { background: #FEF3C7; color: #78350F; }
.tr-flash-banner-off  { background: #F1F5F9; color: #475569; font-weight: 600; display: flex; align-items: center; gap: 8px; }

.tr-flash-banner-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.tr-flash-banner-dot-live { background: #22C55E; } /* أخضر ساطع على خلفية داكنة — إشارة "بث حي" */
.tr-flash-banner-dot-soon { background: #78350F; } /* نفس لون نص .tr-flash-banner-soon */
.tr-flash-banner-dot-off  { background: #475569; } /* نفس لون نص .tr-flash-banner-off */
.tr-flash-banner-dot-live { animation: tr-pulse 1.8s ease-in-out infinite; }

/* العداد التنازلي */
.tr-flash-countdown {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tr-cd-unit {
  text-align: center;
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 46px;
}
.tr-flash-banner-soon .tr-cd-unit {
  background: rgba(0,0,0,.07);
}
.tr-cd-num {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  display: block;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tr-flash-banner-soon .tr-cd-num { color: #78350F; }
.tr-cd-lbl {
  font-size: 10px;
  color: rgba(255,255,255,.5);
  display: block;
  margin-top: 2px;
}
.tr-flash-banner-soon .tr-cd-lbl { color: rgba(0,0,0,.4); }
.tr-cd-sep {
  font-size: 20px;
  color: rgba(255,255,255,.3);
  align-self: flex-start;
  padding-top: 5px;
  font-weight: 700;
}
.tr-flash-banner-soon .tr-cd-sep { color: rgba(0,0,0,.2); }

/* ============================================================
   GALLERY EXPAND BUTTON
   ============================================================ */
.gallery-expand-btn {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 20;
  background: rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background .2s;
}
.gallery-expand-btn:hover,
.gallery-expand-btn:active {
  background: rgba(0,0,0,.7);
}

/* ============================================================
   LIGHTBOX OVERLAY
   ============================================================ */
.tr-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}
.tr-lightbox.open {
  display: flex;
}

/* Slides container */
.tr-lb-slides {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tr-lb-slides::-webkit-scrollbar { display: none; }

.tr-lb-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.tr-lb-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

/* Close button */
.tr-lb-close {
  position: absolute;
  top: env(safe-area-inset-top, 12px);
  right: 14px;
  z-index: 10;
  background: rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  margin-top: 12px;
}

/* Counter */
.tr-lb-counter {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  background: rgba(0,0,0,.45);
  padding: 4px 14px;
  border-radius: 20px;
}

/* Prev / Next arrows (hidden on mobile, shown on tablet+) */
.tr-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  display: none;
}
.tr-lb-prev { left: 14px; }
.tr-lb-next { right: 14px; }

@media (min-width: 600px) {
  .tr-lb-nav { display: flex; align-items: center; justify-content: center; }
}

/* ================================================================
   MAP FAB BUTTON — زر قريب مني
   ================================================================ */
.nav-item-map {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--orange);
  font-size: 9.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font);
}
.nav-item-map.active,
.nav-item-map:hover { color: var(--orange); }
.nav-map-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
  transition: transform 0.12s ease;
}
.nav-map-fab svg { width: 21px; height: 21px; }
.nav-item-map:active .nav-map-fab {
  transform: scale(0.9);
}
