/*
 * Heikaya v6.18.3
 * FINAL phone product + homepage category UI.
 * Desktop (>767px) is intentionally untouched.
 */

@media (max-width: 767px) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body #page,
    body .site,
    body .site-content {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: clip !important;
    }

    /* ========================================================
       PRODUCT PAGE
       ======================================================== */

    body.single-product .site-content > .ast-container,
    body.single-product #primary,
    body.single-product .site-main {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    body.single-product .site-main {
        padding-top: 10px !important;
        padding-bottom: 44px !important;
    }

    body.single-product div.product {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* HOME is desktop-only. */
    body.single-product div.product > a.lumiere-product-home,
    body.single-product div.product > .lumiere-product-home,
    body.single-product .summary .lumiere-product-home {
        display: none !important;
        visibility: hidden !important;
        position: static !important;
        width: 0 !important;
        height: 0 !important;
        min-width: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
    }

    body.single-product div.product > .woocommerce-product-gallery {
        order: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        float: none !important;
        clear: both !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.single-product div.product > .summary {
        order: 2 !important;
        display: block !important;
        float: none !important;
        clear: both !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 17px 0 0 !important;
        padding: 0 3px !important;
    }

    /* Main media stage */
    body.single-product .woocommerce-product-gallery.lumiere-gallery-ready > .flex-viewport,
    body.single-product .woocommerce-product-gallery > .woocommerce-product-gallery__wrapper {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        overflow: hidden !important;
        border: 1px solid rgba(21,18,15,.08) !important;
        border-radius: 12px !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    body.single-product .woocommerce-product-gallery__image,
    body.single-product .woocommerce-product-gallery__image > a {
        width: 100% !important;
        aspect-ratio: 1 / 1 !important;
    }

    body.single-product .woocommerce-product-gallery__image img:not(.zoomImg) {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        padding: 4px !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    body.single-product .woocommerce-product-gallery__trigger {
        top: 8px !important;
        right: 8px !important;
        width: 36px !important;
        height: 36px !important;
        border: 1px solid rgba(21,18,15,.15) !important;
        background: rgba(255,253,249,.96) !important;
        box-shadow: none !important;
    }

    /* Thumbnail rail */
    body.single-product .woocommerce-product-gallery.lumiere-gallery-ready > .lumiere-gallery-rail {
        order: 2 !important;
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 8px 0 0 !important;
        padding: 0 0 3px !important;
        gap: 7px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.single-product .lumiere-gallery-rail::-webkit-scrollbar {
        display: none !important;
    }

    body.single-product .lumiere-gallery-rail .flex-control-thumbs {
        display: flex !important;
        flex-flow: row nowrap !important;
        gap: 7px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.single-product .lumiere-gallery-rail .flex-control-thumbs li,
    body.single-product .lumiere-gallery-rail .lumiere-video-trigger {
        flex: 0 0 62px !important;
        width: 62px !important;
        min-width: 62px !important;
        min-height: 62px !important;
        margin: 0 !important;
    }

    body.single-product .lumiere-gallery-rail .flex-control-thumbs img,
    body.single-product .lumiere-gallery-rail .lumiere-video-trigger {
        border-radius: 9px !important;
    }

    /* Any desktop gift container must never sit in the phone gallery. */
    body.single-product .woocommerce-product-gallery > .lumiere-gallery-gift-wrap {
        display: none !important;
    }

    /* Product copy */
    body.single-product div.product > .summary h1.product_title,
    body.single-product div.product > .summary .product_title.entry-title {
        margin: 0 0 10px !important;
        padding: 0 !important;
        font-size: clamp(31px, 8.6vw, 39px) !important;
        font-weight: 500 !important;
        line-height: 1.01 !important;
        letter-spacing: -.018em !important;
    }

    body.single-product div.product > .summary .price {
        margin: 0 0 12px !important;
        font-size: 20px !important;
        line-height: 1.15 !important;
    }

    body.single-product div.product > .summary .woocommerce-product-details__short-description,
    body.single-product div.product > .summary .woocommerce-product-details__short-description p {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        font-size: 14px !important;
        line-height: 1.62 !important;
    }

    body.single-product form.cart {
        width: 100% !important;
        margin: 17px 0 0 !important;
        padding: 0 !important;
    }

    /* Purchase flow: quantity + wishlist, then strong full-width CTA. */
    body.single-product .lumiere-purchase-actions {
        display: grid !important;
        grid-template-columns: 112px 52px !important;
        grid-template-areas:
            "qty wish"
            "add add" !important;
        justify-content: space-between !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
        margin: 0 !important;
    }

    body.single-product .lumiere-purchase-actions .quantity {
        grid-area: qty !important;
        display: grid !important;
        grid-template-columns: 32px 48px 32px !important;
        width: 112px !important;
        min-width: 112px !important;
        margin: 0 !important;
    }

    body.single-product .lumiere-purchase-actions .quantity .qty {
        width: 48px !important;
        min-width: 48px !important;
        height: 48px !important;
        min-height: 48px !important;
        padding: 0 !important;
    }

    body.single-product .lumiere-purchase-actions .lumiere-qty-step {
        width: 32px !important;
        min-width: 32px !important;
        height: 48px !important;
    }

    body.single-product .lumiere-purchase-actions .single_add_to_cart_button {
        grid-area: add !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 52px !important;
        margin: 0 !important;
        padding: 0 16px !important;
        border-radius: 999px !important;
        background: #15120f !important;
        border-color: #15120f !important;
        color: #fffdf9 !important;
        -webkit-text-fill-color: #fffdf9 !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        letter-spacing: .13em !important;
    }

    body.single-product .lumiere-purchase-actions .lumiere-single-wishlist {
        grid-area: wish !important;
        display: flex !important;
        width: 52px !important;
        min-width: 52px !important;
        margin: 0 !important;
    }

    body.single-product .lumiere-purchase-actions .lumiere-wishlist-button--single {
        width: 52px !important;
        min-width: 52px !important;
        min-height: 48px !important;
        padding: 0 !important;
        border-radius: 999px !important;
    }

    body.single-product .lumiere-purchase-actions .lumiere-wishlist-button__label {
        display: none !important;
    }

    /* Gift wrapping now naturally comes AFTER the purchase row inside form. */
    body.single-product form.cart > .lumiere-gift-wrap,
    body.single-product form.cart > .lumiere-gift-wrap__style {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    body.single-product form.cart > .lumiere-gift-wrap {
        margin: 13px 0 0 !important;
        padding: 14px 15px !important;
        border: 1px solid rgba(21,18,15,.13) !important;
        border-radius: 12px !important;
        background: #fffdf9 !important;
        box-shadow: none !important;
    }

    body.single-product .lumiere-gift-wrap__toggle {
        gap: 9px !important;
        color: #15120f !important;
        font-size: 13px !important;
        line-height: 1.35 !important;
    }

    body.single-product .lumiere-gift-wrap__toggle strong {
        margin-left: auto !important;
        color: #15120f !important;
        font-size: 11px !important;
    }

    body.single-product form.cart > .lumiere-gift-wrap__style {
        margin: 8px 0 0 !important;
        padding: 12px 14px !important;
        border: 1px solid rgba(21,18,15,.13) !important;
        border-radius: 12px !important;
        background: #fffdf9 !important;
    }

    body.single-product .product_meta {
        margin: 15px 0 0 !important;
        padding: 13px 0 0 !important;
        border-top: 1px solid rgba(21,18,15,.11) !important;
        font-size: 10px !important;
        line-height: 1.65 !important;
    }

    /* ========================================================
       HOMEPAGE: use ONLY dedicated mobile categories.
       ======================================================== */

    body.home .lumiere-stacked-collections {
        display: none !important;
    }

    body.home .heikaya-phone-collections {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 0 6px !important;
        background: #fffdf9 !important;
        overflow: hidden !important;
    }

    body.home .heikaya-phone-collection {
        width: 100% !important;
        margin: 0 !important;
        padding: 22px 0 17px !important;
        border-bottom: 1px solid rgba(21,18,15,.10) !important;
    }

    body.home .heikaya-phone-collection:first-child {
        padding-top: 16px !important;
    }

    body.home .heikaya-phone-collection__header {
        padding: 0 12px 13px !important;
        text-align: center !important;
    }

    body.home .heikaya-phone-collection__header h3 {
        margin: 0 0 6px !important;
        color: #15120f !important;
        font-family: "Cormorant Garamond", Georgia, serif !important;
        font-size: 31px !important;
        font-weight: 500 !important;
        line-height: 1 !important;
        text-transform: uppercase !important;
    }

    body.home .heikaya-phone-collection__header a {
        display: inline-block !important;
        color: #15120f !important;
        font-family: Montserrat, Arial, sans-serif !important;
        font-size: 8px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        letter-spacing: .14em !important;
        text-decoration: none !important;
        text-transform: uppercase !important;
    }

    body.home .heikaya-phone-collection__rail {
        display: flex !important;
        flex-flow: row nowrap !important;
        gap: 9px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 10px 5px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        box-sizing: border-box !important;
    }

    body.home .heikaya-phone-collection__rail::-webkit-scrollbar {
        display: none !important;
    }

    body.home .heikaya-phone-category-card {
        flex: 0 0 calc((100vw - 29px) / 2) !important;
        width: calc((100vw - 29px) / 2) !important;
        max-width: calc((100vw - 29px) / 2) !important;
        min-width: 0 !important;
        margin: 0 !important;
        color: #15120f !important;
        text-decoration: none !important;
        scroll-snap-align: start !important;
    }

    body.home .heikaya-phone-category-card__media {
        display: block !important;
        width: 100% !important;
        aspect-ratio: 1 / 1 !important;
        overflow: hidden !important;
        border: 1px solid rgba(21,18,15,.09) !important;
        border-radius: 10px !important;
        background: #fff !important;
    }

    body.home .heikaya-phone-category-card__media img {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        padding: 4px !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    body.home .heikaya-phone-category-card__title {
        display: -webkit-box !important;
        min-height: 42px !important;
        margin: 0 !important;
        padding: 8px 2px 0 !important;
        overflow: hidden !important;
        color: #15120f !important;
        font-family: "Cormorant Garamond", Georgia, serif !important;
        font-size: 16px !important;
        font-weight: 500 !important;
        line-height: 1.08 !important;
        text-align: center !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;
    }

    body.home .lumiere-all-categories-action {
        margin-top: 12px !important;
    }
}

/* Hidden on tablet/desktop; current desktop category implementation stays intact. */
@media (min-width: 768px) {
    body.home .heikaya-phone-collections {
        display: none !important;
    }
}
