/**
 * NuMart Souq — Product detail page (iHerb-style).
 * Scoped via the body class `nm-pdp` (added in the theme preprocess).
 */

/* ============================================================
 * 1. Page container + two-column grid (gallery | info + buy box)
 * ============================================================ */
.nm-pdp main { background: #fff; }

.nm-pdp main article > .layout--twocol-section--50-50 {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px 40px;
  align-items: start;
  max-width: 1280px;
  margin: 28px auto 48px;
  padding: 0 24px;
  color: #1c1f24;
}
.nm-pdp main article > .layout--twocol-section--50-50 > .layout__region {
  min-width: 0;
}

.nm-pdp main article > .layout--twocol-section--50-50 > .layout__region--first {
  position: sticky;
  top: calc(var(--nm-header-h-current, var(--nm-header-h, 72px)) + 16px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nm-pdp main article > .layout--twocol-section--50-50 > .layout__region--second {
  display: flex;
  flex-flow: row wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 0;
  width: 100%;
  max-width: 100%;
}
.nm-pdp main article > .layout--twocol-section--50-50 > .layout__region--second > * {
  flex: 1 1 100%;
  max-width: 100%;
  margin-top: 18px;
}
.nm-pdp main article > .layout--twocol-section--50-50 > .layout__region--second > *:first-child {
  margin-top: 0;
}

/* Group price + cart form + helper card visually so they read as a "buy box". */
.nm-pdp .layout__region--second > .product-price {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid #ececee;
}
.nm-pdp .layout__region--second > .block--type-basic {
  margin: 4px 0 0;
  padding: 16px 18px;
  background: #fafafb;
  border: 1px solid #ececee;
  border-radius: 12px;
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.55;
}
.nm-pdp .layout__region--second > .block--type-basic p { margin: 0 0 6px; }
.nm-pdp .layout__region--second > .block--type-basic p:last-child { margin: 0; }

@media (max-width: 859px) {
  .nm-pdp main article > .layout--twocol-section--50-50 {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .nm-pdp main article > .layout--twocol-section--50-50 > .layout__region--first {
    position: static;
  }
}

/* Bottom one-col sections (tabs, recently viewed). */
.nm-pdp main article > .layout--onecol {
  max-width: 1320px;
  margin: 16px auto;
  padding: 0 16px;
}

/* ============================================================
 * 2. Gallery (custom .nm-gallery — replaces contrib gallery UI)
 * ============================================================ */

/* Hide the original contrib gallery + its modal entirely. We keep the
   markup in the DOM so any unknown integrations (analytics, SEO image
   discovery, variation AJAX hooks) keep functioning, but visually we
   render only our own .nm-gallery + .nm-lightbox. */
.nm-pdp .bootstrap-basic-image-gallery.nm-gallery-source-hidden,
.nm-pdp .bootstrap-basic-image-gallery.nm-gallery-source-hidden ~ #bootstrap-basic-image-gallery-modal,
#bootstrap-basic-image-gallery-modal {
  display: none !important;
}

.nm-pdp .nm-gallery {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

/* ----- Main stage -----
   Fixed 1:1 stage so the layout is stable regardless of the underlying
   image dimensions. The image is centered + contained inside it. */
.nm-pdp .nm-gallery__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 620px;
  background: #fafafb;
  border: 1px solid #ececee;
  border-radius: 16px;
  overflow: hidden;
  padding: 24px;
}
.nm-pdp .nm-gallery__main {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.4s ease, opacity 0.18s ease;
  user-select: none;
}
.nm-pdp .nm-gallery__stage:hover .nm-gallery__main {
  transform: scale(1.04);
}

/* Stage arrows. */
.nm-pdp .nm-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  color: #1c1f24;
  border: 1px solid #e3e6ea;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease, transform 0.18s ease;
  box-shadow: 0 6px 14px -10px rgba(15, 23, 42, 0.4);
}
.nm-pdp .nm-gallery__arrow--prev { left: 12px; }
.nm-pdp .nm-gallery__arrow--next { right: 12px; }
.nm-pdp .nm-gallery__stage:hover .nm-gallery__arrow,
.nm-pdp .nm-gallery__arrow:focus-visible {
  opacity: 1;
}
.nm-pdp .nm-gallery__arrow:hover {
  background: #1c1f24;
  color: #fff;
  border-color: #1c1f24;
}
.nm-pdp .nm-gallery__stage.is-single .nm-gallery__arrow {
  display: none;
}

/* Zoom button. */
.nm-pdp .nm-gallery__zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  color: #1c1f24;
  border: 1px solid #e3e6ea;
  border-radius: 999px;
  cursor: pointer;
  z-index: 2;
  transition: background 0.18s ease, color 0.18s ease;
}
.nm-pdp .nm-gallery__zoom:hover {
  background: #1c1f24;
  color: #fff;
  border-color: #1c1f24;
}

/* ----- Thumbnail strip ----- */
.nm-pdp .nm-gallery__thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
  /* Top/side padding so the hover lift + active outline are not clipped
     by the horizontal scroll container. */
  padding: 6px 4px 6px;
}
.nm-pdp .nm-gallery__thumbs::-webkit-scrollbar { height: 6px; }
.nm-pdp .nm-gallery__thumbs::-webkit-scrollbar-thumb { background: #d9dde4; border-radius: 999px; }
.nm-pdp .nm-gallery__thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  padding: 0;
  background: #fff;
  border: 1px solid #ececee;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.nm-pdp .nm-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  display: block;
  pointer-events: none; /* avoid mouseenter flicker on inner img */
}
.nm-pdp .nm-gallery__thumb:hover {
  border-color: #b9c1cc;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -14px rgba(15, 23, 42, 0.4);
}
.nm-pdp .nm-gallery__thumb.is-active {
  border-color: #1c1f24;
  box-shadow: 0 0 0 2px #1c1f24;
}

/* ============================================================
 * 2b. Lightbox (.nm-lightbox) — singleton, body-level
 * ============================================================ */
.nm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.nm-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.nm-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.86);
  cursor: zoom-out;
}
.nm-lightbox__stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(960px, 92vw);
  max-height: 92vh;
  margin: 0;
}
.nm-lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-user-drag: none;
}
.nm-lightbox__counter {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.nm-lightbox__close,
.nm-lightbox__arrow {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  cursor: pointer;
  z-index: 2;
  transition: background 0.18s ease, transform 0.18s ease;
  backdrop-filter: blur(4px);
}
.nm-lightbox__close {
  top: 18px;
  left: 18px;
  width: 44px;
  height: 44px;
  font-size: 24px;
  line-height: 1;
}
.nm-lightbox__arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 28px;
  line-height: 1;
}
.nm-lightbox__arrow--prev { left: 18px; }
.nm-lightbox__arrow--next { right: 18px; }
.nm-lightbox__close:hover,
.nm-lightbox__arrow:hover {
  background: rgba(255, 255, 255, 0.22);
}
.nm-lightbox__arrow:hover { transform: translateY(-50%) scale(1.06); }
.nm-lightbox.is-single .nm-lightbox__arrow,
.nm-lightbox.is-single .nm-lightbox__counter {
  display: none;
}
body.nm-lightbox-open {
  overflow: hidden;
}
@media (max-width: 640px) {
  .nm-lightbox__arrow { width: 42px; height: 42px; font-size: 22px; }
  .nm-lightbox__arrow--prev { left: 8px; }
  .nm-lightbox__arrow--next { right: 8px; }
  .nm-lightbox__close { top: 10px; left: 10px; width: 38px; height: 38px; font-size: 20px; }
}

/* ============================================================
 * 3. Promotion / discount banner
 *  - Original markup (inside the gallery column) is hidden as a fallback
 *    while JS rebuilds it as a small flashing line under the title.
 * ============================================================ */
.nm-pdp .block-extra-field-blockcommerce-productmyproductpromotion-details {
  display: none !important;
}

.nm-pdp-promo-flash {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e11d48;
  animation: nmPromoFlash 2.4s ease-in-out infinite;
}
.nm-pdp-promo-flash__icon {
  flex: 0 0 auto;
  transform: rotate(-12deg);
}
@keyframes nmPromoFlash {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) {
  .nm-pdp-promo-flash { animation: none; }
}

/* ============================================================
 * 4. Middle column header — brand / title / promo banner
 * ============================================================ */
.nm-pdp main article > .layout--twocol-section--50-50 > .layout__region--second > .block-field-blockcommerce-productmyproductmy-brand,
.nm-pdp main article > .layout--twocol-section--50-50 > .layout__region--second > .block-field-blockcommerce-productmyproductmain-category {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  margin-top: 0;
}
.nm-pdp main article > .layout--twocol-section--50-50 > .layout__region--second > .block-field-blockcommerce-productmyproductmain-category {
  margin-inline-start: 8px;
}

.nm-pdp .block-field-blockcommerce-productmyproductmy-brand,
.nm-pdp .block-field-blockcommerce-productmyproductmain-category {
  display: inline-flex;
  vertical-align: middle;
  margin-top: 0 !important;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
}
.nm-pdp .block-field-blockcommerce-productmyproductmain-category {
  margin-inline-start: 8px;
}
.nm-pdp .block-field-blockcommerce-productmyproductmy-brand .content,
.nm-pdp .block-field-blockcommerce-productmyproductmain-category .content,
.nm-pdp .block-field-blockcommerce-productmyproductmy-brand .my-brand,
.nm-pdp .block-field-blockcommerce-productmyproductmain-category .main-category {
  display: inline-flex;
}
.nm-pdp .block-field-blockcommerce-productmyproductmy-brand .my-brand a,
.nm-pdp .block-field-blockcommerce-productmyproductmy-brand a,
.nm-pdp .block-field-blockcommerce-productmyproductmain-category .main-category a,
.nm-pdp .block-field-blockcommerce-productmyproductmain-category a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  width: fit-content;
  padding: 0 12px;
  background: #f7f8fa;
  border: 1px solid #e6e8ec;
  color: #5b6470;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.nm-pdp .block-field-blockcommerce-productmyproductmy-brand .content,
.nm-pdp .block-field-blockcommerce-productmyproductmain-category .content {
  margin: 0;
}
.nm-pdp .block-field-blockcommerce-productmyproducttitle {
  margin-top: 12px !important;
}
.nm-pdp .block-field-blockcommerce-productmyproductmy-brand .my-brand a,
.nm-pdp .block-field-blockcommerce-productmyproductmy-brand a {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nm-pdp .block-field-blockcommerce-productmyproductmy-brand .my-brand a:hover,
.nm-pdp .block-field-blockcommerce-productmyproductmy-brand a:hover,
.nm-pdp .block-field-blockcommerce-productmyproductmain-category .main-category a:hover,
.nm-pdp .block-field-blockcommerce-productmyproductmain-category a:hover {
  color: #1c1f24;
  border-color: #cfd4dc;
  background: #f1f3f6;
}

.nm-pdp .block-field-blockcommerce-productmyproductmain-category:empty,
.nm-pdp .block-field-blockcommerce-productmyproductmain-category .content:empty {
  display: none;
}

.nm-pdp .block-field-blockcommerce-productmyproducttitle .title {
  margin: 4px 0 0;
  font-size: clamp(20px, 1.2vw + 12px, 26px);
  font-weight: 600;
  line-height: 1.35;
  color: #1c1f24;
  letter-spacing: -0.01em;
}

.nm-pdp .product-price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0;
}
.nm-pdp .product-price .price-number {
  color: #1c1f24;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.nm-pdp .product-price .original-price {
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
  text-decoration: line-through;
}

/* ============================================================
 * 5. Variation form — fieldsets (color & size)
 * ============================================================ */
.nm-pdp {
  --nm-control-height: 48px;
  --nm-control-radius: 12px;
  --nm-control-max-width: 420px;
  --nm-control-border: #d9dde4;
  --nm-control-border-strong: #b9c1cc;
  --nm-control-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --nm-control-shadow: 0 10px 24px -20px rgba(15, 23, 42, 0.45);
  --nm-control-shadow-focus: 0 0 0 4px rgba(28, 31, 36, 0.08);
}

.nm-pdp .block-field-blockcommerce-productmyproductvariations,
.nm-pdp #commerce-product-add-to-cart-form,
.nm-pdp .commerce-order-item-add-to-cart-form {
  display: contents;
}
.nm-pdp .field--name-purchased-entity {
  flex: 1 1 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
.nm-pdp .block-field-blockcommerce-productmyproductvariations > .content,
.nm-pdp .block-field-blockcommerce-productmyproductvariations > .content > div,
.nm-pdp .block-field-blockcommerce-productmyproductvariations .variations,
.nm-pdp .block-field-blockcommerce-productmyproductvariations #commerce-product-add-to-cart-form,
.nm-pdp .commerce-order-item-add-to-cart-form,
.nm-pdp .commerce-order-item-add-to-cart-form > .layout--onecol,
.nm-pdp .commerce-order-item-add-to-cart-form > .layout--onecol > .layout__region--content {
  display: contents;
}

/* Force each attribute group (Color, Size, etc.) onto its own row.
   Drupal Commerce wraps them in `.attribute-widgets` which defaults to
   `display:flex; flex-wrap:wrap`, putting both groups side by side. */
.nm-pdp .attribute-widgets {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 14px;
  width: 100%;
  flex: 1 1 100%;
  max-width: 100%;
  margin-top: 8px;
}
.nm-pdp .attribute-widgets > .product--rendered-attribute {
  width: 100% !important;
  flex: 1 1 100% !important;
}

.nm-pdp .product--rendered-attribute {
  margin: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}
.nm-pdp .product--rendered-attribute .fieldset-wrapper {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
}
/* Hide legends ("اللون" / "القياس") + their underline. */
.nm-pdp .product--rendered-attribute > legend {
  display: none !important;
}

/* Hide the original radio chips — replaced by .nm-attr-select dropdown. */
.nm-pdp .product--rendered-attribute .form-radios,
.nm-pdp .product--rendered-attribute .fieldset-wrapper > .form-radios,
.nm-pdp .product--rendered-attribute .fieldset-wrapper > .js-form-item,
.nm-pdp .product--rendered-attribute .form-check.js-form-type-radio,
.nm-pdp .product--rendered-attribute .js-form-type-radio {
  display: none !important;
}
/* Keep original radios reachable for AJAX (they still receive clicks). */
.nm-pdp .product--rendered-attribute input[type="radio"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none;
}

/* ----- Custom dropdown component ----- */
.nm-pdp .nm-attr-select {
  position: relative;
  display: block;
  width: 100%;
  max-width: none;
}
.nm-pdp .nm-attr-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: var(--nm-control-height);
  padding: 0 16px;
  background: var(--nm-control-bg);
  border: 1px solid var(--nm-control-border);
  border-radius: var(--nm-control-radius);
  color: #1c1f24;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--nm-control-shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.nm-pdp .nm-attr-select__trigger:hover {
  border-color: var(--nm-control-border-strong);
  box-shadow: 0 14px 28px -22px rgba(15, 23, 42, 0.55);
  transform: translateY(-1px);
}
.nm-pdp .nm-attr-select.is-open .nm-attr-select__trigger {
  border-color: #1c1f24;
  box-shadow: var(--nm-control-shadow-focus), 0 14px 30px -24px rgba(15, 23, 42, 0.5);
}
.nm-pdp .nm-attr-select__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.nm-pdp .nm-attr-select__text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nm-pdp .nm-attr-select__caret {
  margin-inline-start: 8px;
  color: #7b8794;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.18s ease;
}
.nm-pdp .nm-attr-select.is-open .nm-attr-select__caret {
  transform: rotate(180deg);
}

.nm-pdp .nm-attr-select__panel {
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  z-index: 20;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e3e7ee;
  border-radius: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 44px -24px rgba(15, 17, 21, 0.28);
  max-height: 280px;
  overflow-y: auto;
}
.nm-pdp .nm-attr-select__option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  color: #1c1f24;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.nm-pdp .nm-attr-select__option:hover {
  background: #f4f6f9;
}
.nm-pdp .nm-attr-select__option[aria-selected="true"] {
  background: linear-gradient(135deg, #1c1f24 0%, #2c3440 100%);
  color: #fff;
}

.nm-pdp .nm-attr-select__dot {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(15, 17, 21, 0.15);
}

/* ============================================================
 * 6. Quantity + add-to-cart
 * ============================================================ */
.nm-pdp .field--name-quantity {
  margin: 0;
  flex: 1 1 auto;
  width: auto;
  min-width: 140px;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  order: 50;
  margin-top: 8px;
  align-self: center;
}
.nm-pdp .form-actions {
  order: 51;
  flex: 0 0 240px !important;
  width: 240px !important;
  max-width: 240px !important;
  margin-top: 8px !important;
  margin-inline-start: 8px !important;
  align-self: flex-end;
}
.nm-pdp .block-extra-field-blockcommerce-productmyproductflag-wishlist {
  order: 52;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  margin-top: 8px !important;
  margin-inline-start: 8px;
  align-self: flex-start;
}
.nm-pdp .field--name-quantity .form-label {
  display: none !important;
}
.nm-pdp .nm-qty-stepper {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  width: 168px;
  height: var(--nm-control-height);
  min-height: var(--nm-control-height);
  border: 1px solid var(--nm-control-border);
  border-radius: var(--nm-control-radius);
  padding: 4px;
  background: var(--nm-control-bg);
  box-shadow: var(--nm-control-shadow);
}
.nm-pdp .nm-qty-stepper button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  color: #1c1f24;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px var(--nm-control-border);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  flex: 0 0 38px;
}
.nm-pdp .nm-qty-stepper button:hover {
  background: #1c1f24;
  color: #fff;
  box-shadow: inset 0 0 0 1px #1c1f24;
}
.nm-pdp .nm-qty-stepper button:active { transform: scale(0.94); }
.nm-pdp .nm-qty-stepper button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #fff;
  color: #1c1f24;
  box-shadow: inset 0 0 0 1px var(--nm-control-border);
}
.nm-pdp .nm-qty-stepper input.form-number {
  flex: 1 1 auto;
  width: auto !important;
  height: 38px;
  margin: 0;
  border: 0 !important;
  background: transparent !important;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #1c1f24;
  -moz-appearance: textfield;
}
.nm-pdp .nm-qty-stepper input.form-number::-webkit-outer-spin-button,
.nm-pdp .nm-qty-stepper input.form-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ----- Quantity combobox (1–10 + free input) ----- */
.nm-pdp .nm-qty-select {
  display: block;
  position: relative;
  width: 100%;
}
.nm-pdp .nm-qty-select__field {
  display: block;
  width: 100% !important;
  height: var(--nm-control-height);
  padding: 0 16px;
  padding-inline-end: 44px;
  background: var(--nm-control-bg);
  border: 1px solid var(--nm-control-border) !important;
  border-radius: var(--nm-control-radius);
  color: #1c1f24;
  font-size: 15px;
  font-weight: 700;
  line-height: var(--nm-control-height);
  box-shadow: var(--nm-control-shadow);
  text-align: start;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}
.nm-pdp .nm-qty-select__field:focus {
  outline: none;
  border-color: var(--nm-control-border-strong) !important;
  box-shadow: var(--nm-control-shadow-focus);
}
.nm-pdp .nm-qty-select__field::-webkit-outer-spin-button,
.nm-pdp .nm-qty-select__field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.nm-pdp .nm-qty-select__caret {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1c1f24;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.nm-pdp .nm-qty-select__caret:hover { background: rgba(28, 31, 36, 0.06); }
.nm-pdp .nm-qty-select.is-open .nm-qty-select__caret { transform: translateY(-50%) rotate(180deg); }

.nm-pdp .nm-qty-select__panel {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--nm-control-border);
  border-radius: var(--nm-control-radius);
  box-shadow: 0 24px 48px -24px rgba(15, 23, 42, 0.35);
  z-index: 30;
  display: none;
}
.nm-pdp .nm-qty-select.is-open .nm-qty-select__panel { display: block; }
.nm-pdp .nm-qty-select__option {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1c1f24;
  cursor: pointer;
  transition: background 0.12s ease;
}
.nm-pdp .nm-qty-select__option:hover { background: #f3f4f6; }
.nm-pdp .nm-qty-select__option[aria-selected="true"] {
  background: #1c1f24;
  color: #fff;
}

.nm-pdp .form-actions {
  display: flex;
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  margin: 8px 0 0 0;
}
.nm-pdp .block-extra-field-blockcommerce-productmyproductflag-wishlist {
  display: flex;
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  justify-content: flex-start;
  margin-top: 8px !important;
}
.nm-pdp input.button--add-to-cart.button.button--primary.btn.btn-primary,
.nm-pdp input.button--add-to-cart,
.nm-pdp .button--add-to-cart {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--nm-control-height) !important;
  min-height: var(--nm-control-height);
  max-height: var(--nm-control-height);
  padding: 0 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 0 !important;
  border-radius: var(--nm-control-radius) !important;
  background: linear-gradient(135deg, #1c1f24 0%, #313a47 100%) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 18px 30px -22px rgba(15, 23, 42, 0.85);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.nm-pdp input.button--add-to-cart.button.button--primary.btn.btn-primary:hover,
.nm-pdp input.button--add-to-cart:hover,
.nm-pdp .button--add-to-cart:hover {
  background: linear-gradient(135deg, #111317 0%, #252b34 100%) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 22px 34px -24px rgba(15, 23, 42, 0.95);
}
.nm-pdp input.button--add-to-cart.button.button--primary.btn.btn-primary,
.nm-pdp input.button--add-to-cart.button.button--primary.btn.btn-primary:hover,
.nm-pdp input.button--add-to-cart.button.button--primary.btn.btn-primary:focus {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

/* ============================================================
 * 7. Wishlist + helper info card
 * ============================================================ */
.nm-pdp .block-extra-field-blockcommerce-productmyproductflag-wishlist .flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 56px;
  min-height: var(--nm-control-height);
  padding: 0;
  border: 1px solid rgba(15, 17, 21, 0.18);
  border-radius: var(--nm-control-radius);
  background: #fff;
  color: #1c1f24;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.nm-pdp .block-extra-field-blockcommerce-productmyproductflag-wishlist .flag .fav-icon {
  font-size: 18px;
}
.nm-pdp .block-extra-field-blockcommerce-productmyproductflag-wishlist .flag a {
  color: inherit;
  text-decoration: none;
}
.nm-pdp .block-extra-field-blockcommerce-productmyproductflag-wishlist .flag:hover {
  background: #fff;
  border-color: rgba(15, 17, 21, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -18px rgba(15, 23, 42, 0.35);
}

.nm-pdp .layout__region--second .block--type-basic {
  margin-top: 8px;
  padding: 14px 16px;
  background: #f7f8fa;
  border: 1px solid rgba(15, 17, 21, 0.06);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
}
.nm-pdp .layout__region--second .block--type-basic p { margin: 0 0 6px; }
.nm-pdp .layout__region--second .block--type-basic p:last-child { margin: 0; }

/* ============================================================
 * 8. Bottom: tabs + recently viewed
 * ============================================================ */
.nm-pdp .block-quicktabs {
  background: #fff;
  border: 1px solid rgba(15, 17, 21, 0.08);
  border-radius: 14px;
  padding: 22px 24px;
  margin-top: 12px;
}
.nm-pdp .block-quicktabs .quicktabs-tabs {
  display: flex;
  gap: 24px;
  margin: 0 0 18px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(15, 17, 21, 0.08);
  list-style: none;
}
.nm-pdp .block-quicktabs .quicktabs-tabs > li > a {
  display: inline-block;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: rgba(15, 17, 21, 0.6);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.nm-pdp .block-quicktabs .quicktabs-tabs > li.active > a {
  color: #0f1115;
  border-bottom-color: #0f1115;
}

.nm-pdp .block-views-blockrecent-viewed-products-block-1 {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(15, 17, 21, 0.08);
}
.nm-pdp .block-views-blockrecent-viewed-products-block-1 .recently-vewied-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 4px;
  color: #0f1115;
}
.nm-pdp .block-views-blockrecent-viewed-products-block-1 .new-arrivals-text {
  margin: 0 0 14px;
  color: rgba(15, 17, 21, 0.6);
  font-size: 13px;
}

/* Recently-viewed products: render as a static CSS grid (max 6 columns
   x 3 rows) instead of a swiper carousel — only on the PDP. */
.nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper {
  overflow: visible !important;
}
.nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-wrapper {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  transform: none !important;
  width: 100% !important;
  height: auto !important;
}
.nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-slide {
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  margin: 0 !important;
  flex: none !important;
  transform: none !important;
}
/* Cap to 18 visible items (6 x 3) and hide the rest. */
.nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-slide:nth-child(n+19) {
  display: none !important;
}
/* Hide swiper navigation/pagination since we no longer scroll. */
.nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-button-next,
.nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-button-prev,
.nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-pagination,
.nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-scrollbar {
  display: none !important;
}

@media (max-width: 1280px) {
  .nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-wrapper {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-slide:nth-child(n+16) {
    display: none !important;
  }
}
@media (max-width: 1024px) {
  .nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-wrapper {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-slide:nth-child(n+13) {
    display: none !important;
  }
}
@media (max-width: 768px) {
  .nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-wrapper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-slide:nth-child(n+10) {
    display: none !important;
  }
}
@media (max-width: 520px) {
  .nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-wrapper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nm-pdp .block-views-blockrecent-viewed-products-block-1 .swiper-slide:nth-child(n+7) {
    display: none !important;
  }
}
