/* XiaomiGlobal Unified Suite 2.0 — one final visual layer. */

/* Click-open mega menus; replaces the former Clean Slate plugin. */
.menu-item-has-children:hover > .mega-menu,
.hsp-dept-menu-wrap:hover .hsp-dept-mega,
.hsp-has-mega:hover .hsp-mega-panel {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.menu-item-has-children.open > .mega-menu,
.menu-item-has-children.open > .sub-menu,
.hsp-mega-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Restrained typography for internal content pages. */
body.page:not(.home):not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) :is(
    .hsp-page-header h1,
    .hsp-page-article .entry-title,
    .hsp-contact-hero-copy h1,
    .hsp-contact-premium-copy h1,
    .hsp-static-hero h1,
    .hsp-form-hero h1,
    .hsp-tech-news-copy h1,
    .entry-content > h1
) {
    font-size: clamp(29px, 2.7vw, 42px) !important;
    line-height: 1.4 !important;
    letter-spacing: -0.02em !important;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

body.page:not(.home):not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) :is(
    .entry-content h2,
    .hsp-page-article h2,
    .hsp-contact-form-card h2,
    .hsp-contact-social-card h2,
    .hsp-contact-address-panel h2,
    .hsp-contact-form-intro h2
) {
    font-size: clamp(23px, 2vw, 31px) !important;
    line-height: 1.55 !important;
    text-wrap: balance;
}

body.page:not(.home):not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) :is(
    .entry-content h3,
    .hsp-page-article h3,
    .hsp-contact-info-grid h3,
    .hsp-contact-faq-grid h3
) {
    font-size: clamp(18px, 1.5vw, 22px) !important;
    line-height: 1.6 !important;
}

body.page:not(.home):not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) :is(
    .entry-content p,
    .entry-content li,
    .hsp-page-article p,
    .hsp-page-article li,
    .hsp-contact-premium-copy p,
    .hsp-contact-hero-copy p,
    .hsp-static-hero p
) {
    font-size: clamp(14px, 1vw, 16px) !important;
    line-height: 2 !important;
}

body.page:not(.home) .entry-content :is(img, figure img) {
    max-width: 100%;
    height: auto;
    border-radius: 18px;
}

/* Homepage — smaller headings and robust card geometry. */
body.home {
    overflow-x: clip !important;
}

body.home .hsp-page-builder-output,
body.home .hsp-builder-section,
body.home .hsp-container {
    min-width: 0;
}

body.home .hsp-fresh-hero-copy :is(h1, strong) {
    max-width: 620px !important;
    margin: 0 !important;
    font-size: clamp(27px, 2.7vw, 39px) !important;
    line-height: 1.32 !important;
    letter-spacing: -0.02em !important;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

body.home .hsp-section-headline h2,
body.home .hsp-erna-product-head h2 {
    max-width: 760px;
    margin: 0 !important;
    font-size: clamp(25px, 2.1vw, 31px) !important;
    line-height: 1.42 !important;
    letter-spacing: -0.015em !important;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

@media (min-width: 768px) {
    body.home .hsp-feature-card {
        display: grid !important;
        grid-template-columns: minmax(145px, .9fr) minmax(0, 1.15fr) !important;
        align-items: stretch !important;
        min-height: 220px !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    body.home .hsp-feature-card > .hsp-feature-copy,
    body.home .hsp-feature-card > .hsp-banner-copy {
        position: relative !important;
        inset: auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 24px 18px !important;
        align-self: center !important;
        transform: none !important;
    }

    body.home .hsp-feature-card > .hsp-feature-media,
    body.home .hsp-feature-card > .hsp-banner-media {
        position: relative !important;
        inset: auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 100% !important;
        transform: none !important;
    }

    body.home .hsp-feature-card-image {
        position: absolute !important;
        inset: 8px !important;
        width: calc(100% - 16px) !important;
        height: calc(100% - 16px) !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: contain !important;
        object-position: center !important;
    }
}

body.home .hsp-feature-copy > span {
    font-size: 10px !important;
    line-height: 1.5 !important;
}

body.home .hsp-feature-copy strong {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 5px 0 !important;
    font-size: 16px !important;
    line-height: 1.65 !important;
    overflow-wrap: anywhere !important;
    text-wrap: balance;
}

body.home .hsp-feature-copy small {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    font-size: 11px !important;
    line-height: 1.8 !important;
    overflow-wrap: anywhere !important;
}

/* Keep every product, including products that currently use WooCommerce's placeholder. */
body.home .hsp-builder-section li.product,
body.home .hsp-builder-section li.product:not(.has-post-thumbnail) {
    display: block !important;
}

body.home .hsp-builder-section .hsp-loop-thumb-wrap,
body.home .hsp-builder-section .hsp-loop-thumb-link {
    overflow: hidden !important;
    background: #fff !important;
}

body.home .hsp-builder-section .hsp-loop-product-slide {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
    transform: scale(1.13) !important;
    transform-origin: center !important;
}

body.home .hsp-builder-section .hsp-loop-product-slide.is-active {
    opacity: 1 !important;
    visibility: visible !important;
}

body.home .hsp-loop-card-body .woocommerce-loop-product__title {
    min-height: 3.2em !important;
    margin: 0 0 9px !important;
    font-size: 13px !important;
    line-height: 1.65 !important;
    overflow-wrap: anywhere;
}

body.home :is(.hsp-dark-banner, .hsp-soft-banner, .hsp-tech-mosaic, .hsp-milana-expand-link) strong {
    font-size: clamp(21px, 2.2vw, 32px) !important;
    line-height: 1.5 !important;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

@media (max-width: 767px) {
    body.home .hsp-container {
        width: 100% !important;
        max-width: 100% !important;
        padding-inline: 12px !important;
    }

    body.home .hsp-fresh-hero-copy :is(h1, strong) {
        max-width: 100% !important;
        font-size: 20px !important;
        line-height: 1.5 !important;
        letter-spacing: 0 !important;
    }

    body.home .hsp-fresh-hero-copy :is(span, small) {
        font-size: 10px !important;
        line-height: 1.7 !important;
        white-space: normal !important;
    }

    body.home .hsp-feature-copy strong {
        font-size: 15px !important;
        line-height: 1.65 !important;
    }

    body.home .hsp-feature-copy small {
        font-size: 10.5px !important;
    }

    body.home .hsp-section-headline h2,
    body.home .hsp-erna-product-head h2 {
        font-size: 23px !important;
        line-height: 1.5 !important;
    }

    body.home .hsp-section-headline p {
        font-size: 11px !important;
        line-height: 1.8 !important;
    }

    body.home .hsp-discovery-pills {
        display: flex !important;
        gap: 8px !important;
        overflow-x: auto !important;
        padding-bottom: 6px;
    }

    body.home .hsp-discovery-pills a {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 11px !important;
    }

    body.home .hsp-builder-section .hsp-loop-product-slide {
        transform: scale(1.09) !important;
    }

    body.home :is(.hsp-dark-banner, .hsp-soft-banner, .hsp-tech-mosaic, .hsp-milana-expand-link) strong {
        font-size: 22px !important;
    }

    body.page:not(.home):not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) :is(
        .hsp-page-header h1,
        .hsp-page-article .entry-title,
        .hsp-contact-hero-copy h1,
        .hsp-contact-premium-copy h1,
        .hsp-static-hero h1,
        .hsp-form-hero h1,
        .entry-content > h1
    ) {
        font-size: 27px !important;
        line-height: 1.5 !important;
    }
}

