:root {
  /* Food Gate Market — brand tokens */
  --fg-orange: #F47B20;
  --fg-orange-dark: #D96510;
  --fg-orange-light: #FEF3E8;
  --fg-peach: #F4A582;
  --fg-peach-muted: #FDEBD0;
  --fg-green: #22C55E;
  --fg-green-dark: #166534;
  --fg-green-light: #DCFCE7;
  --fg-black: #0D0D0F;
  --fg-surface: #161618;
  --fg-gray: #B8B8BC;
  --brand: var(--fg-orange);
  --brand-dark: var(--fg-orange-dark);
  --brand-light: var(--fg-peach-muted);
  --brand-gold: var(--fg-peach);
  --ink: #1d1d1f;
  --muted: #6b7280;
  --bg: #f5f6f8;
  --fg-gradient-primary: linear-gradient(135deg, var(--fg-orange) 0%, var(--fg-orange-dark) 100%);
  --fg-shadow-md: 0 8px 24px rgba(0,0,0,.06);
  --fg-radius-lg: 18px;
  --fg-radius-xl: 28px;
}

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

body {
  font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

/* ===== صفحات الدخول / الترحيب ===== */
.auth-page,
.landing-page {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fg-black);
  overflow: hidden;
  position: relative;
  font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
}
.auth-page::before,
.landing-page::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 15%, rgba(244,123,32,.22) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 85%, rgba(244,165,130,.12) 0%, transparent 50%);
}
.auth-page-main,
.landing-page-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  position: relative;
  z-index: 1;
  min-height: 0;
  overflow-y: auto;
}
.auth-card-wrap,
.landing-card-wrap {
  width: 100%;
  max-width: 420px;
}
.landing-card-wrap {
  max-width: 460px;
}
.auth-card,
.landing-card {
  border: none;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  background: #fff;
}
.auth-card .card-body {
  padding: 2rem 1.75rem;
}
.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-title {
  color: var(--brand);
  font-weight: 800;
  font-size: 1.05rem;
  margin-top: .75rem;
}
.auth-subtitle {
  color: var(--muted);
  font-size: .82rem;
  margin-top: .15rem;
}
.auth-card .form-label {
  font-size: .88rem;
  margin-bottom: .35rem;
}
.auth-card .input-group-text {
  background: #f8f9fa;
  border-color: #dee2e6;
}
.auth-card .form-control {
  border-color: #dee2e6;
  padding: .6rem .75rem;
}
.auth-card .form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(244,123,32,.12);
}
.btn-login,
.landing-btn-primary {
  background: var(--brand);
  border: none;
  color: #fff;
  font-weight: 700;
  padding: .7rem 1rem;
  border-radius: 12px;
  transition: .15s;
}
.btn-login:hover,
.landing-btn-primary:hover {
  background: var(--brand-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(244,123,32,.35);
}
.landing-title {
  color: var(--brand);
  font-weight: 800;
  font-size: 1.15rem;
}
.landing-btn-secondary {
  border: 2px solid #e5e7eb;
  color: var(--ink);
  font-weight: 600;
  padding: .65rem 1rem;
  border-radius: 12px;
  transition: .15s;
  background: #fff;
}
.landing-btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}
.site-footer--dark-auth,
.site-footer--dark.site-footer--auth {
  background: var(--fg-black);
  border-top-color: rgba(255,255,255,.08);
  padding: 10px 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.site-footer--dark-auth .site-footer-inner,
.site-footer--dark.site-footer--auth .site-footer-inner {
  gap: 10px;
}
.site-footer--dark-auth .logo-box img,
.site-footer--dark.site-footer--auth .logo-box img {
  height: 26px;
}
.site-footer--dark-auth .site-footer-text strong,
.site-footer--dark.site-footer--auth .site-footer-text strong {
  color: var(--brand);
  font-size: .78rem;
}
.site-footer--dark-auth .site-footer-text span,
.site-footer--dark.site-footer--auth .site-footer-text span {
  color: var(--fg-gray);
  font-size: .68rem;
}

/* توافق قديم */
.auth-body {
  min-height: 100vh;
}
.auth-card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

/* ===== شاشة العرض الذكية (Smart Screen) ===== */
.screen-body {
  background: #0d0d0f;
  color: #fff;
  min-height: 100vh;
  overflow: hidden;
  margin: 0;
}
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 40px;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
  position: relative;
  z-index: 10;
}
.screen-header .brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.screen-header .logo-box img {
  height: 42px;
}
.screen-header .brand-separator {
  color: rgba(255,255,255,.35);
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}
.screen-header .branch-name {
  font-size: 1.05rem;
  font-weight: 600;
  opacity: .9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen-clock {
  font-size: 1.4rem;
  font-weight: 700;
  direction: ltr;
  font-family: 'Tajawal', sans-serif;
}
.slide-stage {
  position: relative;
  height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* كارت العرض الرئيسي */
.slide {
  position: absolute;
  inset: 40px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  background: #17171b;
  border-radius: 28px;
  padding: 40px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.05);
}

.slide.active {
  display: flex;
  animation: fadeIn .6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(.98); }
  to   { opacity: 1; transform: scale(1); }
}

/* ===== حاوية الصورة وضبط الأبعاد ===== */
.slide-image-container {
  flex: 0 0 45%;
  height: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== الحل النهائي: البوردر يلتصق تماماً بأطراف الصورة الحقيقية بدون أي تمدد أو فراغات ===== */
.slide-img-element {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* حماية كاملة من التمطيط والتمدد */
  border: 5px solid var(--brand); /* البوردر ملتصق بالصورة مباشرة */
  border-radius: 20px;
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: block !important;
}

.slide-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.slide-badge {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  font-family: 'Tajawal', sans-serif;
  align-self: flex-start;
}
.slide-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 15px;
  line-height: 1.2;
  font-family: 'Tajawal', sans-serif;
}
.slide-desc {
  font-size: 1.3rem;
  color: #c9c9cc;
  margin-bottom: 30px;
}
.slide-prices {
  display: flex;
  align-items: baseline;
  gap: 20px;
}
.price-old {
  font-size: 1.8rem;
  color: #9a9a9e;
  text-decoration: line-through;
}
.price-new {
  font-size: 3.2rem;
  font-weight: 900;
  color: #4ade80;
}
.discount-tag {
  background: #4ade80;
  color: #08300f;
  font-weight: 900;
  font-size: 1.3rem;
  padding: 6px 16px;
  border-radius: 10px;
  font-family: 'Tajawal', sans-serif;
}
.slide-progress {
  position: fixed;
  bottom: 0; right: 0; left: 0;
  height: 6px;
  background: rgba(255,255,255,.08);
  z-index: 20;
}
.slide-progress-bar {
  height: 100%;
  background: var(--brand);
  width: 0%;
  transition: width .1s linear;
}
.slide-progress-info {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  padding: 8px 20px;
  border-radius: 999px;
  font-size: .9rem;
  color: #e5e5e7;
  z-index: 21;
  border: 1px solid rgba(255,255,255,.08);
  font-family: 'Tajawal', sans-serif;
}
.slide-progress-info i { color: var(--brand); }
.slide-progress-info .slide-counter { font-weight: 700; color: #fff; }
.slide-progress-info .slide-timer { direction: ltr; font-weight: 800; color: var(--brand); min-width: 1.5em; text-align: center; }

/* فترة العرض وعداد الانتهاء */
.slide-period {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: #a1a1a6;
  margin-bottom: 20px;
  font-family: 'Tajawal', sans-serif;
}
.slide-period i { color: var(--brand); font-size: 1.1rem; }
.slide-period-dates { direction: ltr; font-weight: 600; color: #d4d4d8; }

.slide-countdown-wrap {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.slide-countdown-label {
  font-size: .95rem;
  color: #a1a1a6;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Tajawal', sans-serif;
}
.slide-countdown-label i { color: #fbbf24; }
.slide-countdown {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.countdown-unit {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 72px;
  text-align: center;
}
.countdown-unit .countdown-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  direction: ltr;
  line-height: 1.1;
  font-family: 'Tajawal', sans-serif;
}
.countdown-unit.countdown-urgent .countdown-num { color: #fbbf24; }
.countdown-unit .countdown-lbl {
  display: block;
  font-size: .72rem;
  color: #9a9a9e;
  margin-top: 4px;
  font-family: 'Tajawal', sans-serif;
}
.countdown-expired {
  display: inline-block;
  background: rgba(239,68,68,.2);
  color: #fca5a5;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
}
.screen-footer {
  position: fixed;
  bottom: 16px;
  left: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #cfcfd2;
  z-index: 10;
}
.screen-footer .logo-box img {
  height: 28px;
}
.qr-box {
  background: #fff;
  padding: 8px;
  border-radius: 12px;
}
.qr-box img { display: block; width: 90px; height: 90px; }
.empty-state {
  text-align: center;
  padding-top: 120px;
  color: #9a9a9e;
}

/* ===== صندوق اللوغو (مشترك في كل الموقع) ===== */
.logo-box {
  background: #fff;
  border: 2px solid rgba(255,255,255,.55);
  border-radius: 12px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  line-height: 0;
}
.logo-box img {
  height: 38px;
  width: auto;
  display: block;
}
.logo-box--lg { padding: 8px 14px; border-radius: 14px; }
.logo-box--lg img { height: 52px; }
.logo-box--sm img { height: 30px; }
.logo-box--on-light {
  border-color: rgba(244,123,32,.22);
  box-shadow: 0 2px 8px rgba(244,123,32,.1);
}
.logo-box--on-dark {
  border-color: rgba(255,255,255,.4);
}

/* ===== صفحة الزبون (موبايل) ===== */
.customer-body {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.customer-topbar {
  background: var(--fg-gradient-primary);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  flex-shrink: 0;
}
.customer-topbar-info { min-width: 0; flex: 1; }
.customer-topbar-info h1 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
  font-family: 'Tajawal', sans-serif;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.customer-topbar-info p {
  opacity: .85;
  margin: 2px 0 0;
  font-size: .78rem;
}

.customer-main {
  flex: 1;
  padding: 16px;
  padding-bottom: 32px;
  overflow-y: auto;
}

.offer-cards {
  display: grid;
  gap: 12px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.offer-card {
  background: #fff;
  border-radius: var(--fg-radius-lg);
  box-shadow: var(--fg-shadow-md);
  overflow: hidden;
  display: flex;
  align-items: stretch;
  transition: transform .15s ease, box-shadow .15s ease;
  border: 1px solid rgba(0,0,0,.04);
}
.offer-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,.1);
}
.offer-card:active { transform: scale(.99); }

.offer-card-img-wrap {
  width: 120px;
  min-width: 120px;
  flex-shrink: 0;
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.offer-card-img-wrap img {
  width: 100%;
  height: 100%;
  min-height: 120px;
  object-fit: cover;
  display: block;
}
.offer-card-img-wrap .offer-card-placeholder {
  font-size: 2rem;
  color: var(--brand);
  opacity: .35;
}

.offer-card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.offer-card-cat {
  font-size: .72rem;
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.offer-card-title {
  font-weight: 700;
  margin: 3px 0 8px;
  font-size: .95rem;
  font-family: 'Tajawal', sans-serif;
  line-height: 1.4;
  word-break: break-word;
}
.offer-card-prices {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.offer-card-old { font-size: .82rem; color: var(--muted); text-decoration: line-through; }
.offer-card-new {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--fg-green-dark);
  font-family: 'Tajawal', sans-serif;
}
.offer-card-badge {
  background: var(--fg-green-light);
  color: var(--fg-green-dark);
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.customer-empty {
  text-align: center;
  padding: 40px 24px;
  color: #9ca3af;
  background: #fff;
  border-radius: var(--fg-radius-lg);
  box-shadow: var(--fg-shadow-md);
}

.branch-pick-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,.05);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  border-inline-start: 4px solid transparent;
  border: 1px solid rgba(0,0,0,.04);
  display: block;
  text-decoration: none;
  color: inherit;
}
.branch-pick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--fg-shadow-md);
  border-inline-start-color: var(--brand);
  color: inherit;
}
.branch-pick-card .bi-chevron-left { color: var(--brand); }

/* موديل واتساب */
.whatsapp-modal {
  border: none;
  border-radius: 20px;
  overflow: hidden;
}
.whatsapp-modal-icon {
  width: 56px;
  height: 56px;
  background: #dcfce7;
  color: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto;
}
.btn-whatsapp {
  background: #25D366;
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 12px;
  border-radius: 12px;
  transition: .15s;
}
.btn-whatsapp:hover {
  background: #1da851;
  color: #fff;
}
.whatsapp-modal .form-check-input:checked {
  background-color: #25D366;
  border-color: #25D366;
}
.whatsapp-modal .form-control:focus {
  border-color: #25D366;
  box-shadow: 0 0 0 .2rem rgba(37,211,102,.15);
}

@media (min-width: 640px) {
  .offer-cards { grid-template-columns: repeat(2, 1fr); }
  .customer-topbar-info h1 { font-size: 1.15rem; }
  .offer-card-img-wrap { width: 130px; min-width: 130px; }
  .offer-card-img-wrap img { min-height: 130px; }
}

@media (min-width: 992px) {
  .customer-main { padding: 20px 24px 40px; }
}

.offer-cards--single {
  grid-template-columns: 1fr;
  max-width: 560px;
}

/* ===== فوتر موحّد ===== */
.site-footer {
  flex-shrink: 0;
  padding: 16px 20px;
  border-top: 1px solid #e8eaed;
  background: #fff;
}
.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 960px;
  margin: 0 auto;
}
.site-footer-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: start;
}
.site-footer-text strong {
  font-size: .88rem;
  font-weight: 800;
  color: var(--brand);
  font-family: 'Tajawal', sans-serif;
}
.site-footer-text span {
  font-size: .75rem;
  color: var(--muted);
}

.site-footer--dark {
  background: var(--fg-black);
  border-top-color: rgba(255,255,255,.08);
}
.site-footer--dark .site-footer-text strong { color: var(--brand); }
.site-footer--dark .site-footer-text span { color: var(--fg-gray); }

.site-footer--compact {
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #eceef1;
}

.site-footer--admin {
  background: #fafbfc;
  border-top: 1px solid #eceef1;
  margin-top: auto;
}

.site-footer--screen {
  position: fixed;
  bottom: 28px;
  right: 40px;
  left: auto;
  padding: 8px 14px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  z-index: 12;
}
.site-footer--screen .site-footer-inner { gap: 10px; }
.site-footer--screen .site-footer-text strong { color: #fff; font-size: .8rem; }
.site-footer--screen .site-footer-text span { color: rgba(255,255,255,.55); font-size: .68rem; }
.site-footer--screen .logo-box img { height: 26px; }

.auth-page .site-footer,
.landing-page .site-footer {
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .site-footer--screen {
    right: 16px;
    bottom: 24px;
    padding: 6px 10px;
  }
}

/* Skeleton loader */
.skeleton-card {
  background: #fff;
  border-radius: var(--fg-radius-lg);
  height: 110px;
  margin-bottom: 14px;
  overflow: hidden;
  display: flex;
}
.skeleton-img {
  width: 110px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
.skeleton-body { flex: 1; padding: 16px; }
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  margin-bottom: 10px;
}
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}