/* ===========================================================
   استایل سفارشی فروشگاه — بر پایه‌ی Bootstrap 5 RTL
   رنگ‌ها از متغیرهای پویای theme_settings تزریق می‌شوند.
   =========================================================== */

:root {
  --shop-radius: 12px;
  --shop-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
  --shop-shadow-hover: 0 12px 36px rgba(0, 0, 0, 0.12);
  --shop-transition: 0.22s ease;
  /* پالت ثابت برند قهوه (رنگ اصلی/فرعی از تنظیمات قالب می‌آید) */
  --coffee-ink: #1b100a;
  --coffee-espresso: #2a1810;
  --coffee-cream: #fbf6ee;
  --coffee-caramel: #c08a4e;
  --coffee-line: #e8dccb;
}

body {
  font-family:
    "Vazirmatn",
    -apple-system,
    "Segoe UI",
    sans-serif;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-size: 0.9rem;
}

/* ---- Header ---- */
.topbar-promo {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.header-main .logo-img {
  height: 38px;
  width: auto;
  /* سقف عرض لوگو تا نام فروشگاه همیشه جا داشته باشد و به‌خاطر text-truncate بریده نشود */
  max-width: 130px;
  object-fit: contain;
}
.shop-name {
  color: var(--bs-primary);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.search-form .form-control {
  border-radius: 999px 0 0 999px;
  border-left: 0;
}
.search-form .btn {
  border-radius: 0 999px 999px 0;
}
.site-header .navbar .nav-link {
  color: #333;
  font-weight: 500;
}
.site-header .navbar .nav-link.active,
.site-header .navbar .nav-link:hover {
  color: var(--bs-primary);
}

/* ---- Hero/Slider ---- */
.hero-slider .carousel-item {
  min-height: 380px;
  border-radius: var(--shop-radius);
  overflow: hidden;
  position: relative;
}
.hero-slider .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.hero-slider .carousel-caption {
  right: 8%;
  left: 8%;
  text-align: right;
  bottom: 25%;
}
.hero-slider .carousel-caption h2 {
  font-size: 2rem;
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.hero-slider .carousel-caption p {
  font-size: 1.1rem;
}
.hero-slider .carousel-control-prev,
.hero-slider .carousel-control-next {
  width: 5%;
}

/* ---- Product card ---- */
.product-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--shop-radius);
  overflow: hidden;
  transition: var(--shop-transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shop-shadow-hover);
  transform: translateY(-2px);
  border-color: var(--bs-primary);
}
.product-card .product-image {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f3e8da;
  overflow: hidden;
}
.product-card .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--shop-transition);
}
.product-card:hover .product-image img {
  transform: scale(1.06);
}
.product-card .product-badges {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.product-card .badge-discount {
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 6px;
}
.product-card .badge-new {
  background: #22c55e;
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 6px;
}
.product-card .product-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.product-card .product-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
a {
  text-decoration: none;
}
.product-card .product-title a {
  color: #1f2937;
}
.product-card .product-brand {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 8px;
}
.product-card .product-price-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.product-card .price-final {
  font-weight: 800;
  font-size: 1rem;
  color: var(--bs-primary);
}
.product-card .price-original {
  font-size: 0.8rem;
  text-decoration: line-through;
  color: #9ca3af;
}
.product-card .btn-add-to-cart {
  background: var(--bs-primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
}
.product-card .btn-add-to-cart:hover {
  filter: brightness(0.95);
}
.product-card .out-of-stock-tag {
  position: absolute;
  bottom: 8px;
  inset-inline-end: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
}

/* ---- Section heading ---- */
.section-heading {
  text-align: center;
  margin: 40px 0 25px;
}
.section-heading h2 {
  font-size: 1.5rem;
  font-weight: 800;
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}
.section-heading h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 50%;
  transform: translateX(50%);
  width: 50px;
  height: 3px;
  background: var(--bs-primary);
  border-radius: 2px;
}
.section-heading p {
  color: #6b7280;
  margin-top: 6px;
}

/* ---- Filters sidebar ---- */
.filter-widget {
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--shop-radius);
  padding: 16px;
  margin-bottom: 14px;
  max-height: 200px;
  overflow-y: scroll;
}
.filter-widget h6 {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 12px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}
.filter-widget .form-check {
  margin-bottom: 6px;
}
.filter-widget .form-check-label {
  font-size: 0.85rem;
  color: #4b5563;
  cursor: pointer;
}

/* ---- فیلترهای جمع‌شونده (details/summary) ---- */
.filter-widget.filter-acc {
  padding: 0;
  max-height: none;
  overflow: visible;
}
.filter-acc > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  user-select: none;
}
.filter-acc > summary::-webkit-details-marker { display: none; }
.filter-acc > summary::after {
  content: "⌄";
  font-size: 1rem;
  line-height: 1;
  color: #9ca3af;
  transition: transform 0.2s ease;
}
.filter-acc[open] > summary::after { transform: rotate(180deg); }
.filter-acc[open] > summary { border-bottom: 1px solid #eee; }
.filter-acc > summary:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: -2px;
}
.filter-acc-body {
  padding: 12px 16px 14px;
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 991.98px) {
  .filter-acc-body {
    max-height: none;
    overflow: visible;
  }
}

/* ---- Price range slider ---- */
.price-slider {
  position: relative;
  height: 38px;
  margin: 6px 0 2px;
  direction: rtl;
}
.price-slider-track {
  position: absolute;
  top: 17px;
  right: 0;
  left: 0;
  height: 4px;
  border-radius: 999px;
  background: #e5e7eb;
}
.price-slider-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  border-radius: 999px;
  background: var(--bs-primary);
}
.price-slider input[type="range"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 38px;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.price-slider input[type="range"]:focus {
  outline: none;
}
.price-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border: 0;
}
.price-slider input[type="range"]::-moz-range-track {
  height: 4px;
  background: transparent;
  border: 0;
}
.price-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid var(--bs-primary);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.price-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--bs-primary);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.price-range-min { z-index: 4; }
.price-range-max { z-index: 3; }
.price-slider-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 4px;
}
.price-slider-labels strong {
  color: #111827;
  font-weight: 600;
}

/* ---- Active filter badges ---- */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.active-filters-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #6b7280;
}
.active-filters-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #e0e7ff;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.78rem;
  line-height: 1.6;
  text-decoration: none;
}
.filter-badge:hover,
.filter-badge:focus {
  background: #e0e7ff;
  color: #1e1b4b;
}
.filter-badge-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(55, 48, 163, 0.12);
  font-size: 0.9rem;
  line-height: 1;
}
.filter-badge:hover .filter-badge-x {
  background: rgba(185, 28, 28, 0.14);
  color: #b91c1c;
}
.filter-clear-all {
  font-size: 0.78rem;
  color: #b91c1c;
  text-decoration: none;
  padding: 4px 6px;
}
.filter-clear-all:hover {
  text-decoration: underline;
  color: #7f1d1d;
}

/* ---- Mobile filter panel (drawer) ---- */
.shop-filter-head,
.shop-filter-actions,
.shop-filter-backdrop {
  display: none;
}

@media (max-width: 991.98px) {
  .shop-filter-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1065;
    width: min(88vw, 380px);
    max-width: 380px;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.18);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 0.24s ease, visibility 0.24s ease;
  }
  .shop-filter-panel.show {
    transform: translateX(0);
    visibility: visible;
  }
  .shop-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    padding: 12px 14px;
    background: #fff;
    border-bottom: 1px solid #eee;
  }
  .shop-filter-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  .shop-filter-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px 0;
  }
  .shop-filter-panel .filter-widget {
    max-height: none;
    overflow: visible;
  }
  .shop-filter-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #eee;
  }
  .shop-filter-actions .btn {
    flex: 1;
    min-height: 44px;
  }
  .shop-filter-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
  }
  .shop-filter-backdrop.show {
    opacity: 1;
    visibility: visible;
  }
  body.filter-open {
    overflow: hidden;
  }
}


/* ---- Pagination ---- */
.pagination .page-link {
  color: var(--bs-primary);
}
.pagination .page-item.active .page-link {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
}

/* ---- Product detail ---- */
.product-detail .gallery-main {
  aspect-ratio: 1 / 1;
  background: #f5f5f5;
  border-radius: var(--shop-radius);
  overflow: hidden;
}
.product-detail .gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-detail .gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.product-detail .gallery-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
}
.product-detail .gallery-thumb.active {
  border-color: var(--bs-primary);
}
.product-detail .gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-detail .product-title {
  font-size: 1.5rem;
  font-weight: 800;
}
.product-detail .product-price {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--bs-primary);
}
.product-detail .product-price .original {
  font-size: 1rem;
  text-decoration: line-through;
  color: #9ca3af;
  margin-inline-end: 8px;
}
.product-detail .qty-input {
  width: 80px;
}
.product-detail .attribute-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 0.9rem;
}

/* ---- Cart ---- */
.cart-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: 12px;
  align-items: center;
}
.cart-item .ci-img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
}
.cart-item .ci-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Order tracking ---- */
.order-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.order-status-pending {
  background: #fef3c7;
  color: #92400e;
}
.order-status-paid,
.order-status-processing {
  background: #dbeafe;
  color: #1e40af;
}
.order-status-packaged {
  background: #ede9fe;
  color: #5b21b6;
}
.order-status-shipped {
  background: #e0e7ff;
  color: #4338ca;
}
.order-status-delivered {
  background: #dcfce7;
  color: #166534;
}
.order-status-canceled,
.order-status-rejected {
  background: #fee2e2;
  color: #991b1b;
}

/* ---- Admin sidebar ---- */
.sidebar {
  min-height: calc(100vh - 50px);
  background: #fff;
  border-left: 1px solid #eee;
}
/* در دسکتاپ: سایدبار ارتفاعی به اندازهٔ صفحه دارد، اسکرولش مستقل از محتواست
   و با صفحه پایین/بالا نمی‌رود (sticky). */
@media (min-width: 768px) {
  .sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}
.sidebar-group {
  margin-bottom: 10px;
  padding-bottom: 4px;
}
.sidebar-group + .sidebar-group {
  border-top: 1px solid #f1f3f5;
  padding-top: 6px;
}
.sidebar-title {
  letter-spacing: 0.04em;
  font-size: 0.68rem;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}
.sidebar .nav-link,
.admin-nav-overlay .nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.sidebar .nav-link {
  color: #4b5563;
  border-radius: 9px;
  margin: 1px 8px;
  font-size: 0.85rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar .nav-link:hover {
  background: #f3f4f6;
  color: #111827;
}
.sidebar .nav-link.active,
.admin-nav-overlay .nav-link.active {
  background: var(--bs-primary);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.22);
}
.nav-ico {
  width: 1.1rem;
  text-align: center;
  font-size: 1rem;
  opacity: 0.9;
}
.nav-label {
  line-height: 1.6;
}
.admin-topbar .navbar-brand img {
  border-radius: 6px;
}

/* ---- Admin overlay menu (mobile) ---- */
.admin-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1060;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}
.admin-nav-backdrop.show {
  opacity: 1;
  visibility: visible;
}
.admin-nav-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1065;
  width: min(84vw, 320px);
  background: #fff;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.18);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px calc(24px + env(safe-area-inset-bottom));
  transform: translateX(105%);
  transition: transform 0.22s ease;
}
.admin-nav-overlay.show {
  transform: translateX(0);
}
.admin-nav-overlay .nav-link {
  color: #4b5563;
  border-radius: 8px;
  margin: 2px 8px;
  font-size: 0.88rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.admin-nav-overlay .nav-link.active {
  background: var(--bs-primary);
  color: #fff !important;
}
.admin-nav-overlay .mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--bs-primary);
  font-size: 1.02rem;
}

/* ---- Tables ---- */
.table > :not(caption) > * > * {
  padding: 10px 12px;
}
.table thead th {
  background: #f9fafb;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---- Bulk edit ---- */
.bulk-edit-table input.form-control-sm,
.bulk-edit-table select.form-select-sm {
  font-size: 0.8rem;
  padding: 4px 8px;
}

/* ---- Buttons ---- */
.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  filter: brightness(0.95);
}
.btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
}

/* ---- Alerts ---- */
.alert {
  font-size: 0.9rem;
}

/* ---- Footer ---- */
.site-footer {
  margin-top: 50px;
  background: var(--coffee-ink) !important;
  border-top: 3px solid var(--coffee-caramel);
}
.site-footer a:hover {
  color: #fff !important;
}

/* ---- Misc ---- */
.text-muted-2 {
  color: #9ca3af;
}
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: #9ca3af;
}
.empty-state .icon {
  font-size: 4rem;
  margin-bottom: 12px;
}

/* ---- Toast / quick notifications ---- */
.toast-container {
  position: fixed;
  top: 80px;
  z-index: 1080;
  width: 100%;
  pointer-events: none;
}

/* ---- Back to top ---- */
.back-to-top {
  position: fixed;
  inset-inline-end: 14px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--bs-primary);
  color: #fff;
  font-size: 1.2rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  z-index: 1040;
}
.back-to-top.show {
  display: flex;
}

/* ---- Rich content (توضیحات محصول) ---- */
.product-description {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.product-description img,
.product-description table {
  max-width: 100%;
}
.product-description table {
  display: block;
  overflow-x: auto;
}

/* ===========================================================
   موبایل‌فرست — بهینه‌سازی سایت برای صفحه‌نمایش کوچک
   =========================================================== */
body {
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.06);
}

@media (min-width: 992px) {
  .nav-overlay,
  .nav-overlay-backdrop {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  /* ---- هدر جمع‌وجور ---- */
  .header-main .row {
    gap: 0.5rem;
  }
  .header-main .logo-img {
    height: 30px;
    /* لوگو باید کوچک‌تر شود تا نام فروشگاه (که عنصر مهم‌تری است) جا داشته باشد؛
       بدون این محدودیت، text-truncate نام را به عرض صفر می‌فشرد. */
    flex: 0 1 auto;
    min-width: 22px;
    max-width: 22vw;
    object-fit: contain;
  }
  .header-main .shop-brand {
    flex: 1 1 auto;
    min-width: 0;
  }
  .header-main .shop-name {
    font-size: 1.05rem;
    flex: 0 1 auto;
    min-width: 3.5em;
  }
  .topbar-promo {
    font-size: 0.72rem;
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
  }
  .search-form .form-control {
    height: 42px;
    font-size: 16px; /* جلوگیری از زوم خودکار iOS */
  }
  .search-form .btn {
    height: 42px;
    min-width: 46px;
  }

  /* ---- اهداف لمسی مناسب (حداقل ۴۴ پیکسل) ---- */
  .btn:not(.btn-sm):not(.btn-close) {
    min-height: 44px;
  }
  .form-control,
  .form-select {
    font-size: 16px; /* جلوگیری از زوم خودکار iOS */
  }
  .form-check-label {
    display: inline-block;
    padding-block: 7px;
    font-size: 0.92rem;
  }
  .form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0.15em;
  }
  .pagination .page-link {
    min-width: 40px;
    text-align: center;
  }

  /* ---- دکمهٔ همبرگری در ردیف اول کنار لوگو ---- */
  .site-header .header-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: var(--bs-primary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    order: -1;
  }
  .site-header .header-nav-toggle:active {
    background: #f3f4f6;
  }

  /* ---- منوی موبایل: اورلی تمام‌صفحه روی محتوا ---- */
  .nav-overlay-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
  }
  .nav-overlay-backdrop.show {
    opacity: 1;
    visibility: visible;
  }
  .nav-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1065;
    width: min(84vw, 340px);
    max-width: 100%;
    background: #fff;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.18);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 12px 14px calc(24px + env(safe-area-inset-bottom));
    transform: translateX(105%);
    transition: transform 0.22s ease;
  }
  .nav-overlay.show {
    transform: translateX(0);
  }
  body.nav-open {
    overflow: hidden;
  }
  .nav-overlay .nav-link {
    padding: 0.8rem 0.75rem;
    font-size: 0.98rem;
    color: #374151;
    border-radius: 10px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .nav-overlay .nav-link.active,
  .nav-overlay .nav-link:hover {
    background: #f3f4f6;
    color: var(--bs-primary);
  }
  .nav-overlay .mobile-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--bs-primary);
    font-size: 1.05rem;
  }
  .nav-overlay .mobile-nav-head .nav-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ---- منوهای کشویی از لبه‌ی صفحه بیرون نزنند ---- */
  .dropdown-menu {
    max-width: calc(100vw - 24px);
  }

  /* ---- جدول‌ها: اسکریپ افقی به‌جای شکستن صفحه ---- */
  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ---- فوتر ---- */
  .site-footer.pt-5 {
    padding-top: 2rem !important;
  }
  .site-footer {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  }
}

@media (max-width: 767.98px) {
  /* ---- کارت محصول ---- */
  .product-card .product-body {
    padding: 10px;
  }
  .product-card .product-title {
    font-size: 0.82rem;
    min-height: 2.4em;
  }
  .product-card .price-final {
    font-size: 0.92rem;
  }
  .product-card:hover {
    transform: none;
  }

  /* ---- هیرو/بنر ---- */
  .hero-slider .carousel-item {
    min-height: 240px;
  }
  .hero-slider .carousel-caption {
    bottom: 18%;
  }
  .hero-slider .carousel-caption h2 {
    font-size: 1.2rem;
  }

  /* ---- گالری محصول ---- */
  .product-detail .gallery-thumbs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }
  .product-detail .gallery-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
  }
  .product-detail .product-title {
    font-size: 1.2rem;
  }
  .product-detail .product-price {
    font-size: 1.2rem;
  }

  /* ---- سبد خرید ---- */
  .cart-item {
    grid-template-columns: 60px 1fr;
    grid-template-rows: auto auto auto;
  }
  .cart-item .ci-actions {
    grid-column: 1 / -1;
    text-align: left;
  }
  .cart-item form {
    grid-column: 1 / -1;
  }
  .cart-item form:nth-of-type(1) {
    justify-content: flex-start;
  }
  .cart-item form:nth-of-type(2) {
    display: flex;
    justify-content: flex-end;
  }

  /* ---- عنوان بخش‌ها ---- */
  .section-heading {
    margin: 28px 0 16px;
  }
  .section-heading h2 {
    font-size: 1.2rem;
  }
}

@media (max-width: 575.98px) {
  /* ---- هیرو/بنر کامپکت ---- */
  .hero-slider .carousel-item {
    min-height: 200px;
  }
  .hero-slider .carousel-caption {
    right: 5%;
    left: 5%;
    bottom: 10%;
    text-align: center;
  }
  .hero-slider .carousel-caption h2 {
    font-size: 1rem;
  }
  .hero-slider .carousel-caption p {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
  }
  .hero-slider .carousel-caption .btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
    margin-top: 0.5rem !important;
  }
  .hero-slider .carousel-control-prev,
  .hero-slider .carousel-control-next {
    width: 10%;
  }

  /* ---- کارت محصول کامپکت (۲ ستونه) ---- */
  .product-card .product-body {
    padding: 8px 10px 10px;
  }
  .product-card .product-title {
    font-size: 0.78rem;
    min-height: 2.3em;
  }
  .product-card .product-brand {
    font-size: 0.68rem;
    margin-bottom: 4px;
  }
  .product-card .price-final {
    font-size: 0.85rem;
  }
  .product-card .price-original {
    font-size: 0.7rem;
  }
  .product-card .btn-add-to-cart {
    padding: 8px 10px;
  }

  /* ---- عنوان بخش‌ها ---- */
  .section-heading {
    margin: 24px 0 14px;
  }
  .section-heading h2 {
    font-size: 1.1rem;
  }
  .section-heading p {
    font-size: 0.8rem;
  }

  /* ---- آیکون دسته‌بندی‌های صفحه اصلی ---- */
  .card .display-1 {
    font-size: 2.75rem;
  }

  /* ---- حالت خالی و صفحه‌بندی ---- */
  .empty-state {
    padding: 30px 12px;
  }
  .empty-state .icon {
    font-size: 3rem;
  }
  .pagination .page-link {
    min-width: 36px;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
  }

  /* ---- فاصله‌های عمومی ---- */
  main.py-4,
  main .container > .row {
    --bs-gutter-x: 0.75rem;
  }
}

/* ===========================================================
   صفحهٔ اصلی — چیدمان الهام‌گرفته از تمپلیت فروشگاهی موبایل
   (رنگ‌ها از متغیرهای theme پنل ادمین می‌آیند)
   =========================================================== */

/* ---- هیرو با بنر ---- */
.home-page .hero-slider .carousel-item {
  min-height: 460px;
}
.home-page .hero-slider .carousel-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(27, 16, 10, 0.12), rgba(27, 16, 10, 0.78));
  z-index: 1;
}
.hero-caption {
  position: absolute;
  top: 50%;
  right: 6%;
  width: min(520px, 88%);
  transform: translateY(-50%);
  color: #fff;
  text-align: right;
  z-index: 2;
}
.hero-caption h2 {
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(192, 138, 78, 0.24);
  border: 1px solid rgba(232, 201, 159, 0.55);
  color: #fbf6ee;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
  backdrop-filter: blur(6px);
}

/* ---- هیرو بدون بنر (محصول شاخص) ---- */
.hero-fallback {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 56px 0;
  background:
    radial-gradient(900px 420px at 12% 8%, rgba(232, 183, 122, 0.28), transparent 62%),
    linear-gradient(135deg, var(--bs-primary) 0%, #1b100a 100%);
}
.hero-fallback::before,
.hero-fallback::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}
.hero-fallback::before {
  width: 320px;
  height: 320px;
  left: -90px;
  top: -90px;
  background: rgba(255, 255, 255, 0.08);
}
.hero-fallback::after {
  width: 220px;
  height: 220px;
  left: 30%;
  bottom: -120px;
  background: rgba(255, 255, 255, 0.06);
}
.hero-title {
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}
.hero-desc {
  color: rgba(255, 255, 255, 0.85);
  max-width: 46ch;
  margin-bottom: 1rem;
}
.hero-price {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  color: #fff;
}
.hero-price-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}
.hero-price strong {
  font-size: 1.8rem;
  font-weight: 800;
}
.hero-price-unit {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}
.hero-product-wrap {
  position: relative;
  display: inline-block;
  padding: 26px;
}
.hero-product-wrap::before {
  content: "";
  position: absolute;
  inset: 8% 4%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  filter: blur(8px);
}
.hero-product-img {
  position: relative;
  max-height: 380px;
  max-width: 100%;
  width: auto;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  transform: rotate(-3deg);
}

/* ---- نوار مزایا ---- */
.feature-strip {
  background: var(--coffee-cream);
  border-bottom: 1px solid var(--coffee-line);
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  height: 100%;
  border-inline-end: 1px solid #f0f0f0;
}
.feature-strip .col-lg-3:last-child .feature-item {
  border-inline-end: 0;
}
.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(var(--bs-primary-rgb), 0.1);
  color: var(--bs-primary);
  font-size: 1.3rem;
  flex: none;
}
.feature-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1f2937;
}
.feature-sub {
  font-size: 0.72rem;
  color: #6b7280;
}

/* ---- چیپ‌های دسته‌بندی ---- */
.cat-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 22px 0 4px;
  scrollbar-width: none;
}
.cat-chips::-webkit-scrollbar {
  display: none;
}
.cat-chip {
  flex: none;
  padding: 0.5rem 0.95rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--shop-transition);
}
.cat-chip:hover,
.cat-chip.active {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

/* ---- عنوان بخش‌ها (سمت راست + مشاهده همه) ---- */
.home-section {
  margin: 46px 0;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.section-head h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
}
.section-head p {
  margin: 0.3rem 0 0;
  color: #6b7280;
  font-size: 0.85rem;
}
.section-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bs-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}
.section-link:hover {
  color: var(--bs-primary);
  text-decoration: underline;
}

/* ---- بنر میانی ---- */
.promo-banner {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--shop-radius) + 6px);
  margin: 46px 0;
  min-height: 240px;
  display: flex;
  align-items: center;
  background: var(--coffee-espresso);
}
.promo-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.promo-with-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(27, 16, 10, 0.05), rgba(27, 16, 10, 0.74));
  z-index: 1;
}
.promo-gradient {
  background:
    radial-gradient(700px 300px at 15% 20%, rgba(232, 183, 122, 0.26), transparent 60%),
    linear-gradient(120deg, var(--bs-primary) 0%, #1b100a 100%);
  color: #fff;
}
.promo-content {
  position: relative;
  z-index: 2;
  padding: 32px;
  max-width: 560px;
  color: #fff;
}
.promo-content h2 {
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 800;
  margin: 0 0 0.5rem;
}
.promo-content p {
  color: rgba(255, 255, 255, 0.82);
}

/* ---- برندها ---- */
.brand-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}
.brand-tile {
  flex: 0 0 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--shop-radius);
  color: #374151;
  text-decoration: none;
  transition: var(--shop-transition);
}
.brand-tile:hover {
  border-color: var(--bs-primary);
  box-shadow: var(--shop-shadow-hover);
  color: #111827;
}
.brand-tile img {
  height: 38px;
  width: auto;
  max-width: 84px;
  object-fit: contain;
}
.brand-initial {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(var(--bs-primary-rgb), 0.12);
  color: var(--bs-primary);
  font-weight: 800;
}
.brand-name {
  font-size: 0.75rem;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- خبرنامه ---- */
.newsletter-strip {
  background:
    radial-gradient(600px 260px at 88% 15%, rgba(192, 138, 78, 0.35), transparent 65%),
    var(--coffee-ink);
  color: #fff;
  border-radius: calc(var(--shop-radius) + 6px);
  border: 1px solid rgba(232, 201, 159, 0.22);
  padding: 34px 28px;
  margin: 56px 0 40px;
}
.newsletter-strip h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.newsletter-strip p {
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
  font-size: 0.9rem;
}
.newsletter-form .form-control {
  min-height: 46px;
  border-radius: 10px;
}
.newsletter-form .btn {
  border-radius: 10px;
  padding-inline: 1.2rem;
  white-space: nowrap;
}
.newsletter-form small {
  color: rgba(255, 255, 255, 0.55) !important;
}

/* ---- کارت محصول: دکمهٔ تمام‌عرض و نشان پرفروش ---- */
.product-card .product-price-row {
  margin-bottom: 2px;
}
.product-card .stock-dot {
  color: #16a34a;
  font-size: 0.95rem;
}
.product-card .badge-bestseller {
  background: #f59e0b;
  color: #111827;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
}
.product-card .product-actions {
  margin-top: 10px;
}
.product-card .btn-add-to-cart {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  font-size: 0.8rem;
  border-radius: 10px;
}

/* ---- کد هدیه ---- */
.gift-code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--coffee-ink);
  color: #fff;
  letter-spacing: 2px;
  font-size: 1.15rem;
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  user-select: all;
}
.gift-code-text {
  background: rgba(var(--bs-primary-rgb), 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 1px;
}
.gift-code-input {
  letter-spacing: 2px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---- ریسپانسیو صفحهٔ اصلی ---- */
@media (max-width: 991.98px) {
  .feature-item {
    border-inline-end: 0;
    border-bottom: 1px solid #f3f4f6;
    padding: 14px 12px;
  }
}
@media (max-width: 767.98px) {
  .home-page .hero-slider .carousel-item {
    min-height: 320px;
  }
  .hero-caption {
    right: 5%;
    width: 90%;
  }
  .hero-caption h2 {
    font-size: 1.5rem;
  }
  .hero-fallback {
    padding: 36px 0;
  }
  .hero-product-img {
    max-height: 260px;
  }
  .promo-banner {
    min-height: 200px;
  }
  .promo-content {
    padding: 22px;
  }
  .promo-content h2 {
    font-size: 1.2rem;
  }
  .home-section {
    margin: 32px 0;
  }
  .section-head h2 {
    font-size: 1.1rem;
  }
  .newsletter-strip {
    padding: 24px 18px;
    margin: 40px 0 30px;
  }
}


/* ===========================================================
   لایهٔ هویت بصری «قهوه الیکو»
   رنگ‌های اصلی/فرعی از theme_settings (پنل ادمین) تزریق می‌شوند؛
   این بخش فقط بافت، کنتراست و اجزای اختصاصی کافه/رستری را اضافه می‌کند.
   =========================================================== */

body {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

.header-main {
  background: rgba(251, 246, 238, 0.92);
  backdrop-filter: blur(8px);
}
.site-header .navbar {
  background: #fff !important;
}
.site-header .navbar .nav-link {
  color: #4a3a2c;
  font-weight: 600;
}
.site-header .navbar .nav-link.active,
.site-header .navbar .nav-link:hover {
  color: var(--bs-primary);
}
.site-header .navbar .nav-link.active {
  box-shadow: inset 0 -2px 0 var(--coffee-caramel);
}

/* ---- نوار خدمات: رست، عمده، تجهیزات، آموزش ---- */
.coffee-services {
  position: relative;
  overflow: hidden;
  margin: 30px 0 6px;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--coffee-line);
  border-radius: calc(var(--shop-radius) + 8px);
  box-shadow: var(--shop-shadow);
}
.coffee-services::before {
  content: "";
  position: absolute;
  inset-inline-start: -70px;
  top: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 138, 78, 0.2), transparent 70%);
  pointer-events: none;
}
.coffee-services-head {
  position: relative;
  margin-bottom: 18px;
}
.coffee-services-head h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
  color: var(--bs-primary);
}
.coffee-services-head p {
  margin: 0.35rem 0 0;
  color: #7a6553;
  font-size: 0.85rem;
}
.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--coffee-line);
  border-radius: 14px;
  background: var(--coffee-cream);
  text-decoration: none;
  color: var(--bs-body-color);
  transition: var(--shop-transition);
}
.service-card:hover {
  transform: translateY(-3px);
  border-color: var(--coffee-caramel);
  box-shadow: var(--shop-shadow-hover);
  color: var(--bs-primary);
}
.service-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(192, 138, 78, 0.16);
  color: var(--coffee-caramel);
  font-size: 1.25rem;
}
.service-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--bs-primary);
}
.service-desc {
  font-size: 0.75rem;
  line-height: 1.7;
  color: #7a6553;
}

/* ---- تیتر بخش‌ها و دکمه‌ها با لحن گرم ---- */
.section-head h2 {
  color: var(--bs-primary);
  font-weight: 800;
}
.section-head p {
  color: #7a6553;
}
.btn {
  border-radius: 10px;
}
.btn-lg {
  border-radius: 12px;
}
.hero-caption .btn-light {
  color: var(--bs-primary);
  font-weight: 700;
  border: 0;
}

/* ---- کارت محصول: قاب گرم و نام برند/خاستگاه ---- */
.product-card {
  border-color: var(--coffee-line);
  background: #fff;
}
.product-card:hover {
  border-color: var(--coffee-caramel);
}
.product-card .product-brand {
  color: var(--coffee-caramel);
  font-weight: 700;
}
.price-final {
  color: var(--bs-primary);
}
.product-card .badge-new {
  background: var(--bs-accent, #7c8f63);
}

/* ---- بنر و فوتر ---- */
.promo-content .hero-eyebrow {
  margin-bottom: 0.6rem;
}
.site-footer h5,
.site-footer h6 {
  color: #f3e4c8;
}
.site-footer .text-light-emphasis {
  color: rgba(243, 228, 200, 0.72) !important;
}

@media (max-width: 767.98px) {
  .coffee-services {
    padding: 18px 14px;
  }
  .coffee-services-head h2 {
    font-size: 1.05rem;
  }
  .service-card {
    padding: 14px;
  }
  .service-desc {
    font-size: 0.7rem;
  }
}
