:root {
  --aj-canvas: #F7F6F1;   /* page */
  --aj-surface: #FFFFFF;  /* cards, panels */
  --aj-cream: #F2F3EE;    /* quiet bands, footer */
  --aj-ink: #141414;      /* headings, prices */
  --aj-body: #2F3437;     /* body copy */
  --aj-muted: #6F6A62;    /* secondary copy */
  --aj-line: #E4DFD6;     /* hairlines */
  --aj-line-strong: #D3CCBF;
  --aj-blue: #1E247B;     /* brand / primary action */
  --aj-blue-h: #161B5E;
  --aj-info: #E8E9F4;     /* pale brand tint */
  --aj-sale: #9F2F2D;
  --aj-sale-bg: #FDEBEC;

  --aj-r-card: 16px;
  --aj-r-field: 12px;
  --aj-r-btn: 980px;      /* Apple-style pill actions */
  --aj-ease: cubic-bezier(.16, 1, .3, 1);
  --aj-lift: 0 10px 30px -12px rgba(20, 20, 20, .14);
  --aj-display: 'Markazi Text', var(--font-main), serif;

  /* keep Salla components on brand */
  --color-primary: var(--aj-blue);
  --color-primary-dark: var(--aj-blue-h);
  --color-primary-light: var(--aj-info);
  --color-primary-reverse: #FFFFFF;
}

/* ---------- Base & browser surfaces ---------- */
html { -webkit-tap-highlight-color: transparent; text-rendering: optimizeLegibility; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  background-color: var(--aj-canvas) !important;
  color: var(--aj-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  accent-color: var(--aj-blue);
  caret-color: var(--aj-blue);
}

::selection { background: var(--aj-info); color: var(--aj-ink); }

* { scrollbar-width: thin; scrollbar-color: var(--aj-line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--aj-line-strong); border-radius: 10px; border: 3px solid var(--aj-canvas); }
::-webkit-scrollbar-track { background: transparent; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--aj-blue) !important;
  outline-offset: 3px;
  border-radius: 8px;
}

a { text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* prices & figures line up */
.s-product-card-price, .s-product-card-sale-price, .total-price, .before-price,
.item-total, .item-price, .item-regular-price, salla-cart-summary-card, .s-quantity-input-input {
  font-variant-numeric: tabular-nums;
}

/* Arabic is never tracked; Latin display is tightened */
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { letter-spacing: 0 !important; }

/* ---------- Header: frosted, hairline, no shadow ---------- */
.store-header .top-navbar {
  background: var(--aj-cream) !important;
  border-bottom: 1px solid var(--aj-line);
  font-size: 13px;
  color: var(--aj-muted);
}
.store-header .main-nav-container {
  box-shadow: none !important;
  background: transparent !important;
}
.store-header .main-nav-container .inner {
  background: rgba(255, 255, 255, .8) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(20, 20, 20, .06);
  transition: border-color .3s var(--aj-ease), background-color .3s var(--aj-ease);
}
.aj-scrolled .store-header .main-nav-container .inner {
  background: rgba(255, 255, 255, .72) !important;
  border-bottom-color: var(--aj-line);
}
.store-header .navbar-brand img { max-height: 44px; width: auto; }
.store-header .header-btn__icon,
.store-header .sicon-menu { color: var(--aj-ink) !important; }

/* search field: calm, roomy */
.header-search input,
salla-search input {
  background: var(--aj-canvas) !important;
  border: 1px solid transparent !important;
  border-radius: var(--aj-r-btn) !important;
  min-height: 44px;
  font-size: 16px;
  transition: border-color .2s var(--aj-ease), background-color .2s var(--aj-ease);
}
.header-search input:focus,
salla-search input:focus {
  background: #fff !important;
  border-color: var(--aj-line-strong) !important;
}

/* cart count feedback (set by JS) */
salla-cart-summary.aj-bump { animation: aj-bump .5s var(--aj-ease); }
@keyframes aj-bump { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ---------- Section titles (homepage blocks) ---------- */
.s-block__title h2,
.s-block__title .s-block__title-content h2 {
  font-family: var(--aj-display) !important;
  font-weight: 600 !important;
  font-size: clamp(1.75rem, 1.25rem + 1.9vw, 2.625rem) !important;
  line-height: 1.25 !important;
  color: var(--aj-ink) !important;
  text-wrap: balance;
}
.s-block__title p { color: var(--aj-muted); font-size: 15px; line-height: 1.7; }
.s-block__display-all {
  white-space: nowrap;
  color: var(--aj-blue) !important;
  font-weight: 600;
  font-size: 15px;
}
.s-block__display-all:hover { text-decoration: underline; }
.s-block { margin-block: clamp(40px, 6vw, 88px) !important; }

/* homepage HTML blocks: same pill action as the rest of the store */
.ajx .ajx-btn { border-radius: var(--aj-r-btn) !important; padding-inline: 28px !important; }

/* ---------- Buttons ---------- */
.s-button-element,
.btn {
  border-radius: var(--aj-r-btn) !important;
  font-weight: 600;
  letter-spacing: 0;
  transition: background-color .2s var(--aj-ease), color .2s var(--aj-ease),
              border-color .2s var(--aj-ease), transform .12s var(--aj-ease) !important;
}
.s-button-element:active:not(:disabled),
.btn:active { transform: scale(.98); }

.s-button-primary.s-button-solid,
.btn--primary {
  background-color: var(--aj-blue) !important;
  border-color: var(--aj-blue) !important;
  color: #fff !important;
  box-shadow: none !important;
}
.s-button-primary.s-button-solid:hover:not(:disabled),
.btn--primary:hover { background-color: var(--aj-blue-h) !important; border-color: var(--aj-blue-h) !important; }

.s-button-primary.s-button-outline,
.btn--outline-primary {
  background: transparent !important;
  border: 1px solid var(--aj-blue) !important;
  color: var(--aj-blue) !important;
}
.s-button-primary.s-button-outline:hover:not(:disabled),
.btn--outline-primary:hover { background: var(--aj-info) !important; }

.s-button-element:disabled,
.s-button-element[disabled] { opacity: .45; cursor: not-allowed; }

/* the main purchase buttons are generous touch targets */
salla-add-product-button .s-button-element,
.sticky-product-bar__btn .s-button-element,
salla-cart-summary-card .s-button-element,
salla-quick-order .s-button-element {
  min-height: 52px;
  font-size: 16px !important;
}

/* ---------- Product card ---------- */
.s-product-card-entry {
  background: var(--aj-surface) !important;
  border: 1px solid var(--aj-line) !important;
  border-radius: var(--aj-r-card) !important;
  box-shadow: none !important;
  overflow: hidden;
  transition: border-color .3s var(--aj-ease), box-shadow .4s var(--aj-ease), transform .4s var(--aj-ease);
}
@media (hover: hover) {
  .s-product-card-entry:hover {
    border-color: var(--aj-line-strong) !important;
    box-shadow: var(--aj-lift) !important;
    transform: translateY(-2px);
  }
  .s-product-card-entry:hover .s-product-card-image img { transform: scale(1.04); }
}
.s-product-card-image {
  background: #fff !important;
  overflow: hidden;
  border-radius: 0 !important;
}
.s-product-card-image img { transition: transform .8s var(--aj-ease), opacity .5s var(--aj-ease); }

.s-product-card-content { padding: 16px 16px 18px !important; }
.s-product-card-content-title,
.s-product-card-content-title a {
  color: var(--aj-ink) !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.6 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.s-product-card-content-title a { text-decoration: none !important; }
.s-product-card-content-title a:hover { color: var(--aj-blue) !important; }
.s-product-card-content-subtitle { color: var(--aj-muted) !important; font-size: 13px !important; }

.s-product-card-price { color: var(--aj-ink) !important; font-weight: 700 !important; font-size: 16px !important; }
.s-product-card-sale-price h4,
.s-product-card-sale-price > :first-child { color: var(--aj-sale) !important; font-weight: 700 !important; }
.s-product-card-sale-price span { color: var(--aj-muted) !important; font-weight: 400; }
.s-product-card-starting-price { color: var(--aj-muted) !important; }

.s-product-card-content-footer { margin-top: 12px; }
.s-product-card-content-footer .s-button-element { min-height: 44px; width: 100%; }

/* badges */
.s-product-card-promotion-title {
  background: var(--aj-info) !important;
  color: var(--aj-blue) !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
  inset-inline-start: 12px !important;
  top: 12px !important;
  box-shadow: none !important;
}
.s-product-card-out-badge {
  background: rgba(255, 255, 255, .92) !important;
  color: var(--aj-muted) !important;
  border: 1px solid var(--aj-line);
  border-radius: 999px !important;
  font-size: 12px !important;
}
.s-product-card-out-of-stock .s-product-card-image img { filter: grayscale(.6); opacity: .7; }

/* wishlist on card */
.s-product-card-wishlist-btn {
  background: rgba(255, 255, 255, .9) !important;
  border: 1px solid var(--aj-line) !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  color: var(--aj-ink) !important;
}
.s-product-card-wishlist-added { color: var(--aj-sale) !important; }

/* reveal (classes set by JS only, so no-JS shows everything) */
@media (prefers-reduced-motion: no-preference) {
  .aj-rv { opacity: 0; transform: translateY(14px); }
  .aj-rv.aj-in {
    opacity: 1; transform: none;
    transition: opacity .7s var(--aj-ease), transform .7s var(--aj-ease);
    transition-delay: calc(var(--aj-i, 0) * 70ms);
  }
  .aj-img-pending { opacity: 0; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs, salla-breadcrumb { font-size: 13px; color: var(--aj-muted); }
salla-breadcrumb a { color: var(--aj-muted) !important; }
salla-breadcrumb a:hover { color: var(--aj-ink) !important; }

/* ---------- Product page ---------- */
.container--product-details { padding-block-end: 24px; }

.details-slider {
  background: #fff !important;
  border: 1px solid var(--aj-line);
  border-radius: 20px !important;
  overflow: hidden;
}
.details-slider [slot="thumbs"] img,
.details-slider .slide--one-fourth img {
  border-radius: 10px !important;
  border: 1px solid var(--aj-line);
  background: #fff !important;
  transition: border-color .2s var(--aj-ease);
}
.details-slider .swiper-slide-thumb-active img { border-color: var(--aj-ink) !important; }

[data-testid="store-product-title"] {
  font-family: var(--aj-display) !important;
  font-weight: 600 !important;
  font-size: clamp(1.875rem, 1.35rem + 2vw, 2.75rem) !important;
  line-height: 1.2 !important;
  color: var(--aj-ink) !important;
  text-wrap: balance;
  margin-bottom: 8px;
}
.product-entry__sub-title { color: var(--aj-muted) !important; font-size: 16px !important; line-height: 1.6; }

[data-testid="store-product-price"] p,
.total-price { color: var(--aj-ink) !important; font-size: 1.5rem !important; font-weight: 700 !important; }
[data-testid="store-product-price"] .text-red-800,
.price_is_on_sale .total-price { color: var(--aj-sale) !important; }
.before-price, [data-testid="store-product-price"] .line-through { color: var(--aj-muted) !important; font-size: 1rem !important; }

.product__description { color: var(--aj-body); font-size: 16px; line-height: 1.85; }
.product__description .article { max-width: 68ch; }
#btn-show-more { color: var(--aj-blue) !important; font-weight: 600; }

/* panels in the buy column */
.main-content section.bg-white,
.product-form > section,
.product-form .bg-white.rounded-md {
  background: var(--aj-surface) !important;
  border: 1px solid var(--aj-line);
  border-radius: var(--aj-r-card) !important;
  box-shadow: none !important;
}
.product-form .form-label { color: var(--aj-ink); font-weight: 600; font-size: 15px; }

/* options & fields */
.s-product-options-option-label,
.s-product-options-option-label b { color: var(--aj-ink) !important; font-weight: 600 !important; font-size: 15px !important; }
.s-form-control,
.form-input, select, textarea,
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="search"] {
  border-radius: var(--aj-r-field) !important;
  border-color: var(--aj-line) !important;
  font-size: 16px !important; /* prevents iOS zoom */
  transition: border-color .2s var(--aj-ease), box-shadow .2s var(--aj-ease);
}
.s-form-control:focus, select:focus, textarea:focus, input:focus {
  border-color: var(--aj-blue) !important;
  box-shadow: 0 0 0 3px var(--aj-info) !important;
}

/* quantity stepper */
.s-quantity-input-container {
  border: 1px solid var(--aj-line) !important;
  border-radius: var(--aj-r-btn) !important;
  background: #fff !important;
  overflow: hidden;
}
.s-quantity-input-button { color: var(--aj-ink) !important; min-width: 40px; min-height: 40px; border: 0 !important; background: transparent !important; }
.s-quantity-input-button:hover { background: var(--aj-canvas) !important; }
.s-quantity-input-input { font-weight: 600; color: var(--aj-ink) !important; border: 0 !important; box-shadow: none !important; }

/* mobile purchase bar: frosted, safe-area aware */
@media (max-width: 767px) {
  .sticky-product-bar {
    background: rgba(255, 255, 255, .9) !important;
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--aj-line);
    padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  }
}

/* WhatsApp help line under add-to-cart (inserted by JS) */
.aj-help {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 12px 16px;
  border: 1px solid var(--aj-line); border-radius: var(--aj-r-field);
  background: var(--aj-canvas);
  color: var(--aj-body) !important; text-decoration: none !important;
  font-size: 14px; line-height: 1.5;
  transition: border-color .2s var(--aj-ease), background-color .2s var(--aj-ease);
}
.aj-help:hover { border-color: var(--aj-line-strong); background: #fff; }
.aj-help svg { flex: none; width: 20px; height: 20px; color: var(--aj-blue); }
.aj-help b { color: var(--aj-blue); font-weight: 600; }

/* ---------- Cart ---------- */
.cart-item {
  background: var(--aj-surface) !important;
  border: 1px solid var(--aj-line);
  border-radius: var(--aj-r-card) !important;
  box-shadow: none !important;
}
.cart-item img { border-radius: 10px !important; border-color: var(--aj-line) !important; background: #fff; }
.cart-item .item-total, .cart-item .text-primary { color: var(--aj-ink) !important; }
.btn--delete .s-button-element { color: var(--aj-muted) !important; }
.btn--delete .s-button-element:hover { color: var(--aj-sale) !important; background: var(--aj-sale-bg) !important; }

#free-shipping,
salla-cart-summary-card,
salla-cart-coupons,
salla-loyalty-panel {
  display: block;
  background: var(--aj-surface);
  border: 1px solid var(--aj-line);
  border-radius: var(--aj-r-card);
  box-shadow: none !important;
}
#free-shipping-bar { border-radius: 999px; overflow: hidden; background: var(--aj-cream) !important; }
#free-shipping-bar > * { background: var(--aj-blue) !important; border-radius: 999px; }

.no-content-placeholder { padding-block: clamp(48px, 10vw, 120px); color: var(--aj-muted); }
.no-content-placeholder .icon { color: var(--aj-line-strong) !important; font-size: 56px; }

/* ---------- Modals & toasts ---------- */
.s-modal-body, .s-modal-container > div { border-radius: 20px !important; }
.s-modal-overlay, .s-modal-bg { background: rgba(20, 20, 20, .32) !important; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* ---------- Footer ---------- */
.store-footer, .store-footer__inner {
  background: var(--aj-cream) !important;
  color: var(--aj-muted) !important;
}
.store-footer { border-top: 1px solid var(--aj-line); margin-top: clamp(48px, 8vw, 96px); }
.store-footer__inner { padding-block: clamp(40px, 6vw, 64px) !important; }
.store-footer a { color: var(--aj-body) !important; }
.store-footer a:hover { color: var(--aj-ink) !important; }
.store-footer h3, .store-footer .s-contacts-title, .store-footer .s-menu-footer-title { color: var(--aj-ink) !important; font-weight: 600; font-size: 15px; }
.store-footer .copyright-text { color: var(--aj-muted) !important; font-size: 12px; }
.store-footer > div:last-child { border-top: 1px solid var(--aj-line); }

/* ---------- Motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}