/* Phone-only refinements. All content and desktop styles remain available. */
@media (max-width: 767.98px) {
    body.compact .pdp-mobile-header {
        gap: 10px;
        padding: 10px 0;
    }
    body.compact .pdp-mobile-title { min-width: 0; flex: 1; }
    body.compact .pdp-back,
    body.compact .pdp-search-btn {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
    }
    body.compact .pdp-gallery-stage .pdp-main-image:not(.is-comparison) {
        height: clamp(260px, 82vw, 350px) !important;
        min-height: 0 !important;
        margin: 0;
        padding: 8px;
        border-radius: 14px;
    }
    body.compact .pdp-gallery-stage .pdp-main-image:not(.is-comparison) > img {
        width: 100% !important;
        height: 100% !important;
        min-height: 0;
        max-height: 100% !important;
        aspect-ratio: auto !important;
        object-fit: contain !important;
    }
    body.compact .pdp-gallery-stage .pdp-main-image.is-comparison {
        margin: 0;
        border-radius: 14px;
    }
    body.compact .pdp-dots { gap: 10px; padding: 14px 0; }
    body.compact .pdp-dot { position: relative; }
    body.compact .pdp-dot::before { content: ''; position: absolute; inset: -7px; }
    body.compact .pdp-related-section > .row {
        --bs-gutter-x: 12px;
        --bs-gutter-y: 12px;
        align-items: stretch;
    }
    body.compact .pdp-related-section > .row > [class*='col-'] {
        width: 50%;
        flex: 0 0 50%;
        margin-bottom: 0 !important;
    }
    body.compact .pdp-related-card { height: 100%; }
    body.compact .pdp-related-card .product-image {
        height: auto !important;
        aspect-ratio: 1;
        min-height: 0;
    }
    body.compact .pdp-related-card .product-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    body.compact .pdp-related-card .product-info { padding: 10px; }
    body.compact .pdp-related-card .product-price { font-size: 1rem; }
    body.compact .pdp-related-head { gap: 12px; flex-wrap: wrap; }
    body.compact .pdp-related-head > a { min-height: 44px; display: inline-flex; align-items: center; }
    body.compact .pdp-sticky-actions { gap: 10px; }
    body.compact .sticky-cart-bar .cart-icon-link {
        display: grid !important;
        width: 44px;
        height: 48px;
        flex: 0 0 44px;
    }
    body.compact .sticky-cart-bar .sticky-add-btn {
        flex: 1;
        width: auto !important;
        min-width: 0 !important;
        padding: 8px 12px;
        gap: 8px;
        letter-spacing: 0;
    }
    body.compact .sticky-cart-bar .sticky-add-btn strong {
        display: inline !important;
        font-size: .9rem;
        white-space: nowrap;
    }
    body.compact .sticky-cart-bar .sticky-add-btn span { font-size: .95rem !important; }
    body.compact .sg-whatsapp-direct-icon {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        flex-basis: 44px !important;
        font-size: 1.35rem !important;
    }
    body.compact #sg-chatbot .sg-chat-launcher {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
    }
    body.compact #sg-chatbot { max-width: calc(100vw - 24px); }
    body.compact #sg-chatbot .sg-chat-panel {
        width: min(360px, calc(100vw - 24px));
        max-height: calc(100dvh - 170px - env(safe-area-inset-bottom, 0px));
    }
    body.compact .sort-sheet {
        max-height: calc(85dvh - env(safe-area-inset-top, 0px));
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
    }
    body.compact .filter-drawer { max-height: 100dvh; overscroll-behavior: contain; }
    body.compact .filter-drawer-header button { min-width: 44px; min-height: 44px; }
    body.compact .contact-section-wrapper { padding-top: 24px; }
}

/* Keep touch scrolling native; smooth only browser-driven anchor navigation. */
@media (max-width: 767.98px) and (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth !important; scroll-padding-top: 180px; }
    html:has(.pdp-section) { scroll-padding-top: 250px; }

    /* Render real section heights up front to avoid placeholder-size jumps. */
    body.compact :is(.sg-ritual-showcase-section, .testimonial-section,
        .home-blog-section, .cta-banner, .instagram-section) {
        content-visibility: visible;
        contain-intrinsic-size: none;
    }
}
@media (max-width: 767.98px) {
    body.compact :is(.filter-drawer, .sort-sheet, .cart-sidebar-body,
        .sg-chat-messages, .sg-bloom-image-stage) {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }
}
@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
}

/* Compact, readable footer without collapsing or removing any links. */
@media (max-width: 767.98px) {
    body.compact .sg-site-footer {
        margin-top: 32px;
        padding: 32px 0 calc(92px + env(safe-area-inset-bottom, 0px));
    }
    body.compact .sg-site-footer > .container { padding-inline: 20px; }
    body.compact .sg-footer-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 24px 16px;
        margin: 0;
    }
    body.compact .sg-footer-grid > [class*='col-'] {
        width: auto;
        min-width: 0;
        padding: 0;
        margin-bottom: 0 !important;
    }
    body.compact .sg-footer-brand,
    body.compact .sg-footer-newsletter { grid-column: 1 / -1; }
    body.compact .sg-site-footer h5 {
        margin-bottom: 12px;
        font-size: 1rem;
        font-weight: 700;
        line-height: 1.4;
    }
    body.compact .sg-site-footer p { margin-bottom: 12px; font-size: .875rem; line-height: 1.6; }
    body.compact .sg-footer-brand > div { display: flex; gap: 12px; }
    body.compact .sg-site-footer .social-link {
        display: inline-flex;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        margin: 0;
        line-height: 1;
    }
    body.compact .sg-footer-grid ul { margin: 0; }
    body.compact :is(.sg-footer-links, .sg-footer-policies) li { margin-bottom: 2px; }
    body.compact :is(.sg-footer-links, .sg-footer-policies) a {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        min-height: 40px;
        padding-block: 6px;
        font-size: .8125rem;
        line-height: 1.55;
        overflow-wrap: anywhere;
    }
    body.compact .sg-footer-newsletter {
        padding-top: 22px !important;
        border-top: 1px solid rgba(255,255,255,.2);
    }
    body.compact .sg-footer-subscribe {
        width: 100%;
        display: flex;
        align-items: stretch;
        gap: 8px;
    }
    body.compact .sg-footer-subscribe input[type='email'] {
        flex: 1 1 0%;
        width: 0;
        min-width: 0;
        height: 48px;
        padding: 12px;
        border-radius: 10px;
        font-size: 16px !important;
    }
    body.compact .sg-footer-subscribe .btn {
        flex: 0 0 auto;
        width: auto;
        min-width: 64px;
        min-height: 48px;
        margin-left: 0 !important;
        padding: 10px 18px;
        border-radius: 10px;
        font-size: .95rem;
        font-weight: 700;
    }
    body.compact .sg-site-footer hr { margin-block: 24px 18px; }
    body.compact .sg-footer-bottom { gap: 12px; text-align: center; }
    body.compact .sg-footer-bottom p { margin: 0; font-size: .75rem; }
    body.compact .sg-footer-payments { display: flex; justify-content: center; gap: 12px; font-size: 1.5rem; }
}

/* Hero pagination sits below the artwork instead of covering it. */
@media (max-width: 767.98px) {
    body.compact #homeCarousel {
        display: flex;
        flex-direction: column;
        width: calc(100% - 24px);
        margin: 12px auto 18px;
        border-radius: 18px;
        border: 1px solid #eee2d5;
        background: #fffaf4;
        box-shadow: 0 8px 24px rgba(65,24,84,.08);
    }
    body.compact #homeCarousel .carousel-inner { order: 0; }
    body.compact #homeCarousel .hero-img {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
    }
    body.compact #homeCarousel .sg-hero-mobile-footer {
        order: 1;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 6px 16px;
        padding: 16px 16px 4px;
    }
    body.compact #homeCarousel .sg-hero-mobile-eyebrow {
        color: #80624d;
        font-size: .55rem;
        font-weight: 700;
        letter-spacing: .1em;
    }
    body.compact #homeCarousel .sg-hero-mobile-footer p {
        color: #39203c !important;
        margin: 4px 0 0;
        font-size: 1rem;
        font-weight: 600;
        line-height: 1.4;
    }
    body.compact #homeCarousel .sg-hero-mobile-footer a {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        color: #6b109b !important;
        font-size: .8125rem;
        font-weight: 700;
        text-decoration: none;
    }
    body.compact #homeCarousel .carousel-indicators {
        position: relative;
        order: 2;
        inset: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 2px;
        margin: 0;
        padding: 0 0 8px;
    }
    body.compact #homeCarousel .carousel-indicators button {
        display: grid;
        place-items: center;
        width: 28px !important;
        min-width: 28px !important;
        height: 28px !important;
        min-height: 28px !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 50%;
        background: transparent !important;
        box-shadow: none !important;
        opacity: 1;
        text-indent: 0;
    }
    body.compact #homeCarousel .carousel-indicators button::before {
        content: '';
        display: block;
        width: 6px;
        height: 6px;
        border-radius: 999px;
        background: #c8b9cf;
        transition: width .25s ease, background-color .25s ease;
    }
    body.compact #homeCarousel .carousel-indicators button.active::before {
        width: 18px;
        background: #6b109b;
    }
    body.compact #homeCarousel .carousel-indicators button:focus-visible {
        outline: 2px solid #6b109b;
        outline-offset: 1px;
    }
}
