/* =====================================================================
   App-parity catalog components (home sections, product cards, filters,
   category tiles, product page). Values follow DIXIApp/src/theme.
   ===================================================================== */

.dx-flip { font-size: 0.7em; }
[dir="rtl"] .dx-flip { transform: scaleX(-1); }

/* ---------- Header cart ---------- */
.dx-navcart {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.dx-navcart-count {
  position: absolute;
  top: 2px;
  inset-inline-end: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.dx-navcart-count.is-empty { display: none; }

/* ---------- Website hero slider (Admin → Website Banners) ---------- */
#hero .hero-swiper {
  width: 100%;
  align-self: stretch;
}
#hero .hero-slide {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(92vh, 820px);
  overflow: hidden;
}
/* Replay the copy animation each time a slide becomes active. Only while the
   slider runs: a single slide never starts Swiper and must keep its copy. */
#hero .swiper-initialized .hero-slide .hero-copy { animation: none; opacity: 0; }
#hero .swiper-initialized .hero-slide.swiper-slide-active .hero-copy { animation: heroRise 0.9s ease both; opacity: 1; }
#hero .hero-pagination {
  bottom: 30px !important;
  z-index: 3;
  text-align: start;
  padding-inline: max(12px, calc((100vw - 1296px) / 2 + 12px));
}
#hero .hero-pagination .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  margin: 0 4px !important;
  background: #fff;
  opacity: 0.5;
  transition: width 0.3s, opacity 0.3s;
}
#hero .hero-pagination .swiper-pagination-bullet-active {
  width: 28px;
  border-radius: 5px;
  background: #fff;
  opacity: 1;
}
#hero.hero-has-slides .hero-scroll { display: none; }
/* Copy sits on the right in Arabic, so darken that side instead. */
[dir="rtl"] #hero .hero-veil {
  background:
    linear-gradient(260deg, rgba(28, 12, 16, 0.88) 0%, rgba(28, 12, 16, 0.62) 48%, rgba(28, 12, 16, 0.28) 100%),
    linear-gradient(0deg, rgba(28, 12, 16, 0.55) 0%, transparent 45%);
}
@media (max-width: 767px) {
  #hero .hero-slide { min-height: min(88vh, 720px); align-items: center; }
  #hero .hero-pagination { text-align: center; bottom: 18px !important; }
}

/* ---------- Home sections ---------- */
.dx-section { padding: 28px 0; }
.dx-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.dx-section-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 700;
  color: var(--primary);
}
.dx-section-link {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}
.dx-section-link:hover { color: var(--primary-medium); }

/* Auto-advancing carousel with arrows (manufacturers / product families) */
.dx-carousel {
  position: relative;
  padding-inline: 48px;
}
.dx-carousel .swiper { padding: 4px 2px; }
.dx-carousel .swiper-slide { height: auto; }
.dx-carousel .dx-tile { height: 100%; }
.dx-carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(97, 12, 47, 0.25);
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(44, 20, 26, 0.08);
  transform: translateY(-50%);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.dx-carousel-btn:hover { background: var(--primary); color: #fff; }
.dx-carousel-btn.swiper-button-disabled { opacity: 0.35; cursor: default; }
.dx-carousel-btn.swiper-button-lock { display: none; }
.dx-carousel-prev { inset-inline-start: 0; }
.dx-carousel-next { inset-inline-end: 0; }
.dx-carousel-btn .dx-flip { font-size: 0.85rem; }

/* Text tile (app FeaturedBrands / ProductFamilies) */
.dx-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 4px;
  min-height: 96px;
  padding: 14px 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(44, 20, 26, 0.08);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.dx-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(97, 12, 47, 0.3);
  box-shadow: var(--shadow);
}
.dx-tile-name { font-weight: 700; font-size: 0.95rem; line-height: 1.3; }
.dx-tile-sub { font-size: 0.78rem; color: #8a7b80; }
.dx-tile-c0 .dx-tile-name { color: #610c2f; }
.dx-tile-c1 .dx-tile-name { color: #1b7a5a; }
.dx-tile-c2 .dx-tile-name { color: #1f5fa8; }
.dx-tile-c3 .dx-tile-name { color: #b5591a; }
.dx-tile-c4 .dx-tile-name { color: #6b3fa0; }
.dx-tile-c5 .dx-tile-name { color: #94244b; }
.dx-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

/* ---------- Category tiles with image ---------- */
.dx-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.dx-cat-grid-lg { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.dx-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 18px 12px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(44, 20, 26, 0.08);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.dx-cat:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.dx-cat-thumb {
  width: 76px;
  height: 76px;
  border-radius: 19px;
  overflow: hidden;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dx-cat-grid-lg .dx-cat-thumb { width: 96px; height: 96px; border-radius: 24px; }
.dx-cat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dx-cat-initial { font-size: 1.9rem; font-weight: 700; color: var(--primary); }
.dx-cat-name { font-weight: 700; color: var(--primary); line-height: 1.3; }
.dx-cat-sub { font-size: 0.8rem; color: #757575; }

/* ---------- Product card (app CategoryProductCard / ProductOfferCard) ---------- */
.dx-pcard {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(44, 20, 26, 0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s;
}
.dx-pcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.dx-pcard.is-out .dx-pimg img { opacity: 0.55; }
.dx-pimg {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: #f5f5f7;
}
.dx-pimg img { width: 100%; height: 100%; object-fit: cover; }
.dx-discount {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  background: #e05275;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 3px 8px;
}
.dx-discount-lg { font-size: 0.85rem; padding: 5px 10px; top: 14px; inset-inline-start: 14px; }
.mhrt.dx-heart { top: 10px; right: auto; inset-inline-end: 10px; }
.dx-pbody {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px 14px;
  flex: 1;
}
.dx-rx {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(97, 12, 47, 0.08);
  color: var(--primary);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
}
.dx-pname {
  color: var(--dark);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dx-pname:hover { color: var(--primary); }
.dx-psci {
  color: #757575;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dx-stock {
  align-self: flex-start;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 700;
}
.dx-stock-in { background: #e7f6ef; color: var(--green); }
.dx-stock-out { background: #fdecef; color: #c62845; }
.dx-pprice {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.dx-pprice span { color: var(--primary); font-weight: 700; font-size: 1.02rem; }
.dx-pprice s { color: #9a9a9a; font-size: 0.82rem; }

/* Add to cart → stepper (app AddToCartControl) */
.dx-cartctl { min-height: 40px; }
.dx-addbtn {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-medium));
  color: #fff;
  font-weight: 700;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font-family: var(--font-body);
}
.dx-addbtn:disabled { background: #d9d2d4; color: #7a6d71; cursor: not-allowed; }
.dx-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  overflow: hidden;
}
.dx-stepper button {
  width: 40px;
  height: 100%;
  border: none;
  background: rgba(97, 12, 47, 0.06);
  color: var(--primary);
  cursor: pointer;
}
.dx-stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.dx-stepper span { font-weight: 700; color: var(--primary); }
.dx-stepper-lg { width: 160px; height: 46px; }
.dx-stepper-lg button { width: 46px; }

/* ---------- Empty / load more ---------- */
.dx-empty {
  text-align: center;
  padding: 48px 16px;
  color: #8a7b80;
}
.dx-empty i { font-size: 2rem; color: var(--secondary); margin-bottom: 12px; }
.dx-empty p { margin: 0; }
.dx-loadmore {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.dx-loadmore p { margin: 0; color: #6a5b60; font-weight: 600; font-size: 0.9rem; }
.dx-progress {
  width: min(280px, 80%);
  height: 4px;
  border-radius: 4px;
  background: rgba(97, 12, 47, 0.12);
  overflow: hidden;
}
.dx-progress span { display: block; height: 100%; background: var(--primary); }

/* ---------- Shop page: search, chips, filters ---------- */
.dx-shop-search,
.dx-search-inline {
  position: relative;
  margin-bottom: 14px;
}
.dx-shop-search i,
.dx-search-inline i {
  position: absolute;
  top: 50%;
  inset-inline-start: 16px;
  transform: translateY(-50%);
  color: #9a9a9a;
}
.dx-shop-search input,
.dx-search-inline input {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(44, 20, 26, 0.1);
  background: #fff;
  padding-inline: 44px 16px;
  font-family: var(--font-body);
}
.dx-shop-search input:focus,
.dx-search-inline input:focus { outline: 2px solid rgba(97, 12, 47, 0.25); border-color: var(--primary); }
.dx-search-inline { max-width: 420px; margin-bottom: 20px; }
.shop-toolbar { flex-wrap: wrap; }
.dx-toolbar-end { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dx-sort { width: auto; min-width: 180px; padding-block: 8px; }
.dx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dx-chip {
  border: 1px solid rgba(97, 12, 47, 0.2);
  background: #fff;
  color: var(--primary);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.dx-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.dx-list-search { margin-bottom: 8px; padding-block: 7px; font-size: 0.85rem; }
.dx-checklist {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dx-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 4px;
  border-radius: 6px;
  font-size: 0.88rem;
  cursor: pointer;
}
.dx-check:hover { background: rgba(97, 12, 47, 0.05); }
.dx-check input { accent-color: var(--primary); width: 16px; height: 16px; }
.dx-check[hidden] { display: none; }
.dx-check-empty { font-size: 0.82rem; color: #9a9a9a; margin: 0; }

/* Dual-thumb price range */
.dx-range { position: relative; height: 28px; }
.dx-range::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 12px;
  height: 4px;
  border-radius: 4px;
  background: rgba(97, 12, 47, 0.12);
}
.dx-range-fill {
  position: absolute;
  top: 12px;
  height: 4px;
  border-radius: 4px;
  background: var(--primary);
}
.dx-range input[type="range"] {
  position: absolute;
  inset-inline: 0;
  top: 4px;
  width: 100%;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.dx-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--primary);
  cursor: pointer;
}
.dx-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--primary);
  cursor: pointer;
}
.dx-range input[type="range"]::-moz-range-track { background: none; }
.dx-range-label { margin: 6px 0 0; font-size: 0.84rem; font-weight: 600; color: var(--primary); }

/* ---------- Breadcrumbs ---------- */
.dx-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}
.dx-crumbs a { color: #fff; }
.dx-crumbs-dark { color: #8a7b80; margin: 24px 0 20px; }
.dx-crumbs-dark a { color: var(--primary); }
.dx-crumbs-dark #dxCrumbCategory { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Product page ---------- */
.dx-product-page { padding-bottom: 64px; }
.dx-gallery-main {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(44, 20, 26, 0.08);
}
.dx-gallery-main img,
.dx-gallery-main video { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.dx-gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.dx-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #fff;
  padding: 0;
  cursor: pointer;
  color: var(--primary);
}
.dx-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dx-thumb.active { border-color: var(--primary); }
.dx-pd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dx-pd-brand { color: var(--secondary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.82rem; }
.dx-pd-actions { display: flex; gap: 8px; }
.dx-iconbtn {
  position: static;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(44, 20, 26, 0.1);
  background: #fff;
  color: #8a7b80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
}
.dx-iconbtn:hover { color: var(--primary); }
.dx-pd-name { font-family: var(--font-body); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 8px 0 4px; }
.dx-pd-generic { color: #757575; margin: 0 0 10px; }
.dx-pd-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.dx-pd-price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.dx-pd-price span { color: var(--primary); font-weight: 700; font-size: 1.9rem; }
.dx-pd-price s { color: #9a9a9a; font-size: 1.1rem; }
.dx-pd-units, .dx-pd-qty { margin-bottom: 20px; }
.dx-pd-qty { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.dx-pd-qty .flbl { width: 100%; }
.dx-pd-available { color: #757575; font-size: 0.86rem; }
.dx-pd-buy { display: flex; gap: 12px; flex-wrap: wrap; }
.dx-pd-buy .btn-red, .dx-pd-buy .dx-btn-outline { flex: 1 1 180px; justify-content: center; }
.dx-pd-buy button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.dx-btn-outline { color: var(--primary); border-color: var(--primary); }
.dx-btn-outline:hover { background: rgba(97, 12, 47, 0.06); color: var(--primary); border-color: var(--primary); }
.dx-pd-msg { margin: 12px 0 0; color: var(--green); font-weight: 600; }
.dx-pd-msg.is-error { color: #c62845; }
.dx-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(44, 20, 26, 0.1);
  margin-top: 12px;
  overflow-x: auto;
}
.dx-tab {
  border: none;
  background: none;
  padding: 12px 18px;
  font-weight: 700;
  color: #8a7b80;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
}
.dx-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.dx-tabpanel { padding: 20px 4px; line-height: 1.7; }
.dx-tabpanel p { margin: 0; white-space: pre-line; }
.dx-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}
.dx-details div { background: #fff; border: 1px solid rgba(44, 20, 26, 0.08); border-radius: 12px; padding: 12px 14px; }
.dx-details dt { font-size: 0.78rem; color: #8a7b80; font-weight: 600; }
.dx-details dd { margin: 2px 0 0; font-weight: 700; color: var(--dark); white-space: normal; }

@media (max-width: 575px) {
  .dx-pbody { padding: 10px; }
  .dx-pname { font-size: 0.88rem; }
  .dx-addbtn { font-size: 0.78rem; }
  .dx-carousel { padding-inline: 40px; }
  .dx-carousel-btn { width: 32px; height: 32px; }
}
