/* ==========================================================================
   Tafasilik custom CSS
   Brand: burgundy #480618 / rose #D4767A / cream #FFF6F3
   Order matters (cascade): sections are kept in their original order.
   1 Size guide | 2 Store layout fixes | 3 Information pages | 4 Footer currency label
   ========================================================================== */

/* ==========================================================================
   1. SIZE GUIDE  (product-page widget + dialog, built by custom.js TafasilikSize)
   ========================================================================== */

/* --- Widget and dialog shell --- */
.tf-size,
.tf-size-dialog {
  --tf-wine: #480618;
  --tf-accent: #681822;
  --tf-cream: #fcf8f5;
  --tf-blush: #f4e8e3;
  --tf-ink: #251b1d;
  --tf-muted: #6c5d62;
  --tf-line: #dcc9cb;
  --tf-radius: 12px;
  font-family: inherit;
  direction: rtl;
  color: var(--tf-ink);
  font-size: 16px;
  line-height: 1.7;
  text-align: right;
  box-sizing: border-box;
}
.tf-size *,
.tf-size-dialog * {
  box-sizing: border-box;
}
.tf-size {
  margin-block: 24px;
  padding: 20px;
  border: 1px solid var(--tf-line);
  border-radius: var(--tf-radius);
  background: var(--tf-cream);
  width: 100%;
  min-width: 0px;
}
.tf-size h3 {
  font-size: 20px;
  color: var(--tf-wine);
  margin: 0px 0px 12px;
}
.tf-size-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tf-size button,
.tf-size-dialog button,
.tf-size-dialog a.tf-btn {
  font: inherit;
  cursor: pointer;
  border-radius: var(--tf-radius);
  min-height: 48px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--tf-line);
  background: transparent;
  color: var(--tf-wine);
  text-decoration: none;
  touch-action: manipulation;
}
.tf-size button.tf-primary,
.tf-size-dialog .tf-primary {
  background: var(--tf-wine);
  color: var(--tf-cream);
  border-color: var(--tf-wine);
}
.tf-size-dialog {
  border: 1px solid var(--tf-line);
  border-radius: 20px;
  margin: auto;
  padding: 0px;
  width: min(900px, 100% - 32px);
  max-width: 100%;
  max-height: 90dvh;
  overflow: auto;
  background: var(--tf-cream);
  box-shadow: rgba(37, 2, 12, 0.25) 0px 24px 90px;
  overscroll-behavior: contain;
}
.tf-size-dialog::backdrop {
  background: rgba(35, 13, 23, 0.65);
  backdrop-filter: blur(4px);
}
.tf-size-dialog[open] {
  animation: 0.22s ease-out 0s 1 normal none running tf-enter;
}

/* --- Dialog header, body and cover --- */
.tf-top {
  position: sticky;
  top: 0px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--tf-cream);
  border-bottom: 1px solid var(--tf-line);
}
.tf-top h2 {
  font-size: 20px;
  margin: 0px;
  color: var(--tf-wine);
}
.tf-top button {
  width: 48px;
  flex-shrink: 0;
  font-size: 26px;
  padding: 0px;
}
.tf-body {
  padding: 24px;
  min-width: 0px;
}
.tf-cover {
  border-radius: var(--tf-radius);
  background: linear-gradient(125deg,var(--tf-wine),var(--tf-accent));
  padding: 24px;
  color: var(--tf-cream);
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.tf-cover h3 {
  color: inherit;
  font-size: 24px;
  line-height: 1.5;
  margin: 0px 0px 6px;
}
.tf-cover p {
  margin: 0px;
  font-size: 14px;
}
.tf-cover svg {
  width: 72px;
  height: 90px;
  flex-shrink: 0;
  stroke: currentcolor;
  fill: none;
  stroke-width: 1.5;
}

/* --- Toolbar, unit switch and size cards --- */
.tf-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-block: 16px;
}
.tf-segment {
  display: inline-flex;
  padding: 4px;
  background: var(--tf-blush);
  border-radius: var(--tf-radius);
  gap: 4px;
}
.tf-size-dialog .tf-segment button {
  min-height: 42px;
  padding: 6px 16px;
  border: 0px;
}
.tf-segment button[aria-pressed="true"] {
  background: var(--tf-wine);
  color: var(--tf-cream);
}
.tf-cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(195px, 26%);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 2px;
  padding: 4px 2px 16px;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--tf-accent) var(--tf-blush);
}
.tf-size-dialog .tf-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: right;
  padding: 20px;
  background: white;
  border: 1px solid var(--tf-line);
  scroll-snap-align: start;
  min-width: 0px;
  white-space: normal;
  color: var(--tf-ink);
  gap: 14px;
}
.tf-size-dialog .tf-card[aria-pressed="true"] {
  border: 2px solid var(--tf-wine);
  padding: 19px;
  background: var(--tf-blush);
}
.tf-card strong {
  font-size: 36px;
  color: var(--tf-wine);
  line-height: 1.2;
  font-weight: 600;
  direction: ltr;
  text-align: right;
}
.tf-card span {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--tf-muted);
}
.tf-card b {
  font-size: 20px;
  color: var(--tf-ink);
  font-weight: 500;
}

/* --- Notes, result and fit meter --- */
.tf-note {
  font-size: 13px;
  color: var(--tf-muted);
  line-height: 1.8;
  margin: 12px 0px;
}
.tf-note strong {
  color: var(--tf-accent);
}
.tf-result {
  padding: 24px;
  background: white;
  border: 1px solid var(--tf-line);
  border-radius: var(--tf-radius);
  margin-top: 20px;
  animation: 0.22s ease-out 0s 1 normal none running tf-enter;
}
.tf-result:empty {
  display: none;
}
.tf-result-size {
  display: block;
  font-size: 56px;
  line-height: 1.2;
  color: var(--tf-wine);
  margin: 8px 0px;
}
.tf-result p {
  margin: 8px 0px;
}
.tf-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.tf-result-actions > * {
  flex: 1 1 0%;
}
.tf-result .tf-note {
  font-size: 13px;
}
.tf-meter {
  margin-block: 14px;
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.tf-meter progress {
  width: 100%;
  height: 8px;
  accent-color: var(--tf-wine);
  direction: ltr;
}
.tf-meter small {
  display: flex;
  justify-content: space-between;
  direction: ltr;
}

/* --- Form fields, focus and disabled states --- */
.tf-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.tf-fields label {
  display: grid;
  gap: 8px;
  font-size: 15px;
}
.tf-fields input {
  width: 100%;
  min-width: 0px;
  border: 1px solid var(--tf-line);
  background: white;
  color: var(--tf-ink);
  border-radius: var(--tf-radius);
  padding: 12px;
  font-style: inherit;
  font-variant: inherit;
  font-weight: inherit;
  font-stretch: inherit;
  line-height: inherit;
  font-family: inherit;
  font-optical-sizing: inherit;
  font-size-adjust: inherit;
  font-kerning: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  font-language-override: inherit;
  font-size: 18px;
  min-height: 52px;
  direction: ltr;
  text-align: right;
}
.tf-size-dialog :focus-visible,
.tf-size :focus-visible {
  outline: 3px solid var(--tf-accent);
  outline-offset: 3px;
}
.tf-size-dialog button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.tf-size-dialog [hidden] {
  display: none !important;
}

/* --- Measuring guide --- */
.tf-measure {
  margin-block: 20px;
  border-top: 1px solid var(--tf-line);
  padding-top: 20px;
}
.tf-measure h3 {
  font-size: 20px;
  color: var(--tf-wine);
  margin: 0px 0px 16px;
}
.tf-measure-layout {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 24px;
  align-items: center;
}
.tf-measure svg {
  width: 100%;
  height: auto;
  max-height: 280px;
}
.tf-measure ol {
  padding-inline-start: 24px;
  margin: 0px;
}
.tf-measure li {
  margin-block: 12px;
  font-size: 14px;
}
.tf-measure li::marker {
  color: var(--tf-accent);
  font-weight: bold;
}

/* --- Utilities (empty, feedback, links, screen-reader) --- */
.tf-empty {
  min-height: 0px;
}
.tf-feedback {
  font-size: 14px;
  color: var(--tf-accent);
  margin-top: 12px;
}
.tf-size-dialog .tf-link {
  border: 0px;
  padding-inline: 0px;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.tf-size-dialog .tf-mode {
  width: 100%;
  margin-block: 18px;
}
.tf-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0px, 0px, 0px, 0px);
  white-space: nowrap;
  border: 0px;
}

/* --- Motion and responsive --- */
@keyframes tf-enter {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0px); }
}
@media (max-width: 600px) {
  .tf-size-dialog {
    margin: auto 0px 0px;
    width: 100%;
    max-height: 94dvh;
    border-radius: 20px 20px 0px 0px;
    border-bottom: 0px;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tf-body {
    padding: 18px;
  }
  .tf-top {
    padding: 12px 18px;
  }
  .tf-cover {
    padding: 20px;
    gap: 14px;
  }
  .tf-cover h3 {
    font-size: 22px;
  }
  .tf-cover svg {
    width: 52px;
  }
  .tf-cards {
    grid-auto-columns: 76%;
  }
  .tf-size {
    padding: 16px;
  }
  .tf-size-actions button {
    padding: 10px 8px;
    font-size: 14px;
  }
  .tf-measure-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .tf-measure svg {
    height: 210px;
  }
  .tf-result {
    padding: 18px;
  }
  .tf-fields {
    gap: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tf-size-dialog[open],
  .tf-result {
    animation: auto ease 0s 1 normal none running none;
  }
  .tf-cards {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   2. STORE LAYOUT FIXES
   ========================================================================== */

/* --- Product page: buy form above the description --- */
.main-content:has(> form.product-form) {
  display: flex;
  flex-direction: column;
}
.main-content:has(> form.product-form) > p,
.main-content:has(> form.product-form) > h2:not(.product-entry__sub-title),
.main-content:has(> form.product-form) > h3,
.main-content:has(> form.product-form) > h4,
.main-content:has(> form.product-form) > ul,
.main-content:has(> form.product-form) > ol,
.main-content:has(> form.product-form) > blockquote {
  order: 10;
}

/* --- Footer: hide the categories column when it is empty --- */
.footer-col:has(> #footer-categories-list:empty) {
  display: none !important;
}

/* --- Footer: pinned to the bottom of the viewport --- */
.app-inner {
  min-height: 100dvh;
}
.app-inner > main {
  flex: 1 0 auto;
}

/* --- Product page: hide the similar-products block --- */
.s-block--bundle-similar-products,
main > .container:has(> salla-products-slider[source="related"]) {
  display: none !important;
}

/* --- Size guide: hide measuring help inside the dialog --- */
#tf-size-dialog #tf-measure,
#tf-size-dialog [data-help] {
  display: none !important;
}

/* --- Information pages: hide the duplicate page title --- */
.content--single-page:has(#tf-lp) > h1 {
  display: none;
}
.content--single-page:has(.tfp) > h1 {
  display: none;
}

/* ==========================================================================
   3. INFORMATION PAGES  (.tfp, About / Contact / Shipping / Terms)
   ========================================================================== */

/* --- Base --- */
.tfp {
  max-width: 860px;
  margin: 0px auto;
  direction: rtl;
  color: rgb(37, 27, 29);
  line-height: 1.9;
  font-family: inherit;
}
.tfp * {
  box-sizing: border-box;
}
.tfp a {
  text-decoration: none;
}

/* --- Hero --- */
.tfp-hero {
  background: linear-gradient(135deg, rgb(72, 6, 24), rgb(107, 18, 40));
  color: rgb(255, 255, 255);
  border-radius: 24px;
  padding: 34px 28px;
  margin-bottom: 22px;
  text-align: center;
}
.tfp-hero .k {
  display: inline-block;
  background: rgba(212, 118, 122, 0.25);
  color: rgb(246, 201, 203);
  border-radius: 999px;
  padding: 3px 14px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.tfp-hero h2 {
  color: rgb(255, 255, 255);
  margin: 0px 0px 8px;
  font-size: 1.9rem;
  line-height: 1.4;
}
.tfp-hero p {
  color: rgb(243, 220, 220);
  margin: 0px;
}

/* --- Stats strip --- */
.tfp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.tfp-stats div {
  background: rgb(255, 246, 243);
  border: 1px solid rgb(240, 220, 216);
  border-radius: 16px;
  padding: 16px 10px;
  text-align: center;
  font-weight: 800;
  color: rgb(72, 6, 24);
}
.tfp-stats span {
  display: block;
  font-weight: 400;
  color: rgb(122, 106, 108);
  font-size: 0.85rem;
}

/* --- Cards --- */
.tfp-card {
  background: rgb(255, 255, 255);
  border-width: 1px 5px 1px 1px;
  border-style: solid;
  border-color: rgb(234, 217, 214) rgb(212, 118, 122) rgb(234, 217, 214) rgb(234, 217, 214);
  border-image: none;
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 12px;
}
.tfp-card h3 {
  margin: 0px 0px 6px;
  color: rgb(72, 6, 24);
  font-size: 1.15rem;
}
.tfp-card p {
  margin: 4px 0px;
}
.tfp-card ul {
  list-style: none;
  margin: 6px 0px 0px;
  padding: 0px;
}
.tfp-card li {
  position: relative;
  padding: 3px 18px 3px 0px;
}
.tfp-card li::before {
  content: "";
  position: absolute;
  right: 0px;
  top: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(212, 118, 122);
}
.tfp-card a,
.tfp details a {
  color: rgb(72, 6, 24);
  font-weight: 700;
}

/* --- Contact link grid --- */
.tfp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.tfp-link {
  display: block;
  text-align: center;
  padding: 18px 12px;
  border-radius: 16px;
  background: rgb(72, 6, 24);
  font-weight: 800;
  color: rgb(255, 255, 255) !important;
}
.tfp-link.alt {
  background: rgb(255, 246, 243);
  border: 1px solid rgb(240, 220, 216);
  color: rgb(72, 6, 24) !important;
}
.tfp-link small {
  display: block;
  font-weight: 400;
  opacity: 0.85;
  direction: ltr;
}

/* --- FAQ / details --- */
.tfp details {
  background: rgb(255, 255, 255);
  border: 1px solid rgb(234, 217, 214);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.tfp summary {
  cursor: pointer;
  font-weight: 800;
  color: rgb(72, 6, 24);
}
.tfp details ul {
  list-style: none;
  margin: 8px 0px 0px;
  padding: 0px;
}
.tfp details li {
  position: relative;
  padding: 3px 18px 3px 0px;
}
.tfp details li::before {
  content: "";
  position: absolute;
  right: 0px;
  top: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(212, 118, 122);
}

/* --- Note --- */
.tfp-note {
  text-align: center;
  color: rgb(122, 106, 108);
  font-size: 0.9rem;
  margin-top: 14px;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .tfp-stats,
  .tfp-grid {
    grid-template-columns: 1fr;
  }
  .tfp-hero {
    padding: 26px 18px;
  }
  .tfp-hero h2 {
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   4. FOOTER: CURRENCY LABEL
   ========================================================================== */
.switcher-label {
  font-size: 0px !important;
}
.switcher-label::after {
  content: "العملة";
  font-size: 10px;
}

/* --- Product page: description blocks (cards, size table, guarantee box) also sit below the buy form --- */
.main-content:has(> form.product-form) > div[style],
.main-content:has(> form.product-form) > table {
  order: 10;
}

/* --- Product page: size/option chips (built by the script in custom JS) --- */
.tf-sel-hidden { display: none !important; }
.tf-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.tf-chip {
  min-width: 56px; height: 44px; padding: 0 16px;
  border: 1.5px solid #ecd2cf; border-radius: 12px;
  background: #fff; color: #480618;
  font: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all .18s ease;
}
.tf-chip:hover { border-color: #D4767A; }
.tf-chip.is-on {
  background: #480618; border-color: #480618; color: #FFF6F3;
  box-shadow: 0 6px 14px rgba(72, 6, 24, .22);
}
.tf-chip:disabled { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
/* Hide Salla's empty size-guide box (we use our own size guide) */
section:has(> salla-product-size-guide:empty) { display: none; }
/* Product page: less text above the buy block, no Apple Pay button */
.main-content:has(> form.product-form) > .product-entry__sub-title { display: none; }
apple-pay-button { display: none !important; }

/* --- Product page: similar-products cards (no empty stars, full buy-now button) --- */
.H_look_banner .look-product-card salla-rating-stars { display: none !important; }
.H_look_banner .look-card-add-btn { width: auto !important; min-width: 96px; flex: 0 0 auto; padding-inline: 8px; }
.H_look_banner .look-card-add-btn .s-add-product-button-main { align-items: center; justify-content: center; gap: 8px; }
.H_look_banner .look-card-add-btn salla-mini-checkout-widget,
.H_look_banner .look-card-add-btn .s-add-product-button-mini-checkout-content { width: auto !important; min-width: 0; overflow: visible !important; white-space: nowrap; }

/* --- Homepage: "why choose" category strip - bigger cards, less empty space (desktop) --- */
@media (min-width: 768px) {
  .H_special_categories { padding-block: 56px !important; }
  .H_special_categories .hsc-strip { gap: 24px; justify-content: center; }
  .H_special_categories .hsc-card { width: 280px !important; flex: 0 0 280px !important; }
  .H_special_categories .hsc-card__frame { width: 100% !important; aspect-ratio: 3 / 4; height: auto !important; }
}

/* --- Product page: similar-products block on phones (tidy row cards, no stray background image) --- */
@media (max-width: 767px) {
  .H_look_banner .pointer-events-none.absolute.left-0 { display: none !important; }
  .H_look_banner .look-card-add-btn { min-width: 0; }
  .H_look_banner .look-card-add-btn .s-add-product-button-main { flex-direction: row-reverse; gap: 6px; }
}

/* --- Product cards (home + lists): full-bleed 4:5 photos, readable badge, centered grid --- */
.s-block .s-products-list-wrapper.s-products-list-vertical-cards { grid-template-columns: repeat(auto-fit, minmax(220px, 300px)) !important; justify-content: center; gap: 20px; }
.s-product-card-vertical .s-product-card-image { aspect-ratio: 4 / 5; }
.s-product-card-vertical .s-product-card-image img.s-product-card-image-contain { object-fit: cover !important; }
.s-product-card-vertical .s-product-card-image .absolute.top-2.left-2 > div { max-width: none !important; padding: 4px 10px; font-size: 12px; }