/*
 * LG SMART LIVING — MOBILE PRODUCT HERO ORDER
 * All Learn More product pages:
 * 1) product details / features / enquiry button
 * 2) product image or product slider
 * Desktop layout is intentionally unchanged.
 */
@media (max-width: 768px) {
    /* ---------------------------------------------------------
       Standard product pages
       --------------------------------------------------------- */
    .product-hero .hero-grid,
    .page-hero .hero-grid {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 460px !important;
        gap: 14px !important;
        margin: 0 auto !important;
    }

    .product-hero .hero-grid > .hero-content,
    .page-hero .hero-grid > .hero-content {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 4px 4px 0 !important;
        text-align: center !important;
    }

    .product-hero .hero-grid > .hero-image,
    .page-hero .hero-grid > .hero-image {
        order: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 auto !important;
        padding: 0 !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* ---------------------------------------------------------
       Water purifier pages using product-hero-grid
       --------------------------------------------------------- */
    .product-hero .product-hero-grid {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 460px !important;
        gap: 14px !important;
        margin: 0 auto !important;
    }

    .product-hero .product-hero-grid > .product-hero-content {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 4px 4px 0 !important;
        text-align: center !important;
    }

    .product-hero .product-hero-grid > .product-image,
    .product-hero .product-hero-grid > .product-carousel {
        order: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 auto !important;
        padding: 0 !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* ---------------------------------------------------------
       GC-J257SQNW refrigerator layout
       --------------------------------------------------------- */
    .hero-fridge > .container {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 460px !important;
        gap: 14px !important;
        margin: 0 auto !important;
    }

    .hero-fridge > .container > .hero-info {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 4px 4px 0 !important;
        text-align: center !important;
    }

    .hero-fridge > .container > .hero-image {
        order: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 auto !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* ---------------------------------------------------------
       Massage recliner layout
       --------------------------------------------------------- */
    .massage-hero .massage-hero-inner {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 720px !important;
        gap: 12px !important;
        margin: 0 auto !important;
    }

    .massage-hero .massage-hero-left {
        order: 1 !important;
        width: 100% !important;
        max-width: 720px !important;
        margin: 0 auto !important;
        padding: 18px 22px 8px !important;
        text-align: center !important;
    }

    .massage-hero .massage-hero-right {
        order: 2 !important;
        width: 100% !important;
        max-width: 720px !important;
        min-height: 0 !important;
        height: clamp(255px, 62vw, 430px) !important;
        margin: 0 auto !important;
        padding: 4px 18px 20px !important;
    }

    /* ---------------------------------------------------------
       Shared spacing and media sizing
       --------------------------------------------------------- */
    .product-hero,
    .page-hero,
    .hero-fridge {
        min-height: 0 !important;
        height: auto !important;
        padding-top: 20px !important;
        padding-bottom: 30px !important;
    }

    .product-hero .hero-content h1,
    .product-hero .hero-content h2,
    .product-hero .hero-content h3,
    .product-hero .product-hero-content h1,
    .product-hero .product-hero-content h2,
    .product-hero .product-hero-content h3,
    .page-hero .hero-content h1,
    .page-hero .hero-content h2,
    .page-hero .hero-content h3,
    .hero-fridge .hero-info h1,
    .hero-fridge .hero-info h2,
    .hero-fridge .hero-info h3 {
        max-width: 100% !important;
    }

    .product-hero .hero-content ul,
    .product-hero .product-hero-content ul,
    .page-hero .hero-content ul,
    .hero-fridge .hero-info ul {
        width: fit-content !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: left !important;
    }

    .product-hero .hero-content .btn-primary,
    .product-hero .product-hero-content .btn-primary,
    .page-hero .hero-content .btn-primary,
    .hero-fridge .hero-info .btn-primary {
        margin-top: 15px !important;
    }

    .product-hero .hero-image > img,
    .product-hero .product-image > img,
    .page-hero .hero-image > img,
    .hero-fridge .hero-image > img {
        display: block !important;
        width: auto !important;
        height: auto !important;
        max-width: min(88%, 360px) !important;
        max-height: 340px !important;
        margin: 0 auto !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    .product-hero .hero-image video,
    .page-hero .hero-image video {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-height: 340px !important;
        margin: 0 auto !important;
        object-fit: contain !important;
    }

    .product-hero .heroSwiper,
    .product-hero .productImageSwiper,
    .product-hero .product-carousel .swiper {
        width: 100% !important;
        max-width: 360px !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 auto !important;
        overflow: hidden !important;
    }

    .product-hero .heroSwiper .swiper-wrapper,
    .product-hero .heroSwiper .swiper-slide,
    .product-hero .productImageSwiper .swiper-wrapper,
    .product-hero .productImageSwiper .swiper-slide,
    .product-hero .product-carousel .swiper-wrapper,
    .product-hero .product-carousel .swiper-slide {
        min-height: 0 !important;
        height: auto !important;
    }

    .product-hero .heroSwiper .swiper-slide,
    .product-hero .productImageSwiper .swiper-slide,
    .product-hero .product-carousel .swiper-slide {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
    }

    .product-hero .heroSwiper .swiper-slide img,
    .product-hero .productImageSwiper .swiper-slide img,
    .product-hero .product-carousel .swiper-slide img {
        display: block !important;
        width: auto !important;
        height: auto !important;
        max-width: 86% !important;
        max-height: 330px !important;
        margin: 0 auto !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    .product-hero .heroSwiper .swiper-pagination {
        position: static !important;
        margin-top: 6px !important;
    }
}

@media (max-width: 390px) {
    .product-hero .hero-image > img,
    .product-hero .product-image > img,
    .page-hero .hero-image > img,
    .hero-fridge .hero-image > img,
    .product-hero .heroSwiper .swiper-slide img,
    .product-hero .productImageSwiper .swiper-slide img,
    .product-hero .product-carousel .swiper-slide img {
        max-height: 285px !important;
    }

    .massage-hero .massage-hero-left {
        padding: 14px 18px 6px !important;
    }

    .massage-hero .massage-hero-right {
        height: 245px !important;
        padding: 0 12px 16px !important;
    }
}
