html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Brand: red. Gradients go from light (start of the element) to deep, bold red (its end) -
   "start" follows the reading direction, so it is the right side in Arabic. */
:root {
  --matjari-red: #dc2626;
  --matjari-red-dark: #991b1b;
  --matjari-red-light: #fef2f2;
  --matjari-red-soft: #fecaca;
  --matjari-gradient: linear-gradient(to right, #f87171 0%, #dc2626 55%, #991b1b 100%);
  --matjari-gradient-soft: linear-gradient(to right, #fff5f5 0%, #fee2e2 60%, #fecaca 100%);
  --bs-primary: var(--matjari-red);
  --bs-primary-rgb: 220, 38, 38;
  --bs-link-color: var(--matjari-red-dark);
  --bs-link-color-rgb: 153, 27, 27;
  --bs-link-hover-color: var(--matjari-red);
  --bs-link-hover-color-rgb: 220, 38, 38;
}

[dir="rtl"] {
  --matjari-gradient: linear-gradient(to left, #f87171 0%, #dc2626 55%, #991b1b 100%);
  --matjari-gradient-soft: linear-gradient(to left, #fff5f5 0%, #fee2e2 60%, #fecaca 100%);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus, .form-select:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(220, 38, 38, 0.45);
  border-color: var(--matjari-red-soft);
}

.form-check-input:checked {
  background-color: var(--matjari-red);
  border-color: var(--matjari-red);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background-color: #fbf7f7;
  color: #1f2937;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* No horizontal page scroll (wide slideshow / full-bleed elements). */
body {
    overflow-x: hidden;
}

/* Navbar: white, with a red gradient line along the bottom */
.matjari-navbar {
  background: #ffffff;
  border-bottom: 0;
  box-shadow: 0 2px 10px rgba(153, 27, 27, 0.08);
  position: relative;
}

.matjari-navbar::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  background: var(--matjari-gradient);
}
.matjari-navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--matjari-red-dark) !important;
}

.matjari-navbar .nav-link,
.matjari-navbar .btn-link.nav-link {
  color: #334155 !important;
  font-weight: 500;
  transition: color 0.15s ease;
}

.matjari-navbar .nav-link:hover,
.matjari-navbar .btn-link.nav-link:hover {
  color: var(--matjari-red-dark) !important;
}

.matjari-navbar .nav-link.active {
  color: var(--matjari-red-dark) !important;
  font-weight: 700;
}

.matjari-navbar .navbar-user {
  color: #64748b !important;
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* Bootstrap's .navbar-expand-sm forces flex-wrap:nowrap at >=576px (so the
   collapse sits inline next to the brand instead of stacking) - but our custom
   layout deliberately puts the collapse on its own row below the icon row, and
   relies on that row being allowed to wrap. Without overriding it back to wrap
   here, a long seller/admin email plus the visitor count, bell, logout button
   and language switch all get squeezed into whatever sliver of width is left
   and run off the right edge - invisible, not just unreachable, since body has
   overflow-x:hidden (set above). */
.matjari-navbar.navbar-expand-sm {
  flex-wrap: wrap !important;
}

.matjari-navbar .navbar-collapse {
  width: 100%;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

/* Same defensive wrap as the collapse row below: on a very narrow phone with a
   longer language label (e.g. "العربية") the icon row can run out of space -
   this lets it drop to a second line instead of clipping off the right edge. */
.matjari-icon-row {
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.matjari-navbar .navbar-collapse .navbar-nav {
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.lang-switch {
  border: 1px solid #f1dede;
  color: var(--matjari-red-dark) !important;
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.lang-switch:hover {
  background-color: var(--matjari-red-light);
  color: var(--matjari-red-dark) !important;
}

/* Icon buttons (menu toggle, search) */
.matjari-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.6rem;
  border: 1px solid #f1dede;
  background: #fff;
  color: var(--matjari-red-dark);
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.matjari-icon-btn:hover {
  background-color: var(--matjari-red-light);
}

/* Expanding search */
.matjari-search {
  display: flex;
  align-items: center;
  margin: 0;
}

.matjari-search-input {
  width: 0;
  min-width: 0;
  opacity: 0;
  padding-block: 0;
  padding-inline: 0;
  margin-inline-start: 0;
  height: 2.5rem;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  background-color: #fbf7f7;
  transition: width 0.28s ease, opacity 0.2s ease, padding 0.28s ease, margin-inline-start 0.28s ease;
  pointer-events: none;
}

.matjari-search.open .matjari-search-input {
  width: 200px;
  max-width: 40vw;
  opacity: 1;
  padding-inline: 0.75rem;
  margin-inline-start: 0.5rem;
  border-color: #f1dede;
  pointer-events: auto;
}

@media (min-width: 576px) {
  .matjari-search.open .matjari-search-input {
    width: 280px;
    max-width: 40vw;
  }
}

/* Cart button */
.matjari-cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.6rem;
  background: var(--matjari-gradient);
  color: #fff !important;
  flex-shrink: 0;
  transition: filter 0.15s ease;
}

.matjari-cart-btn:hover {
  filter: brightness(0.92);
}

.matjari-cart-badge {
  position: absolute;
  top: -0.35rem;
  inset-inline-end: -0.35rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #fff;
  color: var(--matjari-red-dark);
  border: 1.5px solid var(--matjari-red);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Account button */
.matjari-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #f1dede;
  border-radius: 0.6rem;
  padding: 0 0.9rem;
  height: 2.5rem;
  color: var(--matjari-red-dark) !important;
  font-weight: 600;
  background: #fff;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.matjari-account-btn:hover {
  background-color: var(--matjari-red-light);
}

/* Home slideshow: products, 2 s each, cross-fade (Bootstrap .carousel-fade). The blurred copy
   of the photo fills the sides so tall and wide product photos both look good. */
.home-slideshow {
  border-radius: 1rem;
  overflow: hidden;
  background: var(--matjari-gradient);
  box-shadow: 0 6px 20px rgba(153, 27, 27, 0.18);
}

.home-slideshow .carousel-item {
  height: 300px;
  transition: opacity 0.8s ease-in-out;
}

@media (min-width: 768px) {
  .home-slideshow .carousel-item {
    height: 380px;
  }
}

.home-slideshow .slide-link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
}

.home-slideshow .slide-bg {
  position: absolute;
  inset: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  object-fit: cover;
  filter: blur(18px) brightness(0.75);
}

.home-slideshow .slide-img {
  position: relative;
  display: block;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
}

.home-slideshow .slide-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 2.5rem 1.25rem 2rem;
  background: linear-gradient(to bottom, rgba(127, 29, 29, 0) 0%, rgba(127, 29, 29, 0.55) 45%, rgba(69, 10, 10, 0.92) 100%);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.home-slideshow .slide-name {
  font-size: 1.25rem;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.home-slideshow .slide-price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.home-slideshow .old-price {
  color: rgba(255, 255, 255, 0.75);
}

.home-slideshow .carousel-indicators {
  margin-bottom: 0.5rem;
}

.home-slideshow .carousel-indicators [data-bs-target] {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Sale badge: light yellow, on product cards, the product page and the slideshow */
.sale-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(to right, #fefce8 0%, #fef3c7 60%, #fde68a 100%);
  color: #854d0e;
  border: 1px solid #fde68a;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.product-card-media {
  position: relative;
  display: block;
  text-decoration: none;
}

.matjari-account-btn {
  text-decoration: none;
}

.sale-badge-corner {
  position: absolute;
  top: 0.5rem;
  inset-inline-start: 0.5rem;
  box-shadow: 0 2px 6px rgba(133, 77, 14, 0.2);
}

.product-price {
  color: var(--matjari-red-dark);
}

.old-price {
  color: #9ca3af;
  font-weight: 500;
}

/* Filters (price / sort / store tabs) */
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--matjari-red-soft);
  border-radius: 999px;
  color: var(--matjari-red-dark);
  background: var(--matjari-gradient-soft);
  font-weight: 600;
}

.filter-toggle:hover {
  color: var(--matjari-red-dark);
  filter: brightness(0.97);
}

.filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--matjari-red);
}

.filter-card {
  max-width: 640px;
}

.filter-tabs .nav-link {
  color: #6b7280;
  font-weight: 600;
}

.filter-tabs .nav-link.active {
  color: var(--matjari-red-dark);
  border-bottom: 3px solid var(--matjari-red);
}

.filter-price {
  width: 110px;
}

.sort-chip {
  border: 1px solid var(--matjari-red-soft);
  border-radius: 999px;
  color: var(--matjari-red-dark);
  background: #fff;
}

.sort-chip.active,
.sort-chip.active:hover {
  background: var(--matjari-gradient);
  border-color: transparent;
  color: #fff;
}

/* Categories page */
.category-card {
  overflow: hidden;
  color: inherit;
}

.category-card .card-title {
  color: var(--matjari-red-dark);
  font-weight: 700;
}

.category-card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-bottom: 3px solid transparent;
  border-image: var(--matjari-gradient) 1;
}

/* Section headings get a short gradient underline */
.related-products h2,
#results-heading {
  display: inline-block;
  padding-bottom: 0.25rem;
  border-bottom: 3px solid transparent;
  border-image: var(--matjari-gradient) 1;
}

/* Cards */
.card {
  border: 1px solid #f3e6e6;
  border-radius: 0.85rem;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.08);
}

.product-card:hover {
  transform: translateY(-3px);
}

.card-img-top {
  border-top-left-radius: 0.85rem;
  border-top-right-radius: 0.85rem;
}

/* Buttons */
.btn {
  border-radius: 0.55rem;
  font-weight: 500;
}

.btn-primary,
.btn-primary:disabled {
  color: #fff;
  background: var(--matjari-gradient);
  border: 0;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  color: #fff !important;
  background: var(--matjari-gradient) !important;
  filter: brightness(0.92);
}

.btn-outline-primary {
  --bs-btn-color: var(--matjari-red-dark);
  --bs-btn-border-color: var(--matjari-red-soft);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--matjari-red);
  --bs-btn-hover-border-color: var(--matjari-red);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--matjari-red-dark);
  --bs-btn-active-border-color: var(--matjari-red-dark);
}

/* Category pills */
.category-pill {
  border-radius: 999px;
  border-color: #fecaca;
  color: var(--matjari-red-dark);
  white-space: nowrap;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.category-pill:hover {
  background: var(--matjari-gradient-soft);
  border-color: var(--matjari-red-soft);
  color: var(--matjari-red-dark);
}

.category-pill.active {
  background: var(--matjari-gradient);
  border-color: transparent;
  color: #fff;
}

.category-pill-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

/* Sticky category bar - stays visible so another category is always one click away */
.category-bar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background-color: #fbf7f7;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f3e1e1;
}

.category-bar-scroll {
  scrollbar-width: thin;
  padding-bottom: 0.15rem;
}

/* Seller logo / profile picture */
.seller-avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #f3e6e6;
  background-color: #fff;
  flex-shrink: 0;
}

.seller-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--matjari-red-light);
  color: var(--matjari-red-dark);
  font-weight: 600;
  line-height: 1;
}

/* Cart quantity: a fixed minimum width so the number box isn't squeezed next to the
   Update button on phones; 16px text stops iOS Safari from zooming in on focus. */
.cart-qty-form {
  flex-wrap: nowrap;
  min-width: 9.5rem;
}

.cart-qty-input {
  width: 4.5rem;
  min-width: 4.5rem;
  flex-shrink: 0;
  font-size: 16px;
  text-align: center;
}

/* Phones: each cart line becomes a stacked card instead of a 5-column table row,
   so the quantity box and Update button are full size without sideways scrolling. */
@media (max-width: 575.98px) {
  .cart-table thead {
    display: none;
  }

  .cart-table,
  .cart-table tbody,
  .cart-table tr,
  .cart-table td {
    display: block;
    width: 100%;
  }

  .cart-table tr {
    border: 1px solid #f3e6e6;
    border-radius: 0.6rem;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0;
    background: #fff;
  }

  .cart-table td {
    border: none;
    padding: 0.4rem 0.75rem;
  }

  .cart-table td[data-label] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .cart-table td[data-label]::before {
    content: attr(data-label);
    color: #6b7280;
    font-weight: 500;
  }

  .cart-qty-form {
    min-width: 0;
  }

  .cart-qty-input {
    width: 5rem;
    min-width: 5rem;
  }

  .cart-qty-form .btn,
  .cart-remove-cell .btn {
    min-height: 2.5rem;
  }

  .cart-remove-cell .btn {
    width: 100%;
  }
}

/* Tables */
.table {
  background-color: #fff;
  border-radius: 0.6rem;
  overflow: hidden;
}

.table thead th {
  background: var(--matjari-gradient-soft);
  color: var(--matjari-red-dark);
  border-bottom: none;
  font-weight: 600;
}

/* Badges */
.badge.bg-secondary {
  background: var(--matjari-gradient) !important;
}

/* Footer */
.footer {
  background-color: #fff;
  padding-top: 1rem;
  color: #6b7280;
}

/* RTL adjustments */
[dir="rtl"] .d-flex.gap-2 > * {
  margin-inline-end: 0;
}

/* ============================================================
   AliExpress admin dashboard - scoped to .ae-* only, does not
   touch the site's existing blue theme above.
   ============================================================ */
:root {
  --ae-teal: #0F6B5C;
  --ae-teal-dark: #0b5346;
  --ae-teal-light: #e6f0ee;
  --ae-bg: #f5f5f4;
  --ae-border: #e7e7e5;
}

.ae-shell {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  background: var(--ae-bg);
  margin: -1.5rem -0.75rem;
  padding: 1.5rem 0.75rem;
  border-radius: 0.5rem;
}

.ae-sidebar {
  flex: 0 0 220px;
  background: #fff;
  border: 1px solid var(--ae-border);
  border-radius: 0.75rem;
  padding: 1rem;
  position: sticky;
  top: 1rem;
}

.ae-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.ae-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  background: var(--ae-teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.ae-brand-name {
  font-weight: 700;
  line-height: 1.1;
}

.ae-brand-sub {
  font-size: 0.75rem;
  color: #6b7280;
}

.ae-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ae-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  color: #374151;
  text-decoration: none;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.ae-nav-link:hover {
  background: var(--ae-bg);
  color: #374151;
}

.ae-nav-link.active {
  background: var(--ae-teal-light);
  color: var(--ae-teal-dark);
  font-weight: 600;
}

.ae-nav-link svg {
  flex-shrink: 0;
}

.ae-nav-badge {
  margin-inline-start: auto;
  background: #fde3cf;
  color: #9a4a12;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.05rem 0.45rem;
}

.ae-api-note {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ae-border);
  font-size: 0.78rem;
  color: #6b7280;
}

.ae-api-note strong {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #374151;
  margin-bottom: 0.25rem;
}

.ae-api-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d97706;
  display: inline-block;
}

.ae-api-dot.ae-connected {
  background: var(--ae-teal);
}

.ae-content {
  flex: 1 1 auto;
  min-width: 0;
}

.ae-eyebrow {
  color: #6b7280;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.ae-card {
  background: #fff;
  border: 1px solid var(--ae-border);
  border-radius: 0.75rem;
  padding: 1.1rem;
}

.ae-stat-label {
  color: #6b7280;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.ae-stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.1;
}

.ae-stat-value.ae-profit {
  color: var(--ae-teal);
}

.ae-stat-hint {
  color: #6b7280;
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

.ae-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.6rem;
  text-decoration: none;
  color: inherit;
  margin-bottom: 0.6rem;
}

.ae-action-row:last-child {
  margin-bottom: 0;
}

.ae-action-row:hover {
  filter: brightness(0.98);
  color: inherit;
}

.ae-action-row.ae-amber { background: #fef3e2; }
.ae-action-row.ae-green { background: var(--ae-teal-light); }
.ae-action-row.ae-gray { background: #f3f4f6; }
.ae-action-row.ae-red { background: #fdecec; }

.ae-action-title {
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.ae-action-sub {
  font-size: 0.82rem;
  color: #6b7280;
}

.ae-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--ae-bg);
  overflow: hidden;
}

.ae-progress-bar {
  height: 100%;
  background: var(--ae-teal);
}

.ae-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--ae-border);
  background: #fff;
  color: #374151;
  font-size: 0.85rem;
  text-decoration: none;
}

.ae-pill.active {
  background: var(--ae-teal);
  border-color: var(--ae-teal);
  color: #fff;
}

.ae-pill:hover {
  color: inherit;
}

.ae-pill.active:hover {
  color: #fff;
}

.ae-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.ae-badge-gray { background: #f3f4f6; color: #374151; }
.ae-badge-amber { background: #fef3e2; color: #9a4a12; }
.ae-badge-blue { background: #e7edff; color: #28408a; }
.ae-badge-purple { background: #ece7fd; color: #5b3aa8; }
.ae-badge-green { background: var(--ae-teal-light); color: var(--ae-teal-dark); }
.ae-badge-red { background: #fdecec; color: #a4312a; }

.ae-badge-green-solid { background: var(--ae-teal); color: #fff; }

.ae-table-wrap {
  overflow-x: auto;
}

.ae-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ae-table th {
  text-align: start;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
  font-weight: 600;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--ae-border);
  white-space: nowrap;
}

.ae-table td {
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--ae-border);
  vertical-align: middle;
}

.ae-table tr:last-child td {
  border-bottom: none;
}

.ae-thumb {
  width: 44px;
  height: 44px;
  border-radius: 0.5rem;
  object-fit: cover;
  background: var(--ae-bg);
  flex-shrink: 0;
}

.ae-margin-low {
  color: #b42318;
  font-weight: 700;
}

.ae-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ae-border);
  background: #fff;
  color: #1f2937;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.ae-btn:hover { background: var(--ae-bg); color: #1f2937; }

.ae-btn-primary {
  background: var(--ae-teal);
  border-color: var(--ae-teal);
  color: #fff;
}

.ae-btn-primary:hover { background: var(--ae-teal-dark); border-color: var(--ae-teal-dark); color: #fff; }

@media (max-width: 767px) {
  .ae-shell {
    flex-direction: column;
  }

  .ae-sidebar {
    flex: 1 1 auto;
    width: 100%;
    position: static;
  }
}

/* ---------- Zone / town picker (same design as the app) ---------- */
.picker-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  background: #fff;
  text-align: start;
  color: inherit;
}

.picker-field:disabled {
  background: #f3f4f6;
  cursor: not-allowed;
}

.picker-field.is-invalid {
  border-color: #dc3545;
}

.picker-field.is-invalid ~ .invalid-feedback {
  display: block;
}

.picker-chevron {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  margin-bottom: 4px;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  transform: rotate(45deg);
}

.picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}

.picker-backdrop[hidden] {
  display: none;
}

@media (min-width: 576px) {
  .picker-backdrop {
    align-items: center;
  }
}

.picker-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: 75vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.picker-sheet-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid #f1f1f1;
}

.picker-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 6px 12px;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  color: #9ca3af;
}

.picker-search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #212529;
}

.picker-sheet-list {
  overflow-y: auto;
}

.picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid #f1f1f1;
  background: transparent;
  text-align: start;
  color: inherit;
}

.picker-option:hover {
  background: var(--matjari-red-light);
}

.picker-radio {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid #9ca3af;
  border-radius: 50%;
}

.picker-radio.checked {
  border-color: var(--matjari-red);
  background: var(--matjari-red);
  box-shadow: inset 0 0 0 4px #fff;
}

/* ---------- Header: chat badge, welcome strip ---------- */
.matjari-chat-badge {
  position: absolute;
  top: -0.35rem;
  inset-inline-end: -0.35rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--matjari-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.matjari-chat-badge[hidden] {
  display: none;
}

.welcome-strip {
  display: block;
  margin: -0.75rem 0 0.75rem;
  font-weight: 600;
  color: var(--matjari-red-dark);
  text-decoration: none;
}

/* ---------- Back to top (bottom right, both languages) ---------- */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 1040;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--matjari-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(153, 27, 27, 0.35);
  transition: transform 0.15s ease;
}

.back-to-top:hover {
  transform: translateY(-2px);
}

.back-to-top[hidden] {
  display: none;
}

/* ---------- Delivery notice ---------- */
.delivery-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-weight: 500;
}

.delivery-notice svg {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.chat-seller-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
}

/* ---------- Contact ---------- */
.contact-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  height: 100%;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid #f1dede;
  border-radius: 0.9rem;
  color: inherit;
  text-decoration: none;
}

a.contact-card:hover {
  border-color: var(--matjari-red-soft);
  background: var(--matjari-red-light);
}

.contact-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: var(--matjari-red-light);
  color: var(--matjari-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------- Chat ---------- */
.min-w-0 {
  min-width: 0;
}

.chat-list {
  background: #fff;
  border: 1px solid #f1dede;
  border-radius: 0.9rem;
  overflow: hidden;
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f5e9e9;
  color: inherit;
  text-decoration: none;
}

.chat-list-item:last-child {
  border-bottom: 0;
}

.chat-list-item:hover {
  background: var(--matjari-red-light);
}

.chat-list-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--matjari-gradient);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.chat-window {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 190px);
  min-height: 420px;
  max-width: 820px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #f1dede;
  border-radius: 1rem;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #f1dede;
}

.chat-back {
  color: var(--matjari-red-dark);
}

[dir="rtl"] .chat-back svg {
  transform: scaleX(-1);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #fbf7f7;
}

.chat-empty {
  margin: auto;
  max-width: 320px;
  text-align: center;
  color: #64748b;
}

.chat-day {
  align-self: center;
  margin: 0.6rem 0 0.3rem;
  padding: 0.15rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #f1dede;
  font-size: 0.75rem;
  color: #64748b;
}

/* Message bubbles: mine at the end side in red, theirs at the start side in white. */
.chat-bubble {
  max-width: min(78%, 520px);
  padding: 0.5rem 0.75rem 0.35rem;
  border-radius: 1.1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  overflow-wrap: anywhere;
}

.chat-bubble.mine {
  align-self: flex-end;
  background: var(--matjari-gradient);
  color: #fff;
  border-end-end-radius: 0.3rem;
}

.chat-bubble.theirs {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #f1dede;
  border-end-start-radius: 0.3rem;
}

.chat-text {
  white-space: pre-wrap;
}

.chat-meta {
  font-size: 0.68rem;
  opacity: 0.7;
  text-align: end;
  margin-top: 0.1rem;
}

.chat-product {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  padding: 0.35rem;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  text-decoration: none;
  max-width: 280px;
}

.chat-bubble.theirs .chat-product {
  background: var(--matjari-red-light);
}

.chat-product img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.chat-composer {
  border-top: 1px solid #f1dede;
  padding: 0.6rem 0.75rem;
  background: #fff;
}

.chat-about {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.7rem;
  background: var(--matjari-red-light);
}

.chat-about img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 0.45rem;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.chat-input-row textarea {
  resize: none;
  border-radius: 1.2rem;
  max-height: 140px;
}

.chat-send {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[dir="rtl"] .chat-send svg {
  transform: scaleX(-1);
}

@media (max-width: 575.98px) {
  .chat-window {
    height: calc(100vh - 150px);
    border-radius: 0.8rem;
  }
}
/* ---------- Category tabs: All / Men / Women / Children ---------- */
.audience-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 2px;
}

.audience-tab {
  flex-shrink: 0;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  border: 1px solid #f1dede;
  background: #fff;
  color: var(--matjari-red-dark);
  font-weight: 600;
  text-decoration: none;
}

.audience-tab:hover {
  background: var(--matjari-red-light);
}

.audience-tab.active {
  background: var(--matjari-gradient);
  border-color: transparent;
  color: #fff;
}
/* ---- Buy with a group (group deals) ---- */
.group-deal-card {
  border: 1px solid #fcd34d;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.group-prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.group-price {
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--matjari-red);
}

.group-strip .group-price {
  font-size: 1.05rem;
}

.open-group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-top: 1px dashed #fcd34d;
}

.group-kicker {
  color: #b45309;
  font-weight: 700;
}

.group-product-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.group-status-card .group-progress {
  height: 0.75rem;
}

.group-countdown {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  color: #b45309;
  font-weight: 600;
}

.group-members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.group-member {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--matjari-red-light);
  color: var(--matjari-red-dark);
  font-weight: 600;
}

.group-member.empty {
  background: #f3f4f6;
  color: #9ca3af;
  border: 1px dashed #d1d5db;
}

.group-steps {
  padding-inline-start: 1.2rem;
  margin: 0.75rem 0 0;
  color: #4b5563;
}

.group-fallback {
  background: #f9fafb;
  border-radius: 0.5rem;
  padding: 0.75rem 0.75rem 0.75rem 2.25rem;
}

[dir="rtl"] .group-fallback {
  padding: 0.75rem 2.25rem 0.75rem 0.75rem;
}

.group-strip-scroller {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
}

.group-strip-card {
  flex: 0 0 180px;
  scroll-snap-align: start;
  color: inherit;
  border: 1px solid #fcd34d;
  overflow: hidden;
}

.group-strip-card img,
.group-strip-noimg {
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.group-strip-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: #9ca3af;
}

.group-strip-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Reviews ---- */
.stars {
  letter-spacing: 1px;
  white-space: nowrap;
}

.stars .star-on {
  color: #f59e0b;
}

.stars .star-off {
  color: #d1d5db;
}

.rating-big {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.rating-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.rating-bar-row .progress {
  height: 0.5rem;
}

.rating-bar-row .progress-bar {
  background-color: #f59e0b;
}

.review-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

.pre-line {
  white-space: pre-line;
}

/* Star picker: radios in DOM order 5..1, shown 1..5 (row-reverse), hovering/checking lights the
   star and the ones before it. Works in both reading directions. */
.star-input {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 0.15rem;
}

.star-input input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.star-input label {
  font-size: 1.9rem;
  line-height: 1;
  color: #d1d5db;
  cursor: pointer;
}

.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label {
  color: #f59e0b;
}

.star-input input:focus-visible + label {
  outline: 2px solid var(--matjari-red-soft);
  border-radius: 4px;
}

.group-progress .progress-bar { background: var(--matjari-red); }

/* Bigger Matjari logo in the header */
.matjari-navbar .brand-logo {
  width: 48px;
  height: 48px;
}

.matjari-navbar .navbar-brand span {
  font-size: 1.6rem;
}

@media (max-width: 575.98px) {
  .matjari-navbar .brand-logo {
    width: 42px;
    height: 42px;
  }

  .matjari-navbar .navbar-brand span {
    font-size: 1.35rem;
  }
}

/* Site message box (replaces the browser's confirm/alert) */
.matjari-dialog {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.18);
}

.matjari-dialog .modal-footer .btn {
  min-width: 6.5rem;
}
