/* ==========================================================================
   1. FONTS & CSS VARIABLES
   ========================================================================== */
@font-face {
  font-family: "Doran";
  src:
    url("DoranFaNum-Bold.woff") format("woff"),
    url("DoranFaNum-Bold.woff2") format("woff2");
}

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

:root {
  --radius: 12px;
  --transition: all 0.3s ease;
  /* وضعیت لایت‌مود (پیش‌فرض) */
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-main: #333333;
  --text-muted: #777777;
  --border-color: rgba(128, 128, 128, 0.1);
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* متغیرهای دارک‌مود */
body.dark-mode {
  --bg-color: #121212;
  --card-bg: #1e1e1e;
  --text-main: #f5f5f5;
  --text-muted: #aaaaaa;
  --border-color: rgba(255, 255, 255, 0.08);
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   2. BASE & LAYOUT STRUCTURE
   ========================================================================== */
html,
body {
  height: 100%;
}

body {
  font-family: "Doran", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.3s,
    color 0.3s;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

.content {
  flex: 1 0 auto;
  width: 100%;
  max-width: 600px;
  margin: 30px auto;
  padding: 0 15px;
  min-height: 50vh;
  box-sizing: border-box;
}

.admin-footer,
.footer {
  flex-shrink: 0;
}

/* ==========================================================================
   3. DARK MODE TOGGLE BUTTON
   ========================================================================== */
.dark-mode-toggle {
  position: fixed;
  top: 15px;
  left: 15px;
  background-color: var(--card-bg);
  color: var(--text-main);
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  z-index: 100;
  transition: var(--transition);
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
}

/* ==========================================================================
   4. HEADER & CAFE BRANDING
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 99;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s;
}

.logo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  margin: 0 auto 10px;
  box-shadow: var(--shadow);
  border: 3px solid var(--card-bg);
  background-color: #eee;
}

.cafe-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary, #333);
  margin-bottom: 10px;
}

/* وضعیت باز/بسته */
.status {
  display: inline-flex;
  align-items: center;
  background: var(--card-bg);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.status-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: 8px;
}

.status-light.open {
  background-color: #10b981;
  animation: pulse 2s infinite;
}

.status-light.closed {
  background-color: #ef4444;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* ==========================================================================
   5. SEARCH BAR & SEARCH RESULTS
   ========================================================================== */
.search-box {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.search-box input {
  width: 100%;
  padding: 14px 45px 14px 20px;
  border: 2px solid transparent;
  border-radius: 50px;
  background: var(--bg-color);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.search-box input:focus {
  background: var(--card-bg);
  border-color: var(--primary, #064c8d);
  box-shadow: 0 0 0 4px rgba(6, 76, 141, 0.1);
}

.search-box i {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

#searchResults {
  display: none;
}

.search-no-result {
  grid-column: 1 / -1;
  width: 100%;
  text-align: center;
  padding: 35px 20px;
  color: #64748b;
  font-size: 1rem;
  font-weight: 500;
  background: #ffffff;
  border-radius: 14px;
  border: 1.5px dashed #cbd5e1;
  margin: 10px auto;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.dark-mode .search-no-result {
  background: #1e1e1e;
  border-color: #334155;
  color: #94a3b8;
}

/* ==========================================================================
   6. CATEGORIES & ACCORDIONS
   ========================================================================== */
.category {
  padding: 18px 20px;
  margin-bottom: 15px;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  box-shadow: var(--shadow);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.category:hover {
  background-color: var(--secondary, #0a6ebd) !important;
}

.category::after {
  content: "\f107";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.category.active::after {
  transform: rotate(180deg);
}

.category-content {
  display: block;
  text-align: right;
  flex: 1;
}

.category-desc {
  display: block;
  font-size: 0.82rem;
  font-weight: 400;
  opacity: 0.9;
  margin-top: 3px;
  line-height: 1.45;
  text-align: right;
}

/* دسته‌بندی دارای تصویر پس‌زمینه */
.category.has-bg-image {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  border: none;
  min-height: 120px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.category.has-bg-image:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.category-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.65) 55%, rgba(0, 0, 0, 0.88) 100%);
  z-index: 1;
  transition: background 0.3s ease;
  pointer-events: none;
}

.category.has-bg-image.active .category-overlay {
  background: linear-gradient(to left, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.78) 55%, rgba(0, 0, 0, 0.95) 100%);
}

.category.has-bg-image .category-content {
  position: relative;
  z-index: 2;
  color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.9);
  display: block;
  text-align: right;
  flex: 1;
  padding: 16px 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.4;
}

.category.has-bg-image .category-content i {
  color: #fbbf24 !important;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.7));
  margin-left: 8px;
  font-size: 1.1rem;
}

.category.has-bg-image .category-desc {
  display: block;
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  opacity: 1;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: right;
}

.category.has-bg-image::after {
  position: relative;
  z-index: 2;
  color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  font-size: 1.2rem;
  margin-right: 15px;
  flex-shrink: 0;
}

body.dark-mode .category.has-bg-image .category-overlay {
  background: linear-gradient(to left, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.75) 55%, rgba(15, 23, 42, 0.95) 100%);
}

/* بخش ویژه تخفیف‌ها */
.discount-header {
  background: linear-gradient(135deg, #ef4444, #f97316) !important;
  color: white;
}

.discount-header:hover {
  background: linear-gradient(135deg, #dc2626, #ea580c) !important;
}

.timer {
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.25);
  padding: 3px 10px;
  border-radius: 12px;
  margin-right: 8px;
  font-weight: 500;
}

.menu-item .category-badge-discount {
  color: #ef4444;
  font-size: 0.9rem;
}

/* ==========================================================================
   7. BASE MENU ITEMS & PRODUCT DETAILS (حالت عمومی)
   ========================================================================== */
.menu {
  display: none;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 10px;
  border-bottom: 1px dashed var(--border-color);
  transition: background-color 0.3s ease;
  color: var(--text-main);
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:hover {
  background-color: var(--bg-color);
  border-radius: 8px;
}

/* آیتم‌های ناموجود */
.menu-item.unavailable {
  position: relative;
  opacity: 0.65;
  pointer-events: none;
}

.menu-item.unavailable::after {
  content: "ناموجود";
  position: absolute;
  top: 25px;
  left: 10px;
  background-color: #f00;
  color: #ffffff;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgb(231, 77, 60);
  z-index: 10;
  letter-spacing: 0.5px;
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(231, 76, 60, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
  }
}

.item-details {
  flex: 1;
  padding-left: 15px;
}

.item-name {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.has-image {
  cursor: pointer;
  color: var(--primary, #064c8d);
  border-bottom: 1px dashed var(--primary, #064c8d);
}

.has-image::after {
  content: "\f03e";
  font-family: "Font Awesome 6 Free";
  font-weight: 400;
  font-size: 0.8rem;
  margin-right: 6px;
  color: var(--text-muted);
}

.item-description {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.item-price {
  text-align: left;
  font-weight: 800;
  white-space: nowrap;
}

.item-price::after {
  content: " تومان";
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.original-price {
  display: block;
  text-decoration: line-through;
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 400;
}

.original-price::after {
  display: none;
}

.discounted-price {
  color: #10b981;
  font-size: 1.1rem;
}

.menu-note {
  color: var(--primary, #064c8d);
  font-size: 1.05rem;
  padding: 2px 3px;
  margin: 5px;
}

/* ==========================================================================
   8. THEME VISUAL - GRID & IMAGE-BASED CARDS (اختصاصی قالب V2)
   ========================================================================== */
body.theme-visual .menu {
  display: none;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-bottom: 30px;
}

body.theme-visual .menu[style*="display: block"],
body.theme-visual #searchResults[style*="display: block"] {
  display: grid !important;
  /* گرید کاملاً ریسپانسیو: در موبایل حداقل ۲ ستون و در دسکتاپ به تناسب عرض */
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
  gap: 12px !important;
  animation: fadeIn 0.4s ease-out;
}

@media (min-width: 576px) {
  body.theme-visual .menu[style*="display: block"],
  body.theme-visual #searchResults[style*="display: block"] {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 16px !important;
  }
}

/* تبدیل آیتم‌ها به کارت‌های عمودی */
body.theme-visual .menu-item {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: stretch !important;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  height: 100%;
}

body.theme-visual .menu-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  background-color: var(--card-bg) !important;
}

/* استایل تصویر محصول در بالای کارت */
body.theme-visual .item-card-thumb {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: opacity 0.2s;
}

body.theme-visual .item-card-thumb:hover {
  opacity: 0.9;
}

/* پِلیس‌هولدر برای آیتم‌های بدون عکس */
body.theme-visual .item-card-thumb-placeholder {
  width: 100%;
  height: 130px;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
  opacity: 0.4;
  border-bottom: 1px solid var(--border-color);
}

/* کانتینر اطلاعات کارت */
body.theme-visual .item-details {
  padding: 12px !important;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

body.theme-visual .item-name {
  font-size: 0.95rem !important;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.4;
  border-bottom: none !important;
}

body.theme-visual .item-name::after {
  display: none !important;
}

/* توضیحات آیتم در قالب تصویری */
body.theme-visual .item-description {
  font-size: 0.8rem !important;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  body.theme-visual .item-description {
    display: block;
  }
}

/* نوار قیمت در پایین کارت */
body.theme-visual .item-price {
  background: var(--bg-color);
  padding: 10px 12px !important;
  text-align: center !important;
  border-top: 1px dashed var(--border-color);
  font-size: 0.95rem !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52px;
}

body.theme-visual .original-price {
  font-size: 0.75rem !important;
  margin-bottom: 2px;
}

body.theme-visual .discounted-price {
  font-size: 1rem !important;
}

/* برچسب ناموجود روی کارت تصویری */
body.theme-visual .menu-item.unavailable::after {
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* ==========================================================================
   9. BRANCH SELECTION & GEO-LOCATION (حالت انتخاب شعبه)
   ========================================================================== */
.branch-selection {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  box-sizing: border-box;
}

.branch-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  border: 1.5px solid #edf2f7;
  transition: all 0.25s ease;
  position: relative;
  box-sizing: border-box;
}

.branch-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.branch-card.nearest {
  border-color: var(--primary);
  box-shadow: 0 8px 25px rgba(6, 76, 141, 0.15);
}

.branch-card.nearest::before {
  content: "نزدیک‌ترین شعبه";
  position: absolute;
  top: -11px;
  left: 16px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.branch-card.closed {
  background: #fafafa;
}

.branch-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.branch-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.branch-name i {
  color: var(--primary);
  font-size: 1.05rem;
}

.branch-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.branch-status-badge.open {
  background: #ecfdf5;
  color: #065f46;
}

.branch-status-badge.closed {
  background: #fef2f2;
  color: #991b1b;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-dot.open {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-dot.closed {
  background: #ef4444;
}

.branch-details-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px dashed #f0f0f0;
  border-bottom: 1px dashed #f0f0f0;
  margin-bottom: 14px;
}

.branch-detail-item {
  font-size: 0.88rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
}

.branch-detail-item i {
  color: #888;
  font-size: 0.85rem;
  width: 14px;
  text-align: center;
}

.branch-detail-item a {
  color: #4a5568;
  text-decoration: none;
  font-weight: 500;
}

.branch-closed-reason {
  margin-bottom: 14px;
  padding: 8px 12px;
  background: #fff5f5;
  border-right: 3px solid #ef4444;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #991b1b;
  line-height: 1.5;
}

.branch-card a.select-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 11px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

.branch-card a.select-btn:hover {
  background: var(--secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.branch-card.closed a.select-btn {
  background: #64748b;
}

/* ژئولوکیشن و پیغام Toast */
.geo-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(30, 30, 30, 0.92);
  color: #fff;
  padding: 12px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: all 0.35s ease;
  max-width: 90%;
  white-space: nowrap;
  pointer-events: none;
}

.geo-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.geo-toast.success {
  background: rgba(10, 122, 62, 0.95);
}

.geo-toast.error {
  background: rgba(197, 48, 48, 0.95);
}

.geo-permission-box {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 24px;
  background: #fff;
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.geo-permission-box i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.geo-permission-box h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: #222;
}

.geo-permission-box p {
  margin: 0 0 16px;
  font-size: 0.92rem;
  color: #555;
  line-height: 1.6;
}

.geo-permission-box .btn-allow:hover {
  background: var(--secondary);
}

/* دارک‌مود کارت‌های شعب */
body.dark-mode .branch-card {
  background: #1e1e1e;
  border-color: #333;
  color: #eee;
}

body.dark-mode .branch-name {
  color: #fff;
}

body.dark-mode .branch-detail-item,
body.dark-mode .branch-detail-item a {
  color: #aaa;
}

body.dark-mode .branch-details-row {
  border-color: #2e2e2e;
}

body.dark-mode .branch-card.closed {
  background: #252525;
}

body.dark-mode .geo-permission-box {
  background: #1e1e1e;
  border-color: #333;
}

body.dark-mode .geo-permission-box h3 {
  color: #fff;
}

body.dark-mode .geo-permission-box p {
  color: #bbb;
}

body.dark-mode .geo-permission-box .btn-skip {
  border-color: #555;
  color: #aaa;
}

/* ==========================================================================
   10. CLOSED BRANCH NOTICE (پیام تعطیلی شعبه در منو)
   ========================================================================== */
.closed-branch-box {
  width: 100%;
  max-width: 500px;
  margin: 40px auto;
  padding: 30px 20px;
  text-align: center;
  background: #fff5f5;
  border-radius: 16px;
  border: 1px solid #feb2b2;
  box-sizing: border-box;
  flex-shrink: 0;
}

.closed-branch-box i {
  font-size: 2.5rem;
  color: #e53e3e;
  margin-bottom: 15px;
}

.closed-branch-box h2 {
  color: #c53030;
  margin-bottom: 12px;
}

.closed-branch-box p {
  color: #9b2c2c;
  line-height: 1.7;
  font-size: 1.05rem;
}

.back-to-branches {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.back-to-branches:hover {
  background: var(--secondary);
}

body.dark-mode .closed-branch-box {
  background: #3a1f1f;
  border-color: #fc8181;
}

body.dark-mode .closed-branch-box h2 {
  color: #feb2b2;
}

body.dark-mode .closed-branch-box p {
  color: #fbb6b6;
}

/* ==========================================================================
   11. FOOTERS
   ========================================================================== */
.footer {
  background-color: var(--card-bg, #ffffff);
  padding: 30px 20px 40px 20px;
  text-align: center;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.03);
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--border-color);
}

.footer-section {
  width: 100%;
  margin-bottom: 0;
}

.footer-section h3 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 15px;
}

.footer-section a {
  color: var(--primary, #064c8d);
  text-decoration: none;
  font-weight: bold;
  padding: 5px 10px;
  transition: var(--transition);
}

.footer-section p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-color);
  margin: 0 5px;
  color: var(--primary, #064c8d);
  font-size: 1.2rem;
  transition: var(--transition);
  text-decoration: none;
}

.social-links a i {
  font-size: 1.5rem;
}

.social-links a:hover {
  background: #e1306c;
  color: #fff;
  transform: translateY(-3px);
}

.phone-link {
  display: inline-flex !important;
  align-items: center;
  background-color: var(--primary, #064c8d);
  color: #ffffff !important;
  padding: 10px 25px !important;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}

.phone-link i {
  margin-left: 10px;
  font-size: 1.2rem;
}

.phone-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  opacity: 0.95;
}

.admin-footer {
  text-align: center;
  padding: 20px 20px;
  font-size: 0.9rem;
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  position: relative;
  width: 100%;
}

.admin-footer,
.admin-footer a {
  color: #fff !important;
  text-decoration: none;
  font-weight: bold;
}

.admin-footer a:hover {
  color: #fff200 !important;
}

/* ==========================================================================
   12. PHOTO PREVIEW MODAL
   ========================================================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  max-width: 95%;
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 10px;
  box-sizing: border-box;
}

.modal-content img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  border-radius: calc(var(--radius) - 5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close-modal-btn {
  position: absolute;
  top: -45px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.close-modal-btn:hover {
  transform: scale(1.1);
}

/* ریسپانسیو مودال */
@media (min-width: 769px) {
  .modal-content img {
    max-height: 85vh;
  }
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    padding: 8px;
  }
  .modal-content img {
    width: 100%;
    height: auto;
    max-height: 75vh;
  }
  .close-modal-btn {
    top: -40px;
    right: 0;
    font-size: 2rem;
  }
}
