/* ─── Existing store styles (announcement bar) ───
   Carried over from the previous theme version. Salla does NOT copy
   custom code when a version is cloned, so this had to be re-added by
   hand — do not delete it. The Magla size calculator starts below. */
.s-alert__content {
    display: inline-block !important;
    white-space: nowrap !important;
    animation: samarMove 12s linear infinite;
    padding-left: 100%;
    will-change: transform;
}

.s-alert {
    overflow: hidden !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
}

@keyframes samarMove {
    0% {
        transform: translate3d(0,0,0);
    }
    100% {
        transform: translate3d(-100%,0,0);
    }
}

@media (max-width: 768px) {
    .s-alert {
        height: 28px !important;
    }

    .s-alert__content {
        font-size: 11px !important;
        animation: samarMove 8s linear infinite;
    }
}


/* ── Magla Size Calculator ─────────────────────────────── */

  /* ⚠️ HARIR FONT — NOT ACTIVE YET. Deliberately commented out.
     ────────────────────────────────────────────────────────────
     TO TURN HARIR ON (2 steps):
       1. Upload harir-regular.woff2 + harir-bold.woff2 somewhere public
          (Salla file manager → copy link, or any CDN).
       2. Delete the two comment markers below, then paste each URL in
          place of PASTE_..._HERE.

     Why it's commented out rather than left with placeholder URLs:
     a placeholder is not a valid address, so the browser would request
     it and get a 404 on EVERY product page view — two wasted requests
     per visitor, and the font silently never loads anyway. Commented
     out, the widget cleanly uses the theme font until you fill this in.

  @font-face {
    font-family: 'Harir';
    src: url('PASTE_HARIR_REGULAR_WOFF2_URL_HERE') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
  }
  @font-face {
    font-family: 'Harir';
    src: url('PASTE_HARIR_BOLD_WOFF2_URL_HERE') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
  }
  */

  :root {
    --mgla-primary: #000000;        /* Magla brand black */
    --mgla-accent:  #000000;        /* monochrome — matches approved cards */
    --mgla-bg:      #ffffff;
    --mgla-soft:    #f7f5f3;        /* neutral off-white panels */
    --mgla-text:    #111111;
    --mgla-muted:   #8a8a8a;
    --mgla-rule:    #c9c9c9;        /* divider gray from the approved cards */
    --mgla-radius:  14px;
    --mgla-pad:     24px;           /* single source of truth for side padding */
    /* Harir for Arabic. Harir has NO Latin glyphs, so Latin (XS/S/M/L…)
       falls through to the sans below — same as the approved mockups. */
    --mgla-font:    'Harir', 'Helvetica Neue', Arial, sans-serif;
    --mgla-latin:   'Helvetica Neue', Arial, sans-serif;
  }

  /* Product-page trigger button.
     Full-width by design: it's injected directly above the product options
     inside Selia's product <form>, so width:100% makes it line up exactly
     with the add-to-cart button and the options below it — no guessing at
     pixel widths, it inherits whatever column the theme gives it.
     box-sizing is set here too because this button lives OUTSIDE .mgla-drawer,
     so the drawer's global box-sizing rule doesn't reach it. */
  .mgla-size-btn {
    box-sizing: border-box;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; margin: 12px 0; padding: 14px 18px;
    background: var(--mgla-primary); color: #fff;
    border: 1.5px solid var(--mgla-primary); border-radius: 999px;
    font-family: var(--mgla-font); font-size: 15px; font-weight: 700;
    line-height: 1.2; text-align: center;
    cursor: pointer; transition: background .18s ease, color .18s ease;
    -webkit-tap-highlight-color: transparent;   /* no grey flash on iOS tap */
  }
  /* Inverts on hover. Pointer-only: on touch screens :hover sticks after a
     tap and would leave the button stranded in the inverted state. */
  @media (hover: hover) {
    .mgla-size-btn:hover { background: #fff; color: var(--mgla-primary); }
  }
  .mgla-size-btn:active { opacity: .9; }
  .mgla-size-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

  /* Mobile: most KSA traffic. Comfortable tap target (48px+ tall) without
     the button turning into a slab. */
  @media (max-width: 480px) {
    .mgla-size-btn { padding: 15px 16px; font-size: 15px; margin: 10px 0; }
    .mgla-size-btn svg { width: 17px; height: 17px; }
  }
  /* Desktop: no width cap on purpose. The button is injected into Selia's
     product <form>, which IS the product column (measured: 613px on a
     1280px viewport), so width:100% makes it span the column exactly.
     Selia's own add-to-cart looks narrower only because it sits inside a
     padded card (.sticky-product-bar has p-5), not because the column is
     narrower — capping this to match that inset would misalign it with
     everything else in the form. */

  /* z-index note: the live store has third-party widgets pinned at the
     maximum possible value (2147483647) — the Google review badge sits
     there. At the old value of 99999 they rendered ON TOP of the drawer
     and covered its footer. The drawer now matches that ceiling; because
     it is appended last, it wins the tie. The badge is also hidden while
     the drawer is open (see .mgla-drawer-open below) so nothing floats
     over the panel on mobile. */
  .mgla-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
    z-index: 2147483646;
  }
  .mgla-overlay.open { opacity: 1; pointer-events: auto; }

  /* While the drawer is open: freeze the page behind it and get the
     floating third-party badges out of the way. Both revert on close. */
  html.mgla-drawer-open, body.mgla-drawer-open { overflow: hidden; }
  body.mgla-drawer-open #___ratingbadge_0,
  body.mgla-drawer-open #___ratingbadge_1,
  body.mgla-drawer-open .wa-selia { display: none !important; }

  /* Every widget box measures border-to-border, so nothing can push the
     drawer wider than itself. Without this the number fields overflow and
     the browser adds a horizontal scrollbar. */
  .mgla-drawer, .mgla-drawer * { box-sizing: border-box; }

  .mgla-drawer {
    position: fixed; top: 0; bottom: 0; right: -420px; width: 400px; max-width: 92vw;
    background: var(--mgla-bg); z-index: 2147483647; direction: rtl;
    font-family: var(--mgla-font); color: var(--mgla-text);
    box-shadow: -8px 0 40px rgba(0,0,0,.18);
    transition: right .3s cubic-bezier(.25,.8,.25,1);
    display: flex; flex-direction: column;
    overflow-y: auto; overflow-x: hidden;   /* kills the sideways slider */
  }
  .mgla-drawer.open { right: 0; }

  .mgla-dh {
    padding: 22px var(--mgla-pad) 18px; background: var(--mgla-soft);
    border-bottom: 1px solid #ece8e3; position: relative;
  }
  .mgla-dh h3 { margin: 0 0 4px; font-size: 20px; font-weight: 800; color: var(--mgla-primary); }
  .mgla-dh p  { margin: 0; font-size: 13px; color: var(--mgla-muted); }
  .mgla-close {
    position: absolute; top: 16px; left: 16px; width: 32px; height: 32px;
    border: none; background: transparent; font-size: 20px; cursor: pointer; color: var(--mgla-muted);
  }

  .mgla-body { padding: 20px var(--mgla-pad); flex: 1; min-width: 0; }

  /* Stacked, not a side-by-side row: dress names are long and would
     otherwise force the drawer wider than its own width. */
  .mgla-product-tag {
    background: var(--mgla-soft); border-radius: 10px;
    padding: 10px 14px; margin-bottom: 16px; min-width: 0;
  }
  .mgla-product-tag span {
    display: block; font-size: 11.5px; color: var(--mgla-muted); margin-bottom: 3px;
  }
  .mgla-product-tag b {
    display: block; color: var(--mgla-primary); font-size: 13.5px; line-height: 1.5;
    overflow-wrap: anywhere;            /* long names wrap, never overflow */
  }

  .mgla-guide {
    display: flex; gap: 14px; align-items: center;
    background: var(--mgla-soft); border-radius: var(--mgla-radius);
    padding: 16px; margin-bottom: 18px;
  }
  .mgla-guide svg { flex: 0 0 84px; }
  /* embedded body-figure diagram (WebP) */
  .mgla-diagram { flex: 0 0 92px; width: 92px; height: auto; display: block; }
  .mgla-guide-item { margin-bottom: 10px; }
  .mgla-guide-item:last-child { margin-bottom: 0; }
  .mgla-guide-item b {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 14px; color: var(--mgla-primary);
  }
  /* Numbered legend pill. Three things force the digit dead-center:
     - Latin font (Harir's digit glyphs sit high in the em box and
       pushed "1" and "2" to the top-right of the circle)
     - line-height: 1 so the character box matches the pill height
     - vertical-align: middle so the pill itself doesn't ride above
       the الصدر / الخصر baseline */
  .mgla-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--mgla-accent); color: #fff;
    font-family: var(--mgla-latin);
    font-size: 12px; font-weight: 700;
    /* line-height matches pill height so the glyph's line box is exactly
       the container — no ascender space bleeding above the circle */
    line-height: 20px;
    vertical-align: middle;
    text-align: center;
    flex: 0 0 auto;
  }
  /* Description under الصدر / الخصر — DIRECT child only, so this rule
     doesn't reach the .mgla-num digit span nested inside the <b>.
     Solid black for readability against the off-white guide panel. */
  .mgla-guide-item > span {
    display: block; font-size: 12px; color: var(--mgla-primary);
    font-weight: 400; margin-top: 2px;
  }

  /* Section header above the input fields — inline-block so the
     border-bottom hugs the text width (that's the "mini" divider). */
  .mgla-fields-header {
    display: inline-block;
    font-size: 13px; font-weight: 700; color: var(--mgla-text);
    margin: 0 0 12px; padding-bottom: 6px;
    border-bottom: 1px solid #d9d9d9;
  }

  /* Inches only — no cm/inch toggle. Kept the unit label styling
     consolidated inside .mgla-field below. */
  .mgla-fields { display: flex; gap: 12px; margin-bottom: 16px; }
  /* min-width:0 lets the two fields actually share the row instead of each
     insisting on its natural input width and blowing past the drawer edge */
  .mgla-field { flex: 1 1 0; min-width: 0; }
  .mgla-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
  .mgla-field label i {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--mgla-accent); margin-left: 4px; font-style: normal;
  }
  .mgla-field .wrap {
    display: flex; align-items: center; border: 1.5px solid #e2e2e2;
    border-radius: 10px; padding: 0 12px; transition: border-color .15s;
  }
  .mgla-field .wrap:focus-within { border-color: var(--mgla-primary); }
  .mgla-field input {
    flex: 1 1 0; min-width: 0; width: 100%;
    border: none; outline: none; padding: 12px 4px;
    font-family: var(--mgla-font); font-size: 15px; background: transparent; text-align: right;
    -moz-appearance: textfield;          /* strip Firefox spinner */
  }
  /* strip the WebKit spinner arrows — they add dead width and look clumsy */
  .mgla-field input::-webkit-outer-spin-button,
  .mgla-field input::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
  }
  .mgla-field .wrap { min-width: 0; }
  .mgla-field .unit { font-size: 12px; color: var(--mgla-muted); }

  .mgla-calc {
    width: 100%; padding: 14px; border: none; border-radius: 12px;
    background: var(--mgla-primary); color: #fff;
    font-family: var(--mgla-font); font-size: 16px; font-weight: 800; cursor: pointer;
    transition: opacity .15s;
  }
  .mgla-calc:hover { opacity: .88; }

  /* Result card — matches the approved black mockups:
     black inset panel with white Harir text, light-sans size letter,
     light gray divider, next-size nudge. Sits inside the (white) drawer. */
  .mgla-result {
    display: none; margin-top: 18px; text-align: center;
    background: #000; color: #fff;
    border-radius: var(--mgla-radius);
    padding: 32px 20px 28px;
  }
  .mgla-result.show { display: block; animation: mglaFade .35s ease; }
  @keyframes mglaFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .mgla-result .size-big {
    font-family: var(--mgla-latin);
    font-size: 84px; font-weight: 300; line-height: 1;
    letter-spacing: .01em; color: #fff;
    margin: 0 0 26px;
  }
  .mgla-result .main {
    font-size: 15px; font-weight: 400; margin: 0 0 18px; color: #fff;
  }
  .mgla-result .divider {
    width: 62%; height: 1px; background: #8a8a8a;
    border: none; margin: 0 auto 18px;
  }
  .mgla-result .hint { font-size: 14px; color: #fff; margin: 0; }
  /* the next-size letter is Latin, inline with the Arabic sentence */
  .mgla-result .hint .nx { font-family: var(--mgla-latin); }
  /* Prompt when the customer hits calculate without entering measurements —
     keeps the black card look, no size letter yet. */
  .mgla-result .prompt {
    font-size: 14px; color: #fff; margin: 0; padding: 8px 0;
  }
  /* Fit note (tight-cut models): lighter panel INSIDE the black card */
  .mgla-result .fitnote {
    margin: 18px 0 0; padding: 10px 14px; border-radius: 10px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
    font-size: 13px; color: #fff; text-align: right;
  }
  /* Out-of-range: soft panel inside the black card */
  .mgla-result .oor {
    margin: 0; padding: 10px 14px; border-radius: 10px;
    background: rgba(255,255,255,.08);
    font-size: 13px; color: #fff; text-align: right;
  }

  .mgla-chart-toggle {
    display: block; width: 100%; margin-top: 18px; padding: 12px;
    background: none; border: 1px dashed #ddd; border-radius: 10px;
    font-family: var(--mgla-font); font-size: 13px; cursor: pointer; color: var(--mgla-text);
  }
  .mgla-chart-wrap { display: none; margin-top: 10px; }
  .mgla-chart-wrap.show { display: block; }
  .mgla-chart-wrap table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .mgla-chart-wrap th, .mgla-chart-wrap td {
    border: 1px solid #eee; padding: 8px 6px; text-align: center;
  }
  .mgla-chart-wrap th { background: var(--mgla-soft); font-weight: 700; }
  /* the "المقاسات بالإنش" subheader row: lighter, uppercase-feel */
  .mgla-chart-wrap tr.units-row th {
    background: transparent; font-weight: 400; font-size: 11px;
    color: var(--mgla-muted); padding: 4px 6px; border: none; border-bottom: 1px solid #eee;
  }

  .mgla-foot { padding: 14px var(--mgla-pad) 22px; border-top: 1px solid #f0f0f0; }
  /* Save button + privacy live on ONE row.
     RTL means the FIRST child renders on the right — put the privacy
     text first so 🔒 sits on the right, small save pill on the left. */
  .mgla-save-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
  }
  .mgla-save {
    padding: 6px 14px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--mgla-primary); background: #fff;
    font-family: var(--mgla-font); font-size: 12.5px; font-weight: 700;
    color: var(--mgla-primary); white-space: nowrap;
    transition: background .15s, color .15s;
  }
  .mgla-save:hover { background: var(--mgla-primary); color: #fff; }
  .mgla-privacy {
    margin: 0; font-size: 11.5px; color: var(--mgla-muted); text-align: right;
  }
  .mgla-wa {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 10px; padding: 11px; border-radius: 10px; text-decoration: none;
    background: #eafff1; color: #1c7c45; font-size: 13.5px; font-weight: 700;
  }

  @media (max-width: 480px) {
    .mgla-drawer { width: 100vw; right: -100vw; }
  }

/* Desktop-only taller product cards — mobile stays at default. Added per request. */
@media (min-width: 768px) {
  :root { --product-image-height: 28rem !important; }
}

/* Desktop: hide category filter sidebar, show 4 products per row (mobile unchanged). Added per request. */
@media (min-width: 1024px) {
  salla-filters { display: none !important; }
  .main-content.flex-1 { margin-right: 0 !important; margin-left: 0 !important; }
  .s-products-list-wrapper { grid-template-columns: repeat(4, 1fr) !important; }
}

/* Remove Blog link from nav, keep product sections only. */
a[href$="/blog"], .blog-link { display: none !important; }

/* Show only the 3 BNPL logos (Tabby / Tamara / MIS) side-by-side in one row. */
salla-installment { display:flex !important; flex-direction:row !important; flex-wrap:wrap !important; align-items:center !important; gap:14px !important; }
salla-installment, salla-installment *, salla-installment [class], salla-installment [class][class], salla-installment [class][class][class] { font-size:0 !important; line-height:0 !important; }
salla-installment > * { margin:0 !important; padding:0 !important; min-height:0 !important; max-height:none !important; height:auto !important; width:auto !important; overflow:visible !important; position:static !important; display:inline-flex !important; align-items:center !important; border:0 !important; box-shadow:none !important; }
salla-installment img, salla-installment svg { height:22px !important; width:auto !important; min-height:22px !important; max-height:22px !important; position:static !important; top:auto !important; left:auto !important; display:inline-block !important; }
.tamara-product-widget { padding:0 !important; position:static !important; }
salla-installment [class*="logo"], salla-installment [class*="Logo"] { min-width:56px !important; min-height:22px !important; background-size:contain !important; background-repeat:no-repeat !important; background-position:center !important; display:inline-block !important; }

/* Remove empty breadcrumb bar above product image — clean PDP like Mleha */
body.product-single .container--breadcrumbs { display: none !important; }

/* Product pages: merge header with product image like the homepage hero */
body.product-single .store-header { position: absolute; width: 100%; z-index: 3; }
body.product-single .store-header .main-menu-row,
body.product-single .store-header .main-nav-container,
body.product-single .store-header .top-navbar { background-color: transparent !important; }