/* Muslim Pearls — mobile-first single product page */

body.single-product {
    --mp-sp-bg: #fbf8f2;
    --mp-sp-surface: #fffdf9;
    --mp-sp-text: #1d1917;
    --mp-sp-muted: #746b66;
    --mp-sp-border: #ddd5ca;
    --mp-sp-soft: #f2ece3;
    --mp-sp-accent: #8b6b3f;
    --mp-sp-action: #171514;
    --mp-sp-whatsapp: #21c767;
    background: var(--mp-sp-bg);
    color: var(--mp-sp-text);
}

body.single-product *,
body.single-product *::before,
body.single-product *::after { box-sizing: border-box; }

body.single-product .site-main,
body.single-product main { max-width: none; }

.mp-single-product { width: 100%; margin: 0; padding: 0 0 88px; }
.mp-single-product__container { width: 100%; max-width: 1320px; margin: 0 auto; }
.mp-single-product__breadcrumb { display: none; }
.mp-single-product__layout { display: block; width: 100%; }
.mp-single-product__gallery,
.mp-single-product__summary { width: 100%; min-width: 0; }
.woocommerce div.product.mp-single-product div.images,
.woocommerce div.product.mp-single-product div.summary { float: none !important; width: 100% !important; margin: 0 !important; }
.woocommerce div.product.mp-single-product::after { display: none; content: none; }

/* Gallery */
.mp-product-gallery { width: 100% !important; margin: 0 !important; float: none !important; }
.mp-product-gallery__viewport { position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: #f2ece4; touch-action: pan-y pinch-zoom; }
.mp-product-gallery__track { position: relative; width: 100%; height: 100%; }
.mp-product-gallery__slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .22s ease; }
.mp-product-gallery__slide.is-active { opacity: 1; visibility: visible; pointer-events: auto; }
.mp-product-gallery__image-link { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.mp-product-gallery__image { display: block; width: 100% !important; height: 100% !important; margin: 0 !important; object-fit: cover; object-position: center top; }
.mp-product-gallery__arrow,
.mp-product-gallery__zoom { position: absolute; z-index: 4; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(30,25,22,.12); border-radius: 50%; background: rgba(255,255,255,.92); color: var(--mp-sp-text); box-shadow: 0 6px 18px rgba(30,25,22,.09); cursor: pointer; }
.mp-product-gallery__arrow { top: 50%; transform: translateY(-50%); font-size: 28px; line-height: 1; }
.mp-product-gallery__arrow--prev { left: 10px; }
.mp-product-gallery__arrow--next { right: 10px; }
.mp-product-gallery__arrow:disabled { opacity: .3; cursor: default; }
.mp-product-gallery__zoom { right: 12px; bottom: 12px; }
.mp-product-gallery__meta { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 10px 16px 0; }
.mp-product-gallery__counter { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--mp-sp-muted); }
.mp-product-gallery__progress { width: 100%; height: 3px; appearance: none; border: 0; border-radius: 20px; overflow: hidden; background: var(--mp-sp-border); }
.mp-product-gallery__progress::-webkit-progress-bar { background: var(--mp-sp-border); }
.mp-product-gallery__progress::-webkit-progress-value { background: var(--mp-sp-text); }
.mp-product-gallery__progress::-moz-progress-bar { background: var(--mp-sp-text); }

/* Summary */
.mp-single-product__summary { padding: 20px 22px 6px; }
.mp-product-intro { margin: 0 0 20px; }
.mp-product-intro__main { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.mp-product-intro__copy { min-width: 0; }
.mp-product-intro__title { margin: 0 0 6px !important; color: #5f5854; font-family: Georgia, 'Times New Roman', serif; font-size: 21px !important; font-weight: 600; line-height: 1.16; letter-spacing: -.018em; }
.mp-product-intro__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0; color: var(--mp-sp-text); font-size: 26px; font-weight: 700; line-height: 1.15; }
.mp-product-intro__price del { color: #978f8b; font-size: .66em; font-weight: 400; opacity: .8; }
.mp-product-intro__price ins { color: inherit; text-decoration: none; }
.mp-product-intro__rating { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--mp-sp-muted); font-size: 12px; }
.mp-product-intro__rating .star-rating { margin: 0; color: var(--mp-sp-accent); }
.mp-product-share { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin: 1px 0 0; padding: 0; border: 0; background: transparent; color: var(--mp-sp-text); cursor: pointer; }

/* Variation custom controls */
.mp-product-option { margin: 0 0 24px; }
.mp-product-option__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.mp-product-option__label { color: var(--mp-sp-text); font-size: 12px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.mp-product-option__selected { flex: 1 1 auto; color: var(--mp-sp-muted); font-size: 12px; }
.mp-color-options { display: flex; gap: 9px; overflow-x: auto; padding: 1px 1px 4px; scrollbar-width: none; }
.mp-color-options::-webkit-scrollbar { display: none; }
.mp-color-option { flex: 0 0 55px; min-width: 55px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--mp-sp-text); cursor: pointer; text-align: center; }
.mp-color-option__image { display: block; width: 55px; height: 55px; overflow: hidden; border: 1px solid var(--mp-sp-border); background: var(--mp-sp-soft); transition: border-color .15s ease, box-shadow .15s ease; }
.mp-color-option__image img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.mp-color-option__placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg,#f4efe8,#e9dfd1); }
.mp-color-option__name { display: block; margin-top: 5px; overflow: hidden; color: #4e4845; font-size: 10px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.mp-color-option.is-selected .mp-color-option__image { border: 2px solid var(--mp-sp-text); box-shadow: 0 0 0 1px var(--mp-sp-bg); }
.mp-color-option.is-disabled { opacity: .35; cursor: not-allowed; }
.mp-size-guide-trigger { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--mp-sp-accent); font-size: 11px; font-weight: 600; cursor: pointer; }
.mp-size-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.mp-size-option { min-height: 42px; padding: 8px 10px; border: 1px solid var(--mp-sp-border); background: rgba(255,255,255,.56); color: var(--mp-sp-text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: .15s ease; }
.mp-size-option.is-selected { border-color: var(--mp-sp-text); background: var(--mp-sp-text); color: #fff; }
.mp-size-option.is-disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }

/* Native variation form fallback */
.mp-product-purchase form.cart { width: 100%; margin: 0; }
.mp-product-purchase form.variations_form .variations { width: 100%; margin: 0 0 14px; }
.mp-product-purchase form.variations_form .variations th,
.mp-product-purchase form.variations_form .variations td { display: block; width: 100%; padding: 0 0 7px; text-align: left; }
.mp-product-purchase form.variations_form .variations label { font-size: 12px; font-weight: 700; }
.mp-product-purchase form.variations_form .variations select { width: 100%; min-height: 44px; border: 1px solid var(--mp-sp-border); background: #fff; }
.mp-product-purchase form.variations_form .variations tr.mp-native-variation-hidden { display: none !important; }
.mp-product-purchase .reset_variations { display: inline-block; margin-top: 8px; color: var(--mp-sp-muted); font-size: 11px; }
.mp-product-purchase .single_variation { margin: 0 0 10px; color: var(--mp-sp-text); font-size: 13px; }
.mp-product-purchase .quantity { display: none !important; }
.mp-product-purchase .single_add_to_cart_button { display: inline-flex !important; align-items: center; justify-content: center; width: 100% !important; min-height: 46px !important; margin: 0 0 8px !important; padding: 10px 14px !important; border: 1px solid var(--mp-sp-action) !important; border-radius: 2px !important; background: var(--mp-sp-action) !important; color: #fff !important; font-size: 12px !important; font-weight: 800 !important; letter-spacing: .02em; text-align: center; text-transform: uppercase; }
.mp-product-purchase .single_add_to_cart_button:disabled { opacity: 1; }
.mp-product-secondary-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 0; }
.mp-product-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 2px; font: inherit; font-size: 12px; font-weight: 800; letter-spacing: .015em; text-transform: uppercase; cursor: pointer; }
.mp-product-action--buy { border: 1px solid var(--mp-sp-action); background: transparent; color: var(--mp-sp-action); }
.mp-product-action--whatsapp { border: 1px solid var(--mp-sp-whatsapp); background: var(--mp-sp-whatsapp); color: #fff; }
.mp-product-feedback { min-height: 0; margin: 9px 0 0; color: #b42318; font-size: 12px; line-height: 1.4; }

/* Accordions */
.mp-product-accordions { margin: 16px 0 0; border-top: 1px solid var(--mp-sp-border); }
.mp-product-accordion { border-bottom: 1px solid var(--mp-sp-border); }
.mp-product-accordion__trigger { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 52px; padding: 15px 0; border: 0; background: transparent; color: var(--mp-sp-text); font: inherit; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-align: left; text-transform: uppercase; cursor: pointer; }
.mp-product-accordion__trigger svg { flex: 0 0 auto; transition: transform .2s ease; }
.mp-product-accordion.is-open .mp-product-accordion__trigger svg { transform: rotate(180deg); }
.mp-product-accordion__panel[hidden] { display: none; }
.mp-product-accordion__content { padding: 0 0 17px; color: #5f5753; font-size: 13px; line-height: 1.7; }
.mp-product-accordion__content p { margin: 0 0 9px; }
.mp-product-accordion__content p:last-child { margin-bottom: 0; }
.mp-product-accordion__content ul,
.mp-product-accordion__content ol { margin: 8px 0 10px; padding-left: 18px; }
.mp-product-accordion__content li { margin-bottom: 5px; }

/* Related */
.mp-single-product__after-summary { width: 100%; margin-top: 18px; }
.mp-related-products { width: 100%; margin: 0; padding: 22px 0 18px; border-top: 1px solid var(--mp-sp-border); overflow: hidden; }
.mp-related-products__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 22px 16px; }
.mp-related-products__header h2 { margin: 0; color: var(--mp-sp-text); font-family: Georgia, 'Times New Roman', serif; font-size: 21px; line-height: 1.15; }
.mp-related-products__nav { display: none; gap: 8px; }
.mp-related-products__nav button { width: 38px; height: 38px; border: 1px solid var(--mp-sp-border); border-radius: 50%; background: #fff; color: var(--mp-sp-text); cursor: pointer; }
.mp-related-products__viewport { width: 100%; overflow-x: auto; padding-left: 22px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.mp-related-products__viewport::-webkit-scrollbar { display: none; }
.mp-related-products__track { display: flex !important; flex-wrap: nowrap !important; gap: 10px; width: max-content !important; margin: 0 !important; padding: 0 22px 0 0 !important; list-style: none !important; }
.mp-related-card { flex: 0 0 calc((100vw - 54px) / 2); width: calc((100vw - 54px) / 2) !important; margin: 0 !important; padding: 0 !important; scroll-snap-align: start; background: #fff; border: 1px solid rgba(33,28,25,.08); }
.mp-related-card__image { display: block; aspect-ratio: 4/5; overflow: hidden; background: var(--mp-sp-soft); }
.mp-related-card__image img { display: block; width: 100% !important; height: 100% !important; margin: 0 !important; object-fit: cover; object-position: center top; }
.mp-related-card__body { padding: 10px 10px 12px; }
.mp-related-card__title { display: block; overflow: hidden; color: #4d4744; font-size: 12px; line-height: 1.35; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.mp-related-card__price { margin-top: 7px; color: var(--mp-sp-text); font-size: 17px; font-weight: 700; line-height: 1.2; }
.mp-related-card__price del { color: #958e8a; font-size: .68em; font-weight: 400; }
.mp-related-card__price ins { color: inherit; text-decoration: none; }

/* Size guide */
.mp-size-guide[hidden], .mp-product-lightbox[hidden] { display: none !important; }
.mp-size-guide, .mp-product-lightbox { position: fixed; inset: 0; z-index: 10020; display: flex; align-items: center; justify-content: center; padding: 16px; }
.mp-size-guide__overlay, .mp-product-lightbox__overlay { position: absolute; inset: 0; background: rgba(15,12,10,.76); backdrop-filter: blur(5px); }
.mp-size-guide__dialog { position: relative; z-index: 1; width: min(440px,100%); padding: 26px 24px; background: #fff; color: var(--mp-sp-text); box-shadow: 0 28px 70px rgba(0,0,0,.25); }
.mp-size-guide__dialog h2 { margin: 0 0 12px; font-family: Georgia, 'Times New Roman', serif; font-size: 24px; }
.mp-size-guide__dialog p { margin: 0; color: var(--mp-sp-muted); font-size: 14px; line-height: 1.65; }
.mp-size-guide__close { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; background: transparent; font-size: 28px; cursor: pointer; }

/* Lightbox */
.mp-product-lightbox { padding: 0; }
.mp-product-lightbox__dialog { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: #f8f4ed; }
.mp-product-lightbox__stage { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 48px 14px 20px; }
.mp-product-lightbox__stage img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.mp-product-lightbox__close,
.mp-product-lightbox__arrow { position: absolute; z-index: 3; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(20,18,16,.78); color: #fff; cursor: pointer; }
.mp-product-lightbox__close { top: max(10px, env(safe-area-inset-top)); right: 10px; font-size: 26px; }
.mp-product-lightbox__arrow { top: 50%; transform: translateY(-50%); font-size: 30px; }
.mp-product-lightbox__arrow--prev { left: 10px; }
.mp-product-lightbox__arrow--next { right: 10px; }
html.mp-modal-open { overflow: hidden; }

/* Focus */
body.single-product button:focus-visible,
body.single-product a:focus-visible,
body.single-product select:focus-visible,
body.single-product input:focus-visible { outline: 2px solid var(--mp-sp-accent); outline-offset: 2px; }

@media (min-width: 480px) {
    .mp-size-options { grid-template-columns: repeat(4,minmax(0,1fr)); }
}

@media (min-width: 768px) {
    .mp-single-product { padding: 24px 24px 70px; }
    .mp-single-product__breadcrumb { display: block; margin: 0 0 20px; color: var(--mp-sp-muted); font-size: 12px; }
    .mp-single-product__breadcrumb .woocommerce-breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
    .mp-single-product__layout { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(340px,.95fr); gap: 34px; align-items: start; }
    .mp-single-product__summary { padding: 8px 0 0; }
    .mp-product-gallery__viewport { border-radius: 2px; }
    .mp-product-intro__title { font-size: 24px !important; }
    .mp-product-secondary-actions { grid-template-columns: 1fr; }
    .mp-related-products { margin-top: 30px; padding-top: 28px; }
    .mp-related-products__header { padding-inline: 0; }
    .mp-related-products__viewport { padding-left: 0; }
    .mp-related-products__track { gap: 14px; padding-right: 0 !important; }
    .mp-related-card { flex-basis: calc((100vw - 90px) / 3); width: calc((100vw - 90px) / 3) !important; max-width: 280px; }
    .mp-related-products__nav { display: flex; }
}

@media (min-width: 1024px) {
    .mp-single-product { padding-inline: 38px; }
    .mp-single-product__layout { grid-template-columns: minmax(0,1.15fr) minmax(390px,.85fr); gap: clamp(42px,5vw,76px); }
    .mp-single-product__gallery { position: sticky; top: 20px; }
    .mp-product-gallery__viewport { aspect-ratio: 4 / 5; }
    .mp-product-intro__title { font-size: 26px !important; }
    .mp-product-intro__price { font-size: 30px; }
    .mp-related-card { flex-basis: 230px; width: 230px !important; }
    .mp-product-gallery__image { object-fit: contain; background: #f4efe8; }
}

@media (min-width: 1280px) {
    .mp-single-product { padding-inline: 52px; }
    .mp-single-product__container { max-width: 1420px; }
    .mp-single-product__layout { grid-template-columns: minmax(0,760px) minmax(420px,520px); justify-content: center; }
    .mp-related-card { flex-basis: 250px; width: 250px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .mp-product-gallery__slide,
    .mp-product-accordion__trigger svg,
    .mp-size-option,
    .mp-color-option__image { transition: none !important; }
}

/* =========================================
   Mobile viewport hardening + final polish 1.1.2
   Prevents horizontal page drift/cropping on real Android browsers.
   ========================================= */
html {
    overflow-x: clip;
}

body.single-product {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    overscroll-behavior-x: none;
}

body.single-product #page,
body.single-product .site,
body.single-product #primary,
body.single-product .content-area,
body.single-product .site-main,
body.single-product main,
body.single-product article.product,
body.single-product .mp-single-product,
body.single-product .mp-single-product__container,
body.single-product .mp-single-product__layout,
body.single-product .mp-single-product__gallery,
body.single-product .mp-single-product__summary,
body.single-product .mp-single-product__after-summary {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.mp-product-gallery,
.mp-product-gallery__shell,
.mp-product-gallery__viewport,
.mp-product-gallery__track,
.mp-product-gallery__slide,
.mp-product-purchase,
.mp-product-purchase__native,
.mp-product-accordions,
.mp-related-products,
.mp-related-products__viewport {
    max-width: 100%;
    min-width: 0;
}

.mp-product-gallery__viewport,
.mp-color-options,
.mp-related-products__viewport {
    overscroll-behavior-inline: contain;
}

.mp-product-gallery__viewport {
    touch-action: pan-y pinch-zoom;
}

.mp-related-products__viewport {
    touch-action: pan-x pan-y;
}

@media (max-width: 767px) {
    .mp-single-product {
        overflow: clip;
    }

    .mp-single-product__summary {
        padding: 18px 16px 4px;
    }

    .mp-product-intro {
        margin-bottom: 18px;
    }

    .mp-product-intro__main {
        gap: 10px;
    }

    .mp-product-intro__title {
        font-size: 20px !important;
        line-height: 1.18;
    }

    .mp-product-intro__price {
        font-size: 25px;
    }

    .mp-product-option {
        margin-bottom: 20px;
    }

    .mp-product-purchase form.cart,
    .mp-product-purchase form.variations_form,
    .mp-product-purchase .single_variation_wrap,
    .mp-product-purchase .woocommerce-variation-add-to-cart,
    .mp-product-purchase .single_add_to_cart_button,
    .mp-product-secondary-actions,
    .mp-product-action {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .mp-product-purchase .single_add_to_cart_button,
    .mp-product-action {
        min-height: 48px !important;
    }

    .mp-product-gallery__meta {
        padding-inline: 16px;
    }

    .mp-related-products__header {
        padding-inline: 16px;
    }

    .mp-related-products__viewport {
        padding-left: 16px;
        padding-right: 0;
    }

    .mp-related-products__track {
        gap: 10px;
        padding-right: 16px !important;
    }

    .mp-related-card {
        flex: 0 0 clamp(142px, 43vw, 168px);
        width: clamp(142px, 43vw, 168px) !important;
        max-width: calc(100vw - 32px);
    }

    .mp-related-card__body {
        padding: 9px 9px 11px;
    }

    .mp-related-card__title {
        font-size: 11.5px;
    }

    .mp-related-card__price {
        font-size: 16px;
    }

    .mp-header,
    .mp-footer,
    .mp-ref-bottom {
        max-width: 100vw;
    }
}

@media (max-width: 359px) {
    .mp-single-product__summary {
        padding-inline: 14px;
    }

    .mp-product-intro__title {
        font-size: 19px !important;
    }

    .mp-related-products__header,
    .mp-product-gallery__meta {
        padding-inline: 14px;
    }

    .mp-related-products__viewport {
        padding-left: 14px;
    }

    .mp-related-products__track {
        padding-right: 14px !important;
    }

    .mp-related-card {
        flex-basis: clamp(136px, 42vw, 152px);
        width: clamp(136px, 42vw, 152px) !important;
    }
}

/* =========================================
   Mobile horizontal overflow hard-stop 1.1.3
   Closed legacy off-canvas panels were still able to extend the mobile
   document scroll width on some Android Chromium builds. Keep those panels
   out of layout until they are actually opened, and use overflow:hidden as
   the widely-supported fallback instead of relying on overflow:clip.
   ========================================= */
@media (max-width: 767px) {
    html,
    body.single-product {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    body.single-product {
        position: relative;
        overscroll-behavior-x: none;
    }

    /* Legacy MU drawers are rendered on the page even while closed. On some
       mobile browsers their translateX(100%) state contributes to scrollWidth.
       Remove them from layout while aria-hidden=true; their own JS restores
       them automatically by switching aria-hidden to false when opened. */
    body.single-product .mp-panel[aria-hidden="true"],
    body.single-product #mp-search-panel[aria-hidden="true"],
    body.single-product #mp-offcanvas-menu[aria-hidden="true"],
    body.single-product #mp-cart-drawer[aria-hidden="true"],
    body.single-product #mp-panel-categories[aria-hidden="true"],
    body.single-product #mp-panel-cart[aria-hidden="true"],
    body.single-product #mp-panel-account[aria-hidden="true"] {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: none !important;
    }

    body.single-product #page,
    body.single-product .site,
    body.single-product #primary,
    body.single-product .content-area,
    body.single-product .site-main,
    body.single-product main,
    body.single-product article.product,
    body.single-product .mp-single-product,
    body.single-product .mp-single-product__container,
    body.single-product .mp-single-product__layout,
    body.single-product .mp-single-product__gallery,
    body.single-product .mp-single-product__summary,
    body.single-product .mp-single-product__after-summary,
    body.single-product .mp-footer,
    body.single-product .mp-ref-bottom {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* Clip only the outer product canvas. Horizontal controls retain their
       own local scrolling below. */
    body.single-product .mp-single-product,
    body.single-product .mp-single-product__container,
    body.single-product .mp-single-product__layout,
    body.single-product .mp-single-product__after-summary,
    body.single-product .mp-related-products {
        overflow-x: hidden !important;
    }

    body.single-product .mp-color-options,
    body.single-product .mp-related-products__viewport {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        overscroll-behavior-x: contain !important;
        -webkit-overflow-scrolling: touch;
    }

    /* A max-content flex track can leak into document scrollWidth in certain
       Android layouts. Keep the track viewport-sized while its cards overflow
       only inside the dedicated carousel viewport. */
    body.single-product .mp-related-products__track {
        width: 100% !important;
        min-width: 100% !important;
        max-width: none !important;
    }

    body.single-product .mp-related-card,
    body.single-product .mp-related-card * {
        min-width: 0;
    }

    body.single-product img,
    body.single-product svg,
    body.single-product video,
    body.single-product iframe,
    body.single-product table,
    body.single-product form,
    body.single-product input,
    body.single-product select,
    body.single-product textarea,
    body.single-product button {
        max-width: 100%;
    }

    body.single-product .mp-product-accordion__content,
    body.single-product .mp-product-intro__title,
    body.single-product .mp-product-intro__copy {
        overflow-wrap: anywhere;
        word-break: normal;
    }
}

/* =========================================
   Single product final polish 1.1.4
   - Compact premium add-to-cart confirmation
   - Remove excess space below related products on mobile
   ========================================= */
body.single-product .woocommerce-notices-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 12px;
}

body.single-product .woocommerce-message {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 680px);
    min-height: 46px;
    margin: 8px auto 10px !important;
    padding: 8px 10px 8px 38px !important;
    overflow: hidden;
    color: #413b37 !important;
    background: rgba(255, 253, 249, 0.98) !important;
    border: 1px solid #ded6ca !important;
    border-radius: 9px !important;
    box-shadow: 0 6px 20px rgba(29, 25, 23, 0.055);
    font-size: 12px !important;
    font-weight: 600;
    line-height: 1.3 !important;
}

body.single-product .woocommerce-message::before {
    position: absolute !important;
    top: 50% !important;
    left: 12px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin: 0 !important;
    color: #fff !important;
    background: #2f8f5b;
    border-radius: 50%;
    content: "✓" !important;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    transform: translateY(-50%);
}

body.single-product .woocommerce-message .mp-cart-notice__copy {
    flex: 1 1 auto;
    min-width: 0;
}

body.single-product .woocommerce-message .button.wc-forward {
    flex: 0 0 auto;
    float: none !important;
    min-height: 30px;
    margin: 0 0 0 auto !important;
    padding: 7px 10px !important;
    color: #fff !important;
    background: #1d1917 !important;
    border: 1px solid #1d1917 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    font-size: 10.5px !important;
    font-weight: 750 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    white-space: nowrap;
}

@media (max-width: 767px) {
    body.single-product .woocommerce-notices-wrapper {
        padding-inline: 10px;
    }

    body.single-product .woocommerce-message {
        min-height: 44px;
        margin-top: 6px !important;
        margin-bottom: 8px !important;
        padding: 7px 8px 7px 36px !important;
        border-radius: 8px !important;
        font-size: 11.5px !important;
    }

    body.single-product .woocommerce-message::before {
        left: 11px !important;
        width: 17px;
        height: 17px;
        font-size: 10px;
    }

    body.single-product .woocommerce-message .button.wc-forward {
        min-height: 28px;
        padding: 6px 9px !important;
        font-size: 10px !important;
    }

    /* The fixed bottom navigation/footer already owns its safe-area spacing.
       The product article's previous 88px bottom padding created the large
       blank band visible after the related-products carousel. */
    body.single-product .mp-single-product {
        padding-bottom: 0 !important;
    }

    body.single-product .mp-single-product__after-summary {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    body.single-product .mp-related-products {
        margin-bottom: 0 !important;
        padding-bottom: 8px !important;
    }

    body.single-product .mp-related-products__viewport,
    body.single-product .mp-related-products__track {
        margin-bottom: 0 !important;
    }
}


/**
 * Muslim Pearls — Single Product Gallery Fix
 * Purpose: Keep WooCommerce product gallery thumbnails in a clean horizontal row
 *          and prevent stacked/numbered thumbnail layout on mobile.
 *
 * Add this at the END of:
 * wp-content/themes/muslim-pearls/assets/css/single-product.css
 */

/* =========================================================
   GALLERY WRAPPER
========================================================= */

body.single-product .mp-single-product__gallery,
body.single-product .woocommerce-product-gallery {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

/* Main image viewport */
body.single-product .woocommerce-product-gallery .flex-viewport {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 12px !important;
    overflow: hidden !important;
    border-radius: 0 !important;
}

/* Main gallery images */
body.single-product .woocommerce-product-gallery__wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

body.single-product .woocommerce-product-gallery__image {
    margin: 0 !important;
}

body.single-product .woocommerce-product-gallery__image > a {
    display: block !important;
    width: 100% !important;
}

body.single-product .woocommerce-product-gallery__image img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    object-fit: contain !important;
}

/* =========================================================
   THUMBNAILS — ONE CLEAN HORIZONTAL ROW
========================================================= */

body.single-product .woocommerce-product-gallery ol.flex-control-thumbs,
body.single-product .woocommerce-product-gallery .flex-control-thumbs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 8px !important;

    width: 100% !important;
    max-width: 100% !important;

    margin: 0 !important;
    padding: 0 0 4px !important;

    list-style: none !important;
    counter-reset: none !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

/* Remove browser numbering / markers completely */
body.single-product .woocommerce-product-gallery .flex-control-thumbs > li,
body.single-product .woocommerce-product-gallery .flex-control-thumbs > li::marker,
body.single-product .woocommerce-product-gallery .flex-control-thumbs > li::before {
    list-style: none !important;
    content: none !important;
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs > li {
    flex: 0 0 72px !important;
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;

    margin: 0 !important;
    padding: 0 !important;

    float: none !important;
    clear: none !important;

    border: 0 !important;
    background: transparent !important;

    scroll-snap-align: start;
}

/* Thumbnail image */
body.single-product .woocommerce-product-gallery .flex-control-thumbs img {
    display: block !important;

    width: 72px !important;
    height: 82px !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit: cover !important;
    object-position: center !important;

    background: #f8f7f4 !important;
    border: 1px solid #e8e6e1 !important;
    border-radius: 6px !important;

    opacity: .72 !important;
    cursor: pointer;
    box-sizing: border-box !important;

    transition:
        opacity 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

/* Active thumbnail */
body.single-product .woocommerce-product-gallery .flex-control-thumbs img.flex-active {
    opacity: 1 !important;
    border-color: #171717 !important;
    box-shadow: inset 0 0 0 1px #171717 !important;
}

/* Hover/focus */
@media (hover: hover) and (pointer: fine) {
    body.single-product .woocommerce-product-gallery .flex-control-thumbs img:hover {
        opacity: 1 !important;
        border-color: #9a948d !important;
    }
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs img:focus-visible {
    opacity: 1 !important;
    outline: 2px solid #171717 !important;
    outline-offset: 2px !important;
}

/* =========================================================
   PRODUCT GALLERY ZOOM BUTTON
========================================================= */

body.single-product .woocommerce-product-gallery__trigger {
    z-index: 6 !important;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {
    body.single-product .mp-single-product__gallery {
        width: 100% !important;
        min-width: 0 !important;
    }

    body.single-product .woocommerce-product-gallery .flex-viewport {
        margin-bottom: 10px !important;
    }

    body.single-product .woocommerce-product-gallery .flex-control-thumbs {
        gap: 7px !important;
        padding-inline: 0 !important;
    }

    body.single-product .woocommerce-product-gallery .flex-control-thumbs > li {
        flex-basis: 68px !important;
        width: 68px !important;
        min-width: 68px !important;
        max-width: 68px !important;
    }

    body.single-product .woocommerce-product-gallery .flex-control-thumbs img {
        width: 68px !important;
        height: 76px !important;
        border-radius: 5px !important;
    }
}

/* Very small phones */
@media (max-width: 374px) {
    body.single-product .woocommerce-product-gallery .flex-control-thumbs > li {
        flex-basis: 62px !important;
        width: 62px !important;
        min-width: 62px !important;
        max-width: 62px !important;
    }

    body.single-product .woocommerce-product-gallery .flex-control-thumbs img {
        width: 62px !important;
        height: 70px !important;
    }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    body.single-product .woocommerce-product-gallery .flex-control-thumbs img {
        transition: none !important;
    }
}


/* =========================================
   Muslim Pearls — Single Product Modern Polish 1.6.0
   Scope: single product only; preserves WooCommerce behaviour.
   ========================================= */

/* Brand is informational, not a shopper decision. */
.mp-product-brand {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    color: var(--mp-sp-muted);
    font-size: 11px;
    line-height: 1.35;
}

.mp-product-brand__label {
    color: #8b837d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.mp-product-brand__links {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.mp-product-brand__link {
    color: var(--mp-sp-text);
    font-weight: 700;
    text-decoration: none;
    text-underline-offset: 3px;
}

.mp-product-brand__link:hover,
.mp-product-brand__link:focus-visible {
    text-decoration: underline;
}

.mp-product-brand__separator {
    color: #b1aaa4;
}

/* Hide the native Brand selector only after a valid brand was resolved. */
.mp-product-purchase form.variations_form .variations tr.mp-native-brand-hidden {
    display: none !important;
}

/* Size guide has been intentionally removed from the product UI. */
.mp-size-guide-trigger,
.mp-size-guide {
    display: none !important;
}

/* Main gallery: product-first, clean and modern. */
body.single-product .woocommerce-product-gallery {
    position: relative;
    background: #f7f4ef;
}

body.single-product .woocommerce-product-gallery__image > a {
    cursor: zoom-in;
}

body.single-product .woocommerce-product-gallery__image img {
    background: #f7f4ef !important;
    object-fit: contain !important;
}

/* Replace WooCommerce's magnifying-glass/emoji trigger with a quiet View pill. */
body.single-product .woocommerce-product-gallery__trigger {
    top: 14px !important;
    right: 14px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 8 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: auto !important;
    min-width: 82px;
    height: 38px;
    padding: 0 13px !important;
    border: 1px solid rgba(29, 25, 23, .10) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .94) !important;
    color: #1d1917 !important;
    box-shadow: 0 8px 24px rgba(29, 25, 23, .08) !important;
    font-size: 0 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.single-product .woocommerce-product-gallery__trigger > span,
body.single-product .woocommerce-product-gallery__trigger img.emoji {
    display: none !important;
}

body.single-product .woocommerce-product-gallery__trigger::before {
    content: "" !important;
    position: static !important;
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: currentColor !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M8 3H3v5M16 3h5v5M8 21H3v-5M21 16v5h-5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M8 3H3v5M16 3h5v5M8 21H3v-5M21 16v5h-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

body.single-product .woocommerce-product-gallery__trigger::after {
    content: "View" !important;
    position: static !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    border: 0 !important;
    color: inherit !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: .055em;
    line-height: 1 !important;
    text-transform: uppercase;
}

@media (hover: hover) and (pointer: fine) {
    body.single-product .woocommerce-product-gallery__trigger:hover {
        background: #171514 !important;
        color: #fff !important;
        transform: translateY(-1px);
    }
}

/* Related products: one horizontal catalog row, no badges or CTA buttons. */
body.single-product .mp-related-products {
    width: 100%;
    margin: 18px 0 0;
    padding: 24px 0 18px;
    overflow: hidden;
    border-top: 1px solid var(--mp-sp-border);
}

body.single-product .mp-related-products__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 0 16px 14px;
}

body.single-product .mp-related-products__header h2 {
    margin: 0;
    color: var(--mp-sp-text);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(20px, 4.8vw, 25px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.018em;
}

body.single-product .mp-related-products__nav {
    display: none;
    align-items: center;
    gap: 7px;
}

body.single-product .mp-related-products__nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #ded9d1;
    border-radius: 50%;
    background: #fff;
    color: #1d1917;
    cursor: pointer;
}

body.single-product .mp-related-products__viewport {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 0 0 4px 16px !important;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

body.single-product .mp-related-products__viewport::-webkit-scrollbar {
    display: none;
}

body.single-product .mp-related-products__track {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch;
    gap: 12px !important;
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 16px 0 0 !important;
}

body.single-product .mp-related-card.mp-shop-card {
    flex: 0 0 clamp(145px, 44vw, 174px) !important;
    width: clamp(145px, 44vw, 174px) !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible;
    scroll-snap-align: start;
    border: 0 !important;
    background: transparent !important;
}

body.single-product .mp-related-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

body.single-product .mp-related-card .mp-shop-card__media-wrap {
    display: block;
    position: relative;
    overflow: hidden;
    background: #f5f4f0;
}

body.single-product .mp-related-card .mp-shop-card__media {
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #f5f4f0;
}

body.single-product .mp-related-card .mp-shop-card__media img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: transform 260ms cubic-bezier(.22,.61,.36,1);
}

body.single-product .mp-related-card .mp-shop-card__body {
    display: block;
    padding: 9px 0 0 !important;
}

body.single-product .mp-related-card .mp-shop-card__title {
    display: -webkit-box;
    min-height: 2.8em;
    overflow: hidden;
    color: #2a2926;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

body.single-product .mp-related-card .mp-shop-card__price {
    display: block;
    margin-top: 5px;
    color: #111;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.3;
}

body.single-product .mp-related-card .mp-shop-card__price del {
    margin-right: 5px;
    color: #a7a39c;
    font-size: .9em;
    font-weight: 400;
}

body.single-product .mp-related-card .mp-shop-card__price ins {
    color: inherit;
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    body.single-product .mp-related-card__link:hover .mp-shop-card__media img {
        transform: scale(1.025);
    }

    body.single-product .mp-related-card__link:hover .mp-shop-card__title {
        text-decoration: underline;
        text-underline-offset: 3px;
    }
}

/* The product page already has a dedicated WhatsApp order CTA and bottom-nav
   WhatsApp entry; hide the extra floating bubble here to stop mobile overlap. */
body.single-product .mpwa-float {
    display: none !important;
}

/* Tighter, calmer mobile rhythm. */
@media (max-width: 767px) {
    body.single-product .mp-single-product__summary {
        padding-top: 16px;
    }

    body.single-product .mp-product-intro {
        margin-bottom: 17px;
    }

    body.single-product .mp-product-option {
        margin-bottom: 18px;
    }

    body.single-product .mp-product-option__header {
        margin-bottom: 9px;
    }

    body.single-product .woocommerce-product-gallery__trigger {
        top: 10px !important;
        right: 10px !important;
        min-width: 76px;
        height: 36px;
        padding-inline: 11px !important;
    }
}

@media (min-width: 768px) {
    body.single-product .mp-related-products {
        margin-top: 30px;
        padding-top: 28px;
    }

    body.single-product .mp-related-products__header {
        padding-inline: 0;
        padding-bottom: 16px;
    }

    body.single-product .mp-related-products__viewport {
        padding-left: 0 !important;
    }

    body.single-product .mp-related-products__track {
        gap: 16px !important;
        padding-right: 0 !important;
    }

    body.single-product .mp-related-card.mp-shop-card {
        flex-basis: 210px !important;
        width: 210px !important;
    }

    body.single-product .mp-related-products__nav {
        display: flex;
    }
}

@media (min-width: 1200px) {
    body.single-product .mp-related-card.mp-shop-card {
        flex-basis: 230px !important;
        width: 230px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.single-product .woocommerce-product-gallery__trigger,
    body.single-product .mp-related-card .mp-shop-card__media img {
        transition: none !important;
    }
}
