/* Maxmart redesign — product page (boards 06 desktop, 14 mobile). Behaviour: js/product-detail.js. */

.mm-pdp { display: flex; flex-direction: column; gap: 32px; padding: 4px 0 24px; }
.mm-pdp .mm-breadcrumb .breadcrumb-item.active { color: var(--mm-text); }

.mm-pdp__top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px; }
.mm-pdp__media { position: relative; flex: 1 1 480px; min-width: 0; }
.mm-pdp__info { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Gallery ---------- */
.mm-gallery { display: flex; gap: 12px; }
.mm-gallery[hidden] { display: none; }
.mm-gallery__thumbs { flex: none; display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; scrollbar-width: none; }
.mm-gallery__thumb {
  flex: none; width: 72px; height: 72px; padding: 6px; box-sizing: border-box;
  border: 1px solid var(--mm-border); border-radius: var(--mm-r-lg); background: #fff; cursor: pointer;
}
.mm-gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }
.mm-gallery__thumb:hover { border-color: var(--mm-border-strong); }
.mm-gallery__thumb[aria-current="true"] { border: 2px solid var(--mm-brand); padding: 5px; }

.mm-gallery__stage {
  position: relative; flex: 1; min-width: 0; overflow: hidden;
  background: #fff; border: 1px solid var(--mm-border); border-radius: var(--mm-r-xl);
}
.mm-gallery__track {
  display: flex; height: 520px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.mm-gallery__track::-webkit-scrollbar { display: none; }
.mm-gallery__slide {
  flex: 0 0 100%; display: flex; align-items: center; justify-content: center;
  padding: 32px; box-sizing: border-box; scroll-snap-align: center; cursor: zoom-in;
}
.mm-gallery__slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mm-gallery__dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; }
.mm-gallery__dots span { width: 6px; height: 6px; border-radius: 3px; background: var(--mm-border-strong); transition: width .2s; }
.mm-gallery__dots span.is-active { width: 20px; background: var(--mm-brand); }
.mm-pdp__badge { position: absolute; top: 16px; left: 100px; z-index: 1; padding: 4px 10px; font-size: var(--mm-fs-xs); }
.mm-pdp__media:not(:has(.mm-gallery__thumbs)) .mm-pdp__badge { left: 16px; }

.mm-pdp__fabs { position: absolute; top: 14px; left: 14px; right: 14px; z-index: 2; display: flex; gap: 8px; pointer-events: none; }
.mm-pdp__fabs > * { pointer-events: auto; }
.mm-pdp__fabs-grow { flex: 1; }
.mm-fab {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: #fff; color: var(--mm-text); box-shadow: 0 2px 8px rgba(18, 23, 29, .12); cursor: pointer;
}
.mm-fab:hover { color: var(--mm-brand); }
.mm-fab.added, .mm-fab[aria-pressed="true"] { color: var(--mm-sale); }
.mm-fab.added .mm-icon, .mm-fab[aria-pressed="true"] .mm-icon { fill: currentColor; }

/* ---------- Head ---------- */
.mm-pdp__head { display: flex; flex-direction: column; gap: 8px; }
.mm-pdp__brand { align-self: flex-start; font-size: var(--mm-fs-sm); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.mm-pdp__title {
  margin: 0; font-family: var(--mm-font-display); font-size: 32px; line-height: 1.15; font-weight: 800;
  letter-spacing: -.01em; color: var(--mm-text);
}
.mm-pdp__admin { display: inline-flex; vertical-align: middle; margin-left: 6px; color: var(--mm-subtle); }
.mm-pdp__admin:hover { color: var(--mm-brand); }
.mm-pdp__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: var(--mm-fs-sm); color: var(--mm-muted); }
.mm-pdp__meta .mm-stock { font-size: var(--mm-fs-sm); }
.mm-pdp__code { display: inline-flex; align-items: center; gap: 4px; }
.mm-pdp__copy {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border: 0; border-radius: var(--mm-r-sm); background: none; color: var(--mm-subtle); cursor: pointer;
}
.mm-pdp__copy:hover { background: var(--mm-bg); color: var(--mm-brand); }
.mm-pdp__copy.is-done { color: var(--mm-success); }
.mm-pdp__rating {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none;
  color: var(--mm-brand); font-size: var(--mm-fs-sm); cursor: pointer;
}
.mm-pdp__rating .mm-icon { color: var(--mm-accent); fill: currentColor; stroke: #C9A600; }
.mm-pdp__rating strong { color: var(--mm-text); }
.mm-pdp__rating:hover span { text-decoration: underline; }
.mm-pdp__share .mm-link-btn { display: inline-flex; align-items: center; gap: 4px; font-size: var(--mm-fs-sm); }
.mm-pdp__staff { font-size: var(--mm-fs-sm); color: var(--mm-muted); }

/* ---------- Options (variations) ---------- */
.mm-options { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.mm-options__group { display: flex; flex-direction: column; gap: 10px; }
.mm-options__label { font-size: var(--mm-fs-md); font-weight: 600; }
.mm-options__label [data-mm-option-current] { font-weight: 400; }
.mm-options__values { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.mm-swatch {
  display: block; width: 48px; height: 48px; margin: 0; padding: 4px; box-sizing: border-box;
  border: 1px solid var(--mm-border-strong); border-radius: 50%; background: #fff; cursor: pointer;
}
.mm-swatch > span:first-child { display: block; width: 100%; height: 100%; border-radius: 50%; border: 1px solid var(--mm-border-strong); box-sizing: border-box; }
.mm-pill {
  display: flex; align-items: center; height: 44px; margin: 0; padding: 0 16px;
  border: 1.5px solid var(--mm-border-strong); border-radius: var(--mm-r-btn); background: #fff;
  font-weight: 600; cursor: pointer;
}
.mm-options__values input:checked + .mm-swatch { border: 2px solid var(--mm-brand); padding: 3px; }
.mm-options__values input:checked + .mm-pill { border-color: var(--mm-brand); background: var(--mm-brand-soft); color: var(--mm-brand-dark); }
.mm-options__values input:focus-visible + label { outline: 2px solid var(--mm-brand); outline-offset: 2px; }

/* ---------- Buy box ---------- */
.mm-buy { display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: var(--mm-r-xl); }
.mm-buy__offer { display: flex; flex-direction: column; gap: 12px; }
.mm-buy__offer[hidden] { display: none; }
.mm-buy__price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.mm-buy__price { font-family: var(--mm-font-display); font-size: 40px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; color: var(--mm-text); }
.mm-buy__price--sale { color: var(--mm-sale); }
.mm-buy__price--muted { font-size: 24px; color: var(--mm-muted); }
.mm-buy__old { font-size: var(--mm-fs-base); color: var(--mm-muted-2); }
.mm-buy__price-row .mm-badge { align-self: center; }
.mm-buy__credit-line {
  align-self: flex-start; margin-top: -6px; padding: 0; border: 0; background: none;
  font-size: var(--mm-fs-md); color: var(--mm-muted); text-align: left; cursor: pointer;
}
.mm-buy__credit-line strong { color: var(--mm-text); }
.mm-buy__credit-line:hover strong { color: var(--mm-brand); text-decoration: underline; }

.mm-buy__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.mm-buy__main { flex: 1 1 200px; height: 54px; font-size: 16px; }
.mm-buy__credit { flex: 1 1 160px; height: 54px; font-size: 16px; }
.mm-buy__fav { flex: none; width: 54px; height: 54px; border: 1px solid var(--mm-border-strong); border-radius: var(--mm-r-lg); background: #fff; }
.mm-buy__main:disabled { opacity: .5; cursor: not-allowed; }
.mm-buy__links { flex-basis: 100%; display: flex; gap: 16px; }
.mm-buy__links .mm-link-btn { display: inline-flex; align-items: center; gap: 6px; font-size: var(--mm-fs-sm); color: var(--mm-muted); }
.mm-buy__links .mm-link-btn:hover, .mm-buy__links .mm-link-btn.added { color: var(--mm-brand); }

.mm-buy__oneclick { display: flex; flex-direction: column; gap: 8px; margin: 0; padding-top: 16px; border-top: 1px solid #EEF1F4; }
.mm-buy__oneclick-label { margin: 0; font-size: var(--mm-fs-md); font-weight: 600; }
.mm-buy__oneclick .mm-input-group { align-items: stretch; }
.mm-buy__oneclick .mm-input { height: 46px; }
.mm-buy__oneclick .mm-btn { height: 46px; padding: 0 18px; }
.mm-buy__prefix {
  display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--mm-border-strong); border-radius: var(--mm-r-btn);
  background: var(--mm-bg); color: var(--mm-muted); font-weight: 600;
}
.feedback-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Services (delivery / warranty) ---------- */
.mm-services { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.mm-services li { display: flex; gap: 14px; padding: 16px 20px; border-top: 1px solid #EEF1F4; font-size: var(--mm-fs-sm); color: var(--mm-muted); }
.mm-services li:first-child { border-top: 0; }
.mm-services li > .mm-icon { flex: none; color: var(--mm-brand); }
.mm-services li > span { display: flex; flex-direction: column; gap: 2px; }
.mm-services strong { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--mm-fs-md); color: var(--mm-text); }
.mm-services .mm-free-delivery { display: block; color: var(--mm-success); font-weight: 600; }
.mm-services__link { align-items: center; }
.mm-services__link .mm-link-btn { font-size: var(--mm-fs-md); font-weight: 600; }
.mm-virtula { display: block; }
.mm-virtula:empty, .mm-virtula .virtula-price-container:empty { display: none; }

/* ---------- Details: tabs / accordion ---------- */
.mm-pdp__details { padding: 0; overflow: hidden; border-radius: var(--mm-r-xl); }
.mm-pdp__tabs { padding: 0 16px; gap: 4px; }
.mm-pdp__tabs .mm-tab { height: 56px; padding: 0 16px; }
.mm-pdp__panel { display: none; padding: 28px 32px; }
.mm-pdp__panel:focus { outline: none; }
.mm-pdp__panel:focus-visible { outline: 2px solid var(--mm-brand); outline-offset: -2px; }
@media (min-width: 768px) {
  .mm-pdp__panel.is-active { display: block; }
}
.mm-pdp__acc {
  display: none; width: 100%; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px;
  border: 0; border-top: 1px solid #EEF1F4; background: #fff; color: var(--mm-text);
  font-size: var(--mm-fs-md); font-weight: 600; text-align: left; cursor: pointer;
}
.mm-pdp__acc > span { flex: 1; }
.mm-pdp__acc .mm-icon { color: var(--mm-muted); transition: transform .2s; }
.mm-pdp__acc[aria-expanded="true"] .mm-icon { transform: rotate(180deg); }

.mm-prose { max-width: 820px; color: var(--mm-text-2); line-height: 1.6; }
.mm-prose img { max-width: 100%; height: auto; }
.mm-prose table { max-width: 100%; }
.mm-prose > :first-child { margin-top: 0; }
.mm-prose > :last-child { margin-bottom: 0; }
.mm-specs--cols { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); column-gap: 40px; }
.mm-specs--cols > div { display: flex; justify-content: space-between; gap: 16px; border-bottom-color: #EEF1F4; font-size: var(--mm-fs-md); }
.mm-specs--cols dd { text-align: right; }
.mm-pdp__ship-list { margin: 0 0 16px; padding-left: 18px; }
.mm-pdp__ship-list li { margin-bottom: 6px; }
.mm-pdp__ship-list .mm-free-delivery { color: var(--mm-success); font-weight: 600; }
.mm-pdp__ship-list .mm-free-delivery::before { content: "· "; }
.mm-pdp__ship-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.mm-pdp__ship-links a { font-weight: 600; }

/* Review and comment components inside the panels (their markup is shared with other themes). */
.mm-pdp__panel .reviews-module hr, .mm-pdp__panel .comments hr { border-color: var(--mm-border); }
.mm-pdp__panel .rating-average { font-family: var(--mm-font-display); font-size: 40px; font-weight: 800; margin: 0; color: var(--mm-text); }
.mm-pdp__panel .rating-item { display: flex; align-items: center; gap: 12px; font-size: var(--mm-fs-sm); }
.mm-pdp__panel .rating-item .progress { flex: 1; height: 8px; border-radius: 4px; background: var(--mm-bg); }
.mm-pdp__panel .progress-bar.bg-warning { background: var(--mm-accent) !important; }
.mm-pdp__panel .review-item-list > div, .mm-pdp__panel .comment-item-list > div[dir-paginate] {
  padding: 16px 0; border-bottom: 1px solid #EEF1F4;
}
.mm-pdp__panel .review-title, .mm-pdp__panel .commenter-name { font-weight: 700; color: var(--mm-text); }
.mm-pdp__panel .form-control { border-color: var(--mm-border-strong); border-radius: var(--mm-r-btn); }
.mm-pdp__panel .btn-blue, .mm-pdp__panel .btn-primary {
  height: var(--mm-btn-h); padding: 0 20px; border: 0; border-radius: var(--mm-r-btn);
  background: var(--mm-brand); color: #fff; font-weight: 700;
}

/* ---------- Accessories (cross-sell) ---------- */
.mm-accessories { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mm-accessory {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  background: #fff; border: 1px solid var(--mm-border); border-radius: var(--mm-r-tile);
}
.mm-accessory__img { flex: none; display: flex; width: 64px; height: 64px; padding: 4px; box-sizing: border-box; border-radius: var(--mm-r-btn); background: var(--mm-surface-2); }
.mm-accessory__img img { width: 100%; height: 100%; object-fit: contain; }
.mm-accessory__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mm-accessory__name {
  color: var(--mm-text); font-size: var(--mm-fs-sm); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mm-accessory__name:hover { color: var(--mm-brand); }
.mm-accessory__price { font-size: var(--mm-fs-base); }
.mm-accessory__add {
  flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 1.5px solid var(--mm-border-strong); border-radius: var(--mm-r-btn); background: #fff; color: var(--mm-ink); cursor: pointer;
}
.mm-accessory__add:hover { border-color: var(--mm-ink); background: var(--mm-accent); }

/* Recently viewed comes wrapped in .product-carousel-item from the module component. */
.mm-pdp__recent .product-carousel-item { display: contents; }

/* ---------- Sticky bar (phones) ---------- */
.mm-pdp-bar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--mm-tabbar-h) + env(safe-area-inset-bottom, 0px)); z-index: 1030;
  display: none; gap: 10px; padding: 10px 16px;
  background: #fff; border-top: 1px solid var(--mm-border); box-shadow: 0 -4px 16px rgba(18, 23, 29, .06);
}
.mm-pdp-bar .mm-btn { flex: 1 1 0; min-width: 0; height: 52px; padding: 0 10px; white-space: nowrap; }
.mm-pdp-bar .mm-pdp-bar__add { flex: 1.6 1 0; font-size: 15px; }
.mm-pdp-bar .mm-btn:disabled { opacity: .5; }

/* ---------- Lightbox ---------- */
.mm-lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(18, 23, 29, .92);
}
.mm-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.mm-lightbox::backdrop { background: transparent; }
.mm-lightbox__img { max-width: calc(100vw - 160px); max-height: calc(100vh - 80px); object-fit: contain; background: #fff; border-radius: var(--mm-r-lg); }
.mm-lightbox__close, .mm-lightbox__nav {
  position: absolute; display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
}
.mm-lightbox__close:hover, .mm-lightbox__nav:hover { background: rgba(255, 255, 255, .24); }
.mm-lightbox__close { top: 16px; right: 16px; }
.mm-lightbox__nav { top: 50%; margin-top: -24px; }
.mm-lightbox__nav--prev { left: 16px; }
.mm-lightbox__nav--next { right: 16px; }
.mm-lightbox.is-single .mm-lightbox__nav { display: none; }

/* ---------- Modals ---------- */
.mm-modal .modal-content > .mm-h3 { margin: 0 0 12px; padding-right: 32px; }
.mm-modal .modal-content > p { margin: 0 0 12px; }
.mm-modal__center { align-items: center; text-align: center; }
.mm-modal__icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; }
.mm-modal__icon--success { background: var(--mm-success-soft); color: var(--mm-success); }
.mm-credit-terms .mm-specs { margin-bottom: 8px; }
.mm-credit-terms__note { font-size: var(--mm-fs-sm); }
.mm-form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.mm-form__row { display: flex; gap: 10px; }
.mm-form__row > * { flex: 1; min-width: 0; }
.mm-form .mm-textarea { height: auto; padding: 10px 14px; }
.mm-form .mm-btn { align-self: flex-start; margin-top: 4px; }
.mm-cheaper__head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px; padding-right: 32px; }
.mm-cheaper__head p { margin: 0 0 4px; }
.mm-cheaper__img { flex: none; width: 96px; height: 96px; object-fit: contain; border-radius: var(--mm-r-lg); background: var(--mm-surface-2); }

/* ---------- Phones (board 14) ---------- */
@media (max-width: 767.98px) {
  .mm-pdp { gap: 10px; padding-top: 0; }
  .mm-pdp--has-bar { padding-bottom: 88px; }
  .mm-pdp__top { gap: 10px; }
  .mm-pdp__media { flex-basis: 100%; margin: 0 calc(-1 * var(--mm-gutter)); }
  .mm-gallery__stage { border: 0; border-radius: 0; }
  .mm-gallery__track { height: 340px; }
  .mm-gallery__slide { padding: 64px 24px 32px; cursor: default; }
  .mm-pdp__badge { top: auto; bottom: 12px; left: 16px !important; }

  .mm-pdp__info { flex-basis: 100%; gap: 10px; margin: 0 calc(-1 * var(--mm-gutter)); }
  .mm-pdp__head, .mm-options, .mm-buy, .mm-services { padding: 16px; background: #fff; border: 0; border-radius: 0; }
  .mm-pdp__title { font-size: 22px; line-height: 1.2; }
  .mm-pdp__brand { font-size: var(--mm-fs-xs); letter-spacing: .05em; }
  .mm-pdp__meta { font-size: var(--mm-fs-xs); }
  .mm-buy { gap: 14px; }
  .mm-buy__price { font-size: 30px; }
  .mm-buy__credit-line { font-size: var(--mm-fs-sm); }
  /* The sticky bar carries the main actions; the box keeps the heart and compare. */
  .mm-buy__main, .mm-buy__credit { display: none; }
  .mm-buy__fav { width: 44px; height: 44px; }
  .mm-buy__links { flex-basis: auto; align-items: center; }
  .mm-services { padding: 0; }
  .mm-services li { padding: 12px 16px; }
  .mm-virtula { margin: 0 16px; }

  .mm-pdp__details { margin: 0 calc(-1 * var(--mm-gutter)); border: 0; border-radius: 0; }
  .mm-pdp__acc { display: flex; }
  .mm-pdp__acc:first-of-type { border-top: 0; }
  .mm-pdp__panel { padding: 4px 16px 20px; }
  .mm-pdp__panel.is-open { display: block; }
  .mm-specs--cols { grid-template-columns: 1fr; }

  .mm-pdp .mm-section { gap: 12px; padding-top: 12px; }
  .mm-pdp .mm-h2 { font-size: 20px; }
  .mm-accessories, .mm-pdp__row {
    display: grid; grid-auto-flow: column; grid-template-columns: none; gap: 10px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(-1 * var(--mm-gutter)); padding: 0 var(--mm-gutter);
  }
  .mm-accessories { grid-auto-columns: minmax(260px, 82%); }
  .mm-pdp__row { grid-auto-columns: minmax(160px, 46%); }
  .mm-accessories::-webkit-scrollbar, .mm-pdp__row::-webkit-scrollbar { display: none; }
  .mm-accessories > *, .mm-pdp__row > *, .mm-pdp__recent .product-carousel-item > * { scroll-snap-align: start; }

  .mm-pdp-bar { display: flex; }
  .mm-pdp--has-bar ~ .mm-toast, body:has(.mm-pdp-bar) .mm-toast { bottom: calc(var(--mm-tabbar-h) + env(safe-area-inset-bottom, 0px) + 84px); }

  .mm-lightbox__img { max-width: 100vw; max-height: calc(100vh - 140px); border-radius: 0; }
  .mm-lightbox__nav { top: auto; bottom: 16px; margin-top: 0; }
  .mm-form__row { flex-direction: column; }
}

/* Spec sheet sections (develop 79c528e9) and the staff-only vendor line's states. */
.mm-specs__group { margin: 24px 0 4px; font-family: var(--mm-font-display); font-size: 17px; font-weight: 800; color: var(--mm-text); }
.mm-specs__group:first-child { margin-top: 0; }
.mm-text-danger { color: var(--mm-discount); }
