/* پالت برند tahrir */
:root {
  /* #026C68 — رنگ اصلی */
  --tahrir-brand: 2 108 104;
  /* #0B8D87 — hover / هایلایت */
  --tahrir-brand-hover: 11 141 135;
  /* #343B44 — ذغالی / ثانویه */
  --tahrir-charcoal: 52 59 68;
  /* #D9F3F1 — پس‌زمینه روشن آیکون‌ها */
  --tahrir-brand-subtle: 217 243 241;
  /* #FFFFFF */
  --tahrir-white: 255 255 255;
  /* aliases (مقادیر مستقیم برای سازگاری با rgb(... / alpha)) */
  --tahrir-brand-light: 11 141 135;
  --tahrir-brand-lighter: 11 141 135;
  --tahrir-brand-dark: 52 59 68;
  --tahrir-brand-ring: 11 141 135;
  --brand-800-dark: #343B44;
}

/* Bridge utilities copied from site theme — used in checkout & profile pages */

.max-w-md {
  max-width: 28rem;
}

.max-w-lg {
  max-width: 32rem;
}

.max-w-2xl {
  max-width: 42rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 0.5rem;
  background-color: rgb(var(--tahrir-brand));
  color: rgb(var(--tahrir-white));
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: rgb(var(--tahrir-brand-hover));
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-warning {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background-color: rgb(239 68 68);
  color: #fff;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-warning:hover {
  background-color: rgb(220 38 38);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background-color: rgb(var(--tahrir-charcoal) / 0.08);
  color: rgb(var(--tahrir-charcoal));
  font-weight: 500;
}

.dark .btn-secondary {
  background-color: rgb(var(--tahrir-charcoal));
  color: rgb(var(--tahrir-white));
}

.bg-muted {
  background-color: rgb(var(--tahrir-white));
}

.dark .bg-muted {
  background-color: rgb(var(--tahrir-charcoal));
}

.bg-background {
  background-color: rgb(249 250 251);
}

.dark .bg-background {
  background-color: rgb(26 30 36);
}

.text-primary {
  color: rgb(var(--tahrir-brand));
}

.text-primary\/80 {
  color: rgb(var(--tahrir-brand) / 0.8);
}

.text-primary\/90 {
  color: rgb(var(--tahrir-brand) / 0.9);
}

.hover\:text-primary\/80:hover {
  color: rgb(var(--tahrir-brand-hover));
}

.bg-primary {
  background-color: rgb(var(--tahrir-brand));
}

.bg-primary-btn {
  background-color: rgb(var(--tahrir-brand));
}

.border-primary-btn {
  border-color: rgb(var(--tahrir-brand));
}

.hover\:bg-primary-btn:hover {
  background-color: rgb(var(--tahrir-brand-hover));
}

.hover\:bg-primary-btn\/90:hover {
  background-color: rgb(var(--tahrir-brand-hover));
}

.bg-primary\/5 {
  background-color: rgb(var(--tahrir-brand-subtle) / 0.5);
}

.bg-primary\/10 {
  background-color: rgb(var(--tahrir-brand-subtle));
}

.bg-primary\/15 {
  background-color: rgb(var(--tahrir-brand-subtle));
}

.border-primary\/20 {
  border-color: rgb(var(--tahrir-brand) / 0.2);
}

.border-primary\/40 {
  border-color: rgb(var(--tahrir-brand) / 0.4);
}

.focus-within\:border-primary:focus-within {
  border-color: rgb(var(--tahrir-brand));
}

.hover\:bg-primary\/20:hover {
  background-color: rgb(var(--tahrir-brand-subtle));
}

.hover\:bg-primary\/90:hover {
  background-color: rgb(var(--tahrir-brand-hover));
}

.text-secondary,
.text-charcoal {
  color: rgb(var(--tahrir-charcoal));
}

.bg-charcoal,
.bg-secondary-brand {
  background-color: rgb(var(--tahrir-charcoal));
}

.bg-brand-subtle {
  background-color: rgb(var(--tahrir-brand-subtle));
}

.text-success {
  color: rgb(22 163 74);
}

.bg-success {
  background-color: rgb(22 163 74);
}

.bg-success\/10 {
  background-color: rgb(22 163 74 / 0.1);
}

.hover\:bg-success\/20:hover {
  background-color: rgb(22 163 74 / 0.2);
}

.text-warning {
  color: rgb(234 179 8);
}

.bg-warning {
  background-color: rgb(234 179 8);
}

.bg-warning\/10 {
  background-color: rgb(234 179 8 / 0.1);
}

.hover\:bg-warning\/20:hover {
  background-color: rgb(234 179 8 / 0.2);
}

.text-danger {
  color: rgb(239 68 68);
}

.bg-danger {
  background-color: rgb(239 68 68);
}

.text-info {
  color: rgb(14 165 233);
}

.bg-info {
  background-color: rgb(14 165 233);
}

.bg-secondary {
  background-color: rgb(229 231 235);
}

.text-text\/60 {
  color: rgb(107 114 128);
}

.text-text\/70 {
  color: rgb(75 85 99);
}

.text-text\/80 {
  color: rgb(75 85 99);
}

.text-text\/90 {
  color: rgb(55 65 81);
}

.text-text\/95 {
  color: rgb(31 41 55);
}

.dark .text-text\/60 {
  color: rgb(156 163 175);
}

.dark .text-text\/70,
.dark .text-text\/80 {
  color: rgb(209 213 219);
}

.dark .text-text\/90,
.dark .text-text\/95 {
  color: rgb(243 244 246);
}

.border-border {
  border-color: rgb(229 231 235);
}

.dark .border-border {
  border-color: rgb(55 65 81);
}

.hover\:bg-muted\/50:hover {
  background-color: rgb(243 244 246);
}

.dark .hover\:bg-muted\/50:hover {
  background-color: rgb(55 65 81 / 0.5);
}

.hover\:bg-background:hover {
  background-color: rgb(249 250 251);
}

.dark .hover\:bg-background:hover {
  background-color: rgb(17 24 39);
}

.divide-border > :not([hidden]) ~ :not([hidden]) {
  border-color: rgb(229 231 235);
}

.dark .divide-border > :not([hidden]) ~ :not([hidden]) {
  border-color: rgb(55 65 81);
}

/* فیلتر/مرتب‌سازی موبایل باید بالای overlay (z-20/30) باشند.
   در app.css مقدار z-index:20 روی .filter-modal/.sort-modal بعد از utilityهای Tailwind می‌آید و z-40 را خنثی می‌کند. */
.filter-modal,
.filter-modal.active,
.sort-modal,
.sort-modal.active {
  z-index: 40 !important;
}

/* مودال گالری محصول — کلاس قدیمی slider-modal با display:none تداخل داشت */
.product-gallery-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 42rem;
  max-height: 90vh;
  overflow: auto;
  border-radius: 0.5rem;
  background-color: rgb(255 255 255);
  padding: 1rem;
}

.dark .product-gallery-modal {
  background-color: rgb(17 24 39);
}

/* Product detail — mobile layout */
:root {
  --tahrir-mobile-nav-height: 4rem;
  --tahrir-mobile-nav-offset: 0.375rem;
}

/* فضای پایین = نوار خرید + منوی موبایل */
.product-detail-page {
  padding-bottom: calc(5rem + var(--tahrir-mobile-nav-height) + var(--tahrir-mobile-nav-offset));
}

@media (min-width: 1024px) {
  .product-detail-page {
    padding-bottom: 2.5rem;
  }
}

.product-detail-mobile-gallery {
  margin-inline: -1rem;
  width: calc(100% + 2rem);
}

.product-detail-mobile-gallery .swiper-pagination {
  position: static;
  margin-top: 0.75rem;
}

@media (min-width: 640px) {
  .product-detail-mobile-gallery {
    margin-inline: 0;
    width: 100%;
  }
}

.product-detail-mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tahrir-mobile-nav-height) + var(--tahrir-mobile-nav-offset));
  z-index: 24;
  border-radius: 0;
  border-top: 1px solid rgb(229 231 235);
  background-color: rgb(255 255 255);
  padding: 0.75rem 1rem;
  box-shadow: 0 -4px 16px rgb(0 0 0 / 0.08);
}

/* منوی پایین همیشه روی نوار خرید و محتوا دیده شود؛ آیتم‌ها هم‌عرض */
.bottom-navbar {
  z-index: 30;
  justify-content: stretch;
  gap: 0;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  overflow: visible;
}

.bottom-navbar > li {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  row-gap: 0.15rem;
  text-align: center;
  font-size: 0.7rem;
  line-height: 1.1;
  overflow: visible;
}

.bottom-navbar > li > a,
.bottom-navbar > li > svg + a,
.bottom-navbar > li a {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.bottom-navbar > li > a.flex {
  width: 100%;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* دکمه تماس بزرگ‌تر؛ اجازه بیرون‌زدن از بالای نوار */
.bottom-navbar > li.bottom-navbar-contact {
  position: relative;
  overflow: visible;
}

.bottom-navbar .bottom-navbar-contact-icon {
  width: 3rem;
  height: 3rem;
  margin: 0;
  margin-top: -1.25rem;
  border-radius: 9999px;
  background-color: #25d366;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgb(37 211 102 / 0.45);
}

.bottom-navbar .bottom-navbar-contact-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  color: #fff;
}

@media (min-width: 480px) {
  .bottom-navbar {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .bottom-navbar > li {
    font-size: 0.8rem;
  }

  .bottom-navbar .bottom-navbar-contact-icon {
    width: 3.25rem;
    height: 3.25rem;
    margin-top: -1.35rem;
  }

  .bottom-navbar .bottom-navbar-contact-icon svg {
    width: 1.5rem;
    height: 1.5rem;
  }
}

.dark .product-detail-mobile-bar {
  background-color: rgb(31 41 55);
  border-top-color: rgb(55 65 81);
}

@media (min-width: 1024px) {
  .product-detail-mobile-bar {
    display: none;
  }
}

.product-detail-trust-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(229 231 235);
  font-size: 0.75rem;
  line-height: 1.25rem;
  color: rgb(107 114 128);
}

.dark .product-detail-trust-badge {
  border-color: rgb(255 255 255 / 0.2);
  color: rgb(156 163 175);
}

.product-detail-trust-badge p {
  line-height: 1.3;
}

.product-detail-tabs {
  display: flex;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-block: 0.75rem;
}

.product-detail-tabs::-webkit-scrollbar {
  display: none;
}

.product-detail-tab-btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.25rem 0.5rem 0.75rem;
  font-size: 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.product-detail-tab-btn:not(:last-child) {
  margin-inline-end: 2rem;
}

@media (min-width: 768px) {
  .product-detail-tab-btn {
    padding-inline: 0.75rem;
  }

  .product-detail-tab-btn:not(:last-child) {
    margin-inline-end: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .product-detail-tab-btn:not(:last-child) {
    margin-inline-end: 3.5rem;
  }
}

.product-detail-tab-btn.is-active {
  color: rgb(var(--tahrir-brand));
  border-bottom-color: rgb(var(--tahrir-brand));
}

.peer:checked ~ .peer-checked\:border-blue-500 {
  border-color: rgb(var(--tahrir-brand));
}

/* Landing image — responsive visibility (Bootstrap d-none/d-md-block not in tahrir) */
.landing-desktop-only {
  display: none;
}

.landing-mobile-only {
  display: block;
}

@media (min-width: 768px) {
  .landing-desktop-only {
    display: block;
  }

  .landing-mobile-only {
    display: none;
  }
}

/* Preloader */
.tahrir-preloader {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.tahrir-preloader__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}

.dark .tahrir-preloader__backdrop {
  background: rgba(2, 6, 23, 0.72);
}

.tahrir-preloader__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(18rem, 88vw);
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.96);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.35);
}

.dark .tahrir-preloader__panel {
  background: rgb(31 41 55 / 0.96);
}

.tahrir-preloader__ring {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tahrir-preloader__ring-track,
.tahrir-preloader__ring-progress {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
}

.tahrir-preloader__ring-track {
  border: 3px solid rgb(var(--tahrir-brand-subtle));
}

.dark .tahrir-preloader__ring-track {
  border-color: rgb(55 65 81);
}

.tahrir-preloader__ring-progress {
  border: 3px solid transparent;
  border-top-color: rgb(var(--tahrir-brand));
  border-right-color: rgb(var(--tahrir-brand));
  animation: tahrir-preloader-spin 0.9s linear infinite;
}

.tahrir-preloader__logo {
  width: 3rem;
  height: auto;
  object-fit: contain;
  animation: tahrir-preloader-pulse 1.4s ease-in-out infinite;
}

/* لوگوی فرم‌های ورود / ثبت‌نام */
.auth-form-logo {
  display: block;
  height: 2.5rem !important;
  width: auto !important;
  max-width: 10rem;
  object-fit: contain;
}

.tahrir-preloader__label {
  font-size: 0.875rem;
  color: rgb(55 65 81);
}

.dark .tahrir-preloader__label {
  color: rgb(209 213 219);
}

.tahrir-preloader__bar {
  position: relative;
  width: 100%;
  height: 0.4rem;
  overflow: hidden;
  border-radius: 9999px;
  background: rgb(229 231 235);
}

.dark .tahrir-preloader__bar {
  background: rgb(55 65 81);
}

.tahrir-preloader__bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, rgb(var(--tahrir-brand-hover)), rgb(var(--tahrir-brand)));
  transition: width 0.2s ease;
}

.tahrir-preloader__percent {
  font-size: 0.75rem;
  color: rgb(var(--tahrir-brand));
}

@keyframes tahrir-preloader-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Megamenu — React-controlled (.is-open); avoid :focus-within so it closes after click */
.megamenu-link {
  position: relative;
  overflow: visible;
  /* باید پایین‌تر از search-overlay (35) باشد تا موقع سرچ مات شود */
  z-index: 20;
}

.megamenu-link.is-open {
  z-index: 60;
}

.megamenu-link > .megamenu {
  top: 100%;
  left: auto;
  right: 0;
  z-index: 60;
  margin-top: 0;
  padding-top: 0.5rem;
  transition-delay: 0ms;
  pointer-events: none;
}

.megamenu-link > .megamenu::before {
  content: '';
  position: absolute;
  top: -0.625rem;
  left: 0;
  right: 0;
  height: 0.625rem;
}

.megamenu-link.is-open > .megamenu,
.megamenu-link > .megamenu.is-open {
  clip-path: inset(0 0 0 0) !important;
  visibility: visible !important;
  top: 100% !important;
  opacity: 1 !important;
  pointer-events: auto;
}

/* خنثی‌کردن hover/focus از app.css تا بعد از کلیک باز نماند */
.megamenu-link:hover > .megamenu:not(.is-open),
.megamenu-link:focus-within > .megamenu:not(.is-open) {
  clip-path: inset(0 0 100% 0) !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.megamenu_left {
  position: relative;
  min-height: 20rem;
}

.megamenu_left-item {
  flex-wrap: wrap;
  row-gap: 1.5rem;
}

.megamenu_left-menu {
  flex-shrink: 0;
  min-width: 12rem;
  max-width: 100%;
}

.megamenu_left-title a {
  color: inherit;
  text-decoration: none;
}

.megamenu_left-title a:hover {
  color: rgb(var(--tahrir-brand-hover));
}

.megamenu_left-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem 1rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.megamenu_left-links > li {
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.5rem;
}

.megamenu_left-links > li a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1279px) {
  .megamenu_left-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .megamenu_left-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mobile-menu > ul > li.relative {
  position: relative;
}

.open-detail-category {
  cursor: pointer;
}

/* منوی موبایل وقتی بسته است اصلاً دیده نشود */
.mobile-menu:not(.active) {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* پنل دسته‌بندی موبایل — fixed روی body، جدا از transform منو */
.mobile-category-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background-color: rgb(255 255 255);
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dark .mobile-category-panel {
  background-color: rgb(31 41 55);
  color: rgb(243 244 246);
}

.mobile-category-panel--detail {
  z-index: 85;
}

.mobile-category-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgb(229 231 235);
  font-family: Dana Medium, sans-serif;
}

.dark .mobile-category-panel__header {
  border-bottom-color: rgb(55 65 81);
}

.mobile-category-panel__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 2rem;
}

.mobile-category-panel__links {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 2rem;
}

.mobile-category-panel__links > li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgb(229 231 235);
}

.dark .mobile-category-panel__links > li {
  border-bottom-color: rgb(55 65 81);
}

.mobile-category-panel__link {
  display: block;
  width: 100%;
  text-align: right;
  background: transparent;
  border: 0;
  padding: 0.25rem 0;
  color: inherit;
  cursor: pointer;
}

.mobile-category-panel__sublinks {
  list-style: disc;
  margin: 0.5rem 1.25rem 0 0;
  padding: 0;
}

.mobile-category-panel__sublinks .mobile-category-panel__link {
  font-size: 0.875rem;
  color: rgb(107 114 128);
}

/* Landing special product list — عرض بر اساس عرض کانتینر (نه wrapper در حال رشد) */
.AmazingSlider {
  container-type: inline-size;
  container-name: amazing-slider;
}

.AmazingSlider .swiper-slide {
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

/* موبایل: اسلاید عنوان ابتدایی مخفی — عنوان در هدر رنگی بالای اسلایدر است */
.AmazingSlider .swiper-slide.amazing-card--desktop {
  display: none !important;
  width: 0 !important;
  max-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.AmazingSlider .swiper-slide.product-card,
.AmazingSlider .swiper-slide.amazing-card_last {
  height: auto !important;
  max-width: none !important;
  /* موبایل: دقیقاً ۲ کارت در هر نمایش (spaceBetween=14) */
  width: calc((100cqi - 14px) / 2) !important;
}

@media (min-width: 640px) {
  .AmazingSlider .swiper-slide.product-card,
  .AmazingSlider .swiper-slide.amazing-card_last {
    width: calc((100cqi - 28px) / 2.5) !important;
  }
}

@media (min-width: 1024px) {
  .amazing-mobile-header {
    display: none !important;
  }

  .AmazingSlider .swiper-slide.amazing-card--desktop {
    display: flex !important;
    width: 11rem !important;
    max-width: 11rem !important;
  }

  .AmazingSlider .swiper-slide.product-card,
  .AmazingSlider .swiper-slide.amazing-card_last {
    /* دسکتاپ: ۳ محصول کامل + نصف بعدی بعد از عنوان */
    width: calc((100cqi - 11rem - 56px) / 3.5) !important;
  }
}

@media (min-width: 768px) {
  .AmazingSlider .swiper-slide.amazing-card--desktop,
  .AmazingSlider .swiper-slide.product-card,
  .AmazingSlider .swiper-slide.amazing-card_last {
    height: 24rem !important;
  }
}

[class*='LatestProducts-'] .swiper-slide.product-card,
.LatestProducts .swiper-slide.product-card {
  height: auto !important;
}

/* Footer trust badges — همان چیدمان site */
@media (min-width: 1024px) {
  .site-footer-trust-col {
    align-items: flex-end;
  }

  .site-footer-trust-row {
    justify-content: flex-end;
  }
}

/* ── Shop pagination ── */
.shop-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 2.5rem;
  padding-bottom: 1rem;
  direction: rtl; /* ۱ از راست؛ دکمه‌های قبل/اول سمت راست */
}

.shop-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid rgb(229 231 235);
  border-radius: 0.5rem;
  background-color: rgb(var(--tahrir-white));
  color: rgb(var(--tahrir-charcoal));
  font-size: 0.875rem;
  font-family: Dana Medium, Dana, sans-serif;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.dark .shop-pagination__btn {
  border-color: rgb(75 85 99);
  background-color: rgb(var(--tahrir-charcoal));
  color: rgb(229 231 235);
}

.shop-pagination__btn:hover:not(:disabled) {
  border-color: rgb(var(--tahrir-brand));
  color: rgb(var(--tahrir-brand));
}

.dark .shop-pagination__btn:hover:not(:disabled) {
  border-color: rgb(var(--tahrir-brand-hover));
  color: rgb(var(--tahrir-brand-hover));
}

.shop-pagination__btn.is-active,
.shop-pagination__btn.is-active:disabled {
  border-color: rgb(var(--tahrir-brand));
  background-color: rgb(var(--tahrir-brand));
  color: #fff !important;
  cursor: default;
  opacity: 1;
}

.shop-pagination__btn:disabled:not(.is-active) {
  opacity: 0.4;
  cursor: not-allowed;
}

.shop-pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 2.5rem;
  color: rgb(156 163 175);
  user-select: none;
}

/* utilityهای گرید که در app.css کامپایل نشده‌اند */
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .sm\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sm\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* گرید محصولات صفحه دسته — تمام‌عرض، ۴ ستون در دسکتاپ */
.shop-category-product-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .shop-category-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .shop-category-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* تصویر کوچک نتایج جستجو در هدر */
.search-result-thumb {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
}

.search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*
  لایه‌بندی سرچ دسکتاپ (از پایین به بالا):
  1) دسته‌بندی / megamenu  → z-20
  2) search-overlay         → z-35  (مات کردن همه چیز به‌جز سرچ)
  3) باکس + نتایج سرچ       → z-50  (بالای overlay، مات نشود)
*/
.search-overlay {
  z-index: 35 !important;
}

.search-stack {
  position: relative;
  z-index: 20;
}

.search-stack.is-open {
  z-index: 50 !important;
}

/* app.css مقدار z-index:-10 روی .search-btn-open دارد؛ با باز بودن سرچ باید خنثی شود */
.search-btn-open.active,
.search-stack.is-open .search-btn-open {
  position: relative;
  z-index: 50 !important;
}

.search-modal {
  z-index: 50 !important;
  max-height: min(70vh, 28rem);
  overflow-y: auto;
}

.search-modal.active {
  z-index: 50 !important;
}

/* مودال سرچ موبایل بالاتر از overlay */
.mobile_search-modal {
  z-index: 55 !important;
}

.mobile_search-modal:not(.active) {
  visibility: hidden;
  pointer-events: none;
}

/* موقع سرچ، دسته‌بندی زیر overlay بماند و روی نتایج نیفتد */
.header.search-is-open .megamenu-link,
.header.search-is-open .megamenu-link.is-open {
  z-index: 1 !important;
  pointer-events: none;
}

.header.search-is-open .megamenu-link > .megamenu {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@keyframes tahrir-preloader-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.94);
    opacity: 0.85;
  }
}

/* ── Brand color overrides for compiled app.css ── */

.border-blue-400,
.dark\:border-blue-400:is(.dark *) {
  border-color: rgb(var(--tahrir-brand-hover)) !important;
}

.bg-blue-400,
.group:focus .group-focus\:bg-blue-400 {
  background-color: rgb(var(--tahrir-brand-hover)) !important;
}

.bg-blue-50,
.bg-blue-50\/50,
.hover\:bg-blue-50:hover {
  background-color: rgb(var(--tahrir-brand-subtle)) !important;
}

.dark\:hover\:bg-blue-900\/20:hover:is(.dark *) {
  background-color: rgb(var(--tahrir-brand) / 0.2) !important;
}

.text-blue-400,
.dark\:text-blue-400:is(.dark *) {
  color: rgb(var(--tahrir-brand-hover)) !important;
}

.ring-blue-500,
.ring-blue-500\/20,
.ring-blue-500\/40 {
  --tw-ring-color: rgb(var(--tahrir-brand-hover) / 0.4) !important;
}

.border-blue-200 {
  border-color: rgb(var(--tahrir-brand-subtle)) !important;
}

.border-t-blue-500 {
  border-top-color: rgb(var(--tahrir-brand-hover)) !important;
}

.dark\:text-sky-400:is(.dark *) {
  color: rgb(var(--tahrir-brand-hover)) !important;
}

.peer:checked ~ .peer-checked\:border-blue-500 {
  border-color: rgb(var(--tahrir-brand)) !important;
}

.peer:checked ~ .peer-checked\:bg-blue-500 {
  background-color: rgb(var(--tahrir-brand)) !important;
}

.peer:checked ~ .dark\:peer-checked\:bg-blue-500:is(.dark *) {
  background-color: rgb(var(--tahrir-brand)) !important;
}

.focus\:ring-blue-500:focus,
.focus\:ring-2.focus\:ring-blue-500:focus {
  --tw-ring-color: rgb(var(--tahrir-brand-hover)) !important;
}

.border-blue-500,
.checked\:border-blue-500:checked,
.group:focus .group-focus\:border-blue-500 {
  border-color: rgb(var(--tahrir-brand)) !important;
}

.bg-blue-500,
.checked\:bg-blue-500:checked,
.peer:checked ~ .peer-checked\:bg-blue-500,
.dark\:checked\:bg-blue-500:checked:is(.dark *),
.peer:checked ~ .dark\:peer-checked\:bg-blue-500:is(.dark *) {
  background-color: rgb(var(--tahrir-brand)) !important;
}

.bg-blue-500\/10 {
  background-color: rgb(var(--tahrir-brand-subtle)) !important;
}

.bg-blue-600,
.child\:bg-blue-600 > * {
  background-color: rgb(var(--tahrir-brand)) !important;
}

.hover\:bg-blue-500:hover,
.hover\:bg-blue-600:hover,
.dark\:hover\:bg-blue-500:hover:is(.dark *) {
  background-color: rgb(var(--tahrir-brand-hover)) !important;
}

.hover\:bg-blue-700:hover,
.dark\:bg-blue-700:is(.dark *) {
  background-color: rgb(var(--tahrir-charcoal)) !important;
}

.text-blue-500,
.group:hover .group-hover\:text-blue-500,
.child-hover\:text-blue-500 > *:hover,
.child-hover\:dark\:text-blue-500:is(.dark *) > *:hover,
.dark\:text-blue-500:is(.dark *),
.text-blue-600,
.child-hover\:text-blue-600 > *:hover {
  color: rgb(var(--tahrir-brand)) !important;
}

.hover\:text-blue-500:hover,
.hover\:text-blue-600:hover {
  color: rgb(var(--tahrir-brand-hover)) !important;
}

.focus\:ring-blue-500:focus {
  --tw-ring-color: rgb(var(--tahrir-brand-hover)) !important;
}

.tooltiptext:is(.dark *) {
  background-color: rgb(var(--tahrir-brand-hover)) !important;
}

.tooltiptext:is(.dark *)::after {
  border-top-color: rgb(var(--tahrir-brand-hover)) !important;
}

.megamenu_category-item.active {
  background-color: rgb(var(--tahrir-brand)) !important;
}

.solid-menu > *:hover,
.solid-submenu > *:hover,
.city-list > *:hover,
.mobile-menu-item:hover,
.mobile-menu-category-badge,
.submit-btn {
  background-color: rgb(var(--tahrir-brand)) !important;
}

.submit-btn.address-submit-btn {
  width: auto !important;
  padding: 0.5rem 1.25rem !important;
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
}

.submit-btn:hover {
  background-color: rgb(var(--tahrir-brand-hover)) !important;
}

.submit-btn:focus,
.submit-btn:focus-visible {
  --tw-ring-color: rgb(var(--tahrir-brand-ring)) !important;
}

.amazing-card_last {
  color: rgb(var(--tahrir-brand)) !important;
}

/* کارت محصول — جلوگیری از بیرون‌زدن عکس در موبایل */
.product-card {
  overflow: hidden !important;
  min-width: 0 !important;
}

.product-card > a:has(.product-card_img) {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.product-card .product-card_img {
  max-width: 100% !important;
  width: min(100%, 13rem) !important;
  height: auto !important;
  aspect-ratio: 13 / 11;
  object-fit: contain !important;
}

@media (min-width: 360px) {
  .product-card .product-card_img {
    width: min(100%, 9rem) !important;
    aspect-ratio: 9 / 8;
  }
}

@media (min-width: 480px) {
  .product-card .product-card_img {
    width: min(100%, 11rem) !important;
    aspect-ratio: 11 / 9;
  }
}

@media (min-width: 1024px) {
  .product-card .product-card_img {
    width: min(100%, 15rem) !important;
    aspect-ratio: 15 / 13;
  }
}

.product-card .product-card_img.absolute {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
}

.product-card_badge {
  color: rgb(var(--tahrir-brand)) !important;
}

.product-card_badge:is(.dark *) {
  color: rgb(var(--tahrir-brand-hover)) !important;
}

.product-card_price span,
.small-card_price span {
  background-color: rgb(var(--tahrir-brand)) !important;
}

.slider-navigate_btn:hover {
  color: rgb(var(--tahrir-brand-hover)) !important;
}

.resend-code {
  color: rgb(var(--tahrir-brand)) !important;
}

/* ذغالی — جایگزین خاکستری تیره در فوتر و باکس‌ها */
.bg-gray-950 {
  background-color: rgb(var(--tahrir-charcoal)) !important;
}

.bg-gray-900 {
  background-color: rgb(var(--tahrir-charcoal)) !important;
}

.dark\:bg-gray-900:is(.dark *) {
  background-color: rgb(38 44 52) !important;
}

.dark\:bg-gray-800:is(.dark *) {
  background-color: rgb(var(--tahrir-charcoal)) !important;
}
