/* The sale page (sale/product.php; consultations next) — the approved mockup of 2026-10-16.
   Clean system: grey stage, white cards, soft shadows; the seller's colour (--mds-color-main /
   --sf-on-main from storefront/_color) is the only accent. Buyers 25–60: 16px+ text, 48–56px controls. */

.nm-sale {
    --ns-ink: #1d1d1f; --ns-body: #424245; --ns-muted: #6e6e73; --ns-line: #e3e3e8; --ns-card: #fff;
    --ns-main: var(--mds-color-main, #F1641E); --ns-on-main: var(--sf-on-main, #fff);
    --ns-shadow: 0 4px 20px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.05);
    color: var(--ns-body); font-size: 16px; line-height: 1.7;
}
#wrapper.nm-sale { padding-top: 16px; padding-bottom: 40px; background: var(--nm-stage, #f5f5f7); }

/* the seller: the store's side column on a computer (nm-storefront.css «seller pages' frame»);
   on a phone that head is hidden and one line sits beside «back» instead */
@media (max-width: 991.98px) { .nm-sale .sf-side-row .sf-head { display: none; } }
/* on a computer the side panel runs from the bar to the footer — no wrapper padding (this file loads after
   nm-storefront.css, so its own padding above used to win and push the panel down) */
@media (min-width: 992px) { .nm-sale-mini { display: none !important; } #wrapper.nm-sale { padding-top: 0; padding-bottom: 0; } }

.nm-sale-main { display: grid; gap: 16px; min-width: 0; }
.nm-sale-top { display: flex; align-items: center; gap: 10px; }
.nm-sale-back { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; background: var(--ns-card); box-shadow: var(--ns-shadow);
    display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: var(--ns-ink) !important; text-decoration: none !important; }
/* «back to the store»: on the LEFT, pointing left, on every screen and in every language (owner) —
   in Arabic it is the row's last item (the seller's line stays on the right) */
[dir="rtl"] .nm-sale-back { order: 2; margin-right: auto; }
.nm-sale-mini { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; color: var(--ns-ink) !important; text-decoration: none !important; font-size: 15px; }
.nm-sale-mini span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-sale-mini img, .nm-sale-mini .nm-av-letter { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; font-size: 15px !important; }

/* cards */
.nm-sale .nm-card { background: var(--ns-card); border-radius: 20px; box-shadow: var(--ns-shadow); padding: 20px; min-width: 0; }
.nm-sale .nm-card h2 { font-size: 19px; font-weight: 800; color: var(--ns-ink); margin: 0 0 12px; letter-spacing: -.01em; }
.nm-sale-media { padding: 0 !important; overflow: hidden; }
.nm-sale-media .product-slider-container, .nm-sale-media #product_slider_container { margin: 0; }
.nm-sale-media img { max-width: 100%; }
/* Thumbnails: one row under the picture on every screen (phones too — dots are missed); none for a single picture */
.nm-sale-media .product-slider-wrapper { flex-direction: column-reverse; align-items: stretch; gap: 0; margin-bottom: 0; }
.nm-sale-media .product-slider-wrapper .slider-for-container { border: 0; border-radius: 0; }
.nm-sale-media .product-slider-wrapper .thumb-slider-wrapper { display: block; flex: none; min-height: 0; height: auto !important; padding: 10px 12px 12px; }
.nm-sale-media .thumb-slider-wrapper:has(.swiper-slide:only-child) { display: none; }
.nm-sale-media .thumb-slider .swiper-slide { width: 64px !important; height: 64px !important; margin-bottom: 0 !important; border-radius: 10px; }
.nm-sale-media .thumb-slider .swiper-slide img { border-radius: 10px; }

.nm-sale-head { display: grid; gap: 12px; }
.nm-sale-title { font-size: 26px; font-weight: 800; line-height: 1.4; color: var(--ns-ink); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
@media (max-width: 575px) { .nm-sale-title { font-size: 23px; } }
.nm-sale-edit { font-size: 16px; color: var(--ns-muted) !important; text-decoration: none !important; margin-inline-start: 6px; }
.nm-sale-price .final-price, .nm-sale-price .final-price-free { font-size: 28px !important; font-weight: 800; color: var(--ns-ink) !important; }
.nm-sale-price .final-price-free { color: var(--ns-main) !important; } /* «free» in the store's colour */
.nm-sale-price .original-price { font-size: 17px !important; color: var(--ns-muted) !important; }
.nm-sale-price .discount-rate { background: color-mix(in srgb, var(--ns-main) 12%, #fff); color: var(--ns-main) !important; border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: 13px; }
.nm-sale-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.nm-sale-facts li { background: var(--nm-stage, #f5f5f7); border-radius: 999px; padding: 6px 14px; font-size: 15px; color: var(--ns-body); }

.nm-sale-desc .post-text-responsive { font-size: 16px; line-height: 1.85; color: var(--ns-body); overflow-wrap: anywhere; }
.nm-sale-desc .post-text-responsive img { max-width: 100%; height: auto; border-radius: 12px; }

/* the buy box */
.nm-sale .nm-buy { border: 2px solid color-mix(in srgb, var(--ns-main) 30%, #fff); display: grid; gap: 14px; scroll-margin-top: 16px; }
.nm-buy-title { font-size: 21px !important; margin: 0 !important; }
.nm-buy-form { display: grid; gap: 14px; }
.nm-buy-form .form-group { margin-bottom: 0; }
.nm-buy-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; border: 0; border-radius: 14px;
    background: var(--ns-main); color: var(--ns-on-main) !important; font: inherit; font-size: 18px; font-weight: 800; text-decoration: none !important; cursor: pointer; }
.nm-buy-btn:hover { filter: brightness(.95); }
.nm-buy-btn:disabled { opacity: .55; cursor: not-allowed; }
.nm-buy-btn:focus-visible, .nm-buy-m:focus-within, .nm-sale-back:focus-visible { outline: 3px solid var(--ns-ink); outline-offset: 2px; }
.nm-buy-methods { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.nm-buy-methods legend { font-weight: 700; font-size: 15px; color: #334155; margin-bottom: 4px; }
.nm-buy-m { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--ns-line); border-radius: 12px; padding: 12px 14px; min-height: 56px; cursor: pointer; margin: 0; background: #fff; }
.nm-buy-m input { width: 20px; height: 20px; accent-color: var(--ns-main); flex: 0 0 auto; margin: 0; }
.nm-buy-m:has(input:checked) { border-color: var(--ns-main); background: color-mix(in srgb, var(--ns-main) 6%, #fff); }
.nm-buy-m-text { display: grid; flex: 1 1 auto; min-width: 0; }
.nm-buy-m-text b { color: var(--ns-ink); font-size: 16px; }
.nm-buy-m-text small { color: var(--ns-muted); font-size: 13px; }
.nm-buy-logos { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nm-buy-coupon summary { cursor: pointer; color: var(--ns-main); font-weight: 700; font-size: 15px; }
.nm-buy-coupon input { margin-top: 8px; height: 50px; border-radius: 10px; font-size: 16px; }
.nm-buy-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--ns-line); padding-top: 12px; font-weight: 700; color: var(--ns-ink); }
.nm-buy-total b { font-size: 24px; }
.nm-buy-methods--one > legend, .nm-buy-methods--one > .nm-buy-m { display: none; }
.nm-buy-methods--one > .nm-buy-m-more { margin-top: 0; }
/* the box's two parts: «your details» then «payment» — one page, two clear headings */
.nm-buy-sec { margin: 6px 0 -4px; padding-top: 14px; border-top: 1px solid var(--ns-line); font-size: 17px; font-weight: 800; color: var(--ns-ink); display: flex; align-items: center; gap: 8px; }
.nm-buy-sec:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.nm-buy-sec-n { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ns-ink); color: #fff; font-size: 14px; }
.nm-buy-lines { display: grid; gap: 6px; font-size: 15px; color: var(--ns-body); }
.nm-buy-lines > div { display: flex; justify-content: space-between; gap: 12px; }
/* under the chosen method: what it needs, in this page */
.nm-buy-m-more { margin: -2px 0 4px; padding: 12px 14px; border-radius: 12px; background: #f5f5f7; font-size: 15px; line-height: 1.7; color: var(--ns-body); }
.nm-buy-m-note { margin: 0; }
.nm-buy-m-box { margin: 0 0 8px; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--ns-line); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ns-ink); }
.nm-buy-m-html { white-space: normal; }
.nm-buy-m-steps { margin: 0; padding-inline-start: 20px; }
/* the card fields sit on the SAME grey panel as every other method's needs (transfer, WhatsApp): «you pay here» */
.nm-buy-pay { min-height: 40px; padding: 14px; border-radius: 12px; background: #f5f5f7; }
.nm-buy-paypal { min-height: 48px; }
.nm-buy-coupon-row { display: flex; gap: 8px; margin-top: 8px; }
.nm-buy-coupon-row input { margin-top: 0; flex: 1 1 auto; min-width: 0; }
.nm-buy-coupon-apply { flex: 0 0 auto; min-height: 50px; padding: 0 18px; border: 1.5px solid var(--ns-ink); border-radius: 10px; background: #fff; color: var(--ns-ink); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.nm-buy-coupon-msg { margin: 8px 0 0; color: #b42318; font-size: 15px; font-weight: 600; }
.nm-buy-trust, .nm-buy-note { margin: 0; text-align: center; color: var(--ns-muted); font-size: 14px; }
.nm-buy-trust a { color: inherit; text-decoration: underline; }
/* free product given for joining the seller's list: said plainly, readable — not fine print */
.nm-buy-optin { margin: 0; text-align: center; color: var(--ns-body); font-size: 15px; line-height: 1.7; }
.nm-buy-owned { background: #ecfdf3; color: #14532d; border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.nm-buy-owned a { color: inherit; text-decoration: underline; margin-inline-start: 6px; }
/* the seller's sample: secondary (white, grey line) — the store's one-size button, never the main colour */
.nm-sale-demo { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 10px 16px; border: 1px solid var(--ns-line);
    border-radius: 12px; background: var(--ns-card); color: var(--ns-ink) !important; font-size: 16px; font-weight: 700; text-decoration: none !important; }
.nm-sale-demo:hover { background: var(--nm-stage, #f5f5f7); }
.nm-sale-ask { margin: 0; text-align: center; color: var(--ns-muted); font-size: 15px; }
/* «ask the seller» inside the buy box: only after a failed payment (the error line right before it shows) */
.nm-buy-help { display: none; margin: 0; font-size: 15px; color: var(--ns-body); }
.nm-buy-err:not([hidden]) + .nm-buy-help { display: block; }
.nm-buy-help button { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--ns-main); text-decoration: underline; cursor: pointer; }
.nm-sale-ask button { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--ns-main); text-decoration: underline; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { .nm-sale * { scroll-behavior: auto !important; transition: none !important; } }
.nm-buy-form .nm-gb.form-group { margin-bottom: 0; }
.nm-buy-form .nm-gb label { margin-bottom: 6px; }
.nm-buy-err { margin: 0; background: #fef2f2; color: #b42318; border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 15px; }
.nm-buy-btn.is-busy { opacity: .7; cursor: progress; }
.nm-buy-note a { color: var(--mds-color-main, #F1641E); font-weight: 700; text-decoration: underline; }
