/**
 * Homepage hero refinements (index.html only).
 * Scoped to .index-hero-premium — no media queries, no layout heights.
 */

.index-hero-premium .hero-badge {
    margin-bottom: clamp(1rem, 2.2vw, 1.35rem);
}

.index-hero-premium.hero h1 {
    max-width: 32rem;
    line-height: 1.18;
    margin-bottom: clamp(1rem, 2.5vw, 1.45rem);
}

.index-hero-premium .service-circles {
    margin-bottom: clamp(1.2rem, 2.8vw, 1.65rem);
}

.index-hero-premium.hero p {
    max-width: 34rem;
    line-height: 1.68;
    margin-top: 0;
    margin-bottom: 0;
}

/* Softer, premium hover on hero action circles — colors unchanged */
.index-hero-premium .service-circle {
    transition:
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.4s ease;
}

.index-hero-premium .service-circle::after {
    transition:
        bottom 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.35s ease;
}

.index-hero-premium .service-circle:hover {
    transform: translateY(-5px) scale(1.04);
}

.index-hero-premium .service-circle.service-circle--emergency {
    transition:
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.4s ease,
        filter 0.4s ease;
}

.index-hero-premium .service-circle.service-circle--emergency:hover {
    filter: brightness(1.04);
}

/* ===== Homepage hero — mobile refinement only (≤768px) ===== */
@media (max-width: 768px) {
    .index-hero-premium.heitec-hero {
        max-width: 100%;
        overflow-x: clip;
    }

    .index-hero-premium .heitec-hero-content,
    .index-hero-premium .hero-content {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding-inline: clamp(0.35rem, 2.5vw, 0.85rem);
        overflow: visible;
    }

    .index-hero-premium .hero-badge {
        display: inline-block;
        max-width: calc(100% - 0.5rem);
        margin-bottom: 0.75rem;
        padding: 5px 12px;
        font-size: 0.72rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .index-hero-premium.hero h1 {
        font-size: clamp(1.5rem, 6.2vw, 2rem);
        line-height: 1.24;
        letter-spacing: -0.02em;
        max-width: min(100%, 19.5rem);
        margin-bottom: 0.75rem;
        padding-inline: 0.15rem;
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
    }

    .index-hero-premium .heitec-hero-content .service-circles {
        display: grid !important;
        grid-template-columns: repeat(2, 5.15rem);
        justify-content: center;
        justify-items: center;
        align-items: center;
        gap: 0.6rem 0.7rem;
        width: fit-content;
        max-width: calc(100% - 0.25rem);
        margin: 0.65rem auto 0.85rem;
        padding: 0;
    }

    .index-hero-premium .heitec-hero-content .service-circle {
        width: 5.15rem;
        height: 5.15rem;
        min-width: 5.15rem;
        min-height: 5.15rem;
        max-width: 5.15rem;
        max-height: 5.15rem;
        margin: 0;
    }

    .index-hero-premium .heitec-hero-content .service-circle i {
        font-size: 1.28rem;
    }

    .index-hero-premium .heitec-hero-content .service-circle span {
        font-size: 0.62rem;
        line-height: 1.15;
        padding: 0 4px;
        overflow-wrap: anywhere;
        text-align: center;
    }

    .index-hero-premium.hero p {
        font-size: clamp(0.88rem, 3.6vw, 0.96rem);
        line-height: 1.62;
        max-width: min(100%, 21.5rem);
        margin-top: 0.35rem;
        padding-inline: 0.2rem;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    /* Hero stats (if present) — no overflow, balanced spacing */
    .index-hero-premium .hero-stats {
        width: 100%;
        max-width: 100%;
        margin-top: 1rem;
        padding-inline: 0.25rem;
        gap: clamp(0.85rem, 4vw, 1.5rem);
        justify-content: center;
        flex-wrap: wrap;
        box-sizing: border-box;
    }

    .index-hero-premium .hero-stats .stat {
        flex: 1 1 5.5rem;
        min-width: 0;
        max-width: 8.5rem;
        text-align: center;
    }

    .index-hero-premium .hero-stats .number {
        font-size: clamp(1.35rem, 5vw, 1.65rem);
        line-height: 1.2;
    }

    .index-hero-premium .hero-stats .label {
        font-size: 0.72rem;
        line-height: 1.35;
        overflow-wrap: break-word;
    }

    .index-hero-premium .service-circle:hover {
        transform: translateY(-3px) scale(1.02);
    }
}

/* Very small phones — tighter hero, same 2×2 grid */
@media (max-width: 400px) {
    .index-hero-premium .heitec-hero-content .service-circles {
        grid-template-columns: repeat(2, 4.65rem);
        gap: 0.5rem 0.55rem;
    }

    .index-hero-premium .heitec-hero-content .service-circle {
        width: 4.65rem;
        height: 4.65rem;
        min-width: 4.65rem;
        min-height: 4.65rem;
        max-width: 4.65rem;
        max-height: 4.65rem;
    }

    .index-hero-premium .heitec-hero-content .service-circle i {
        font-size: 1.15rem;
    }

    .index-hero-premium .heitec-hero-content .service-circle span {
        font-size: 0.58rem;
    }

    .index-hero-premium.hero h1 {
        font-size: clamp(1.38rem, 5.8vw, 1.72rem);
        max-width: 100%;
    }
}

/* ===== Homepage mobile navbar refinement (≤768px, index only) ===== */
@keyframes index-home-nav-menu-in {
    from {
        opacity: 0;
        transform: translate3d(0, -6px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@media (max-width: 768px) {
    body.page-home #navbar.navbar {
        padding:
            max(10px, env(safe-area-inset-top, 0px))
            max(12px, env(safe-area-inset-right, 0px))
            10px
            max(12px, env(safe-area-inset-left, 0px));
        max-width: 100%;
        overflow-x: clip;
    }

    body.page-home #navbar .nav-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow-x: clip;
        gap: 10px 12px;
    }

    /* Closed: logo visually centered in bar, hamburger compact on the right */
    body.page-home #navbar:not(.navbar--menu-open) .nav-container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        flex-wrap: nowrap;
    }

    body.page-home #navbar:not(.navbar--menu-open) .logo {
        order: 1;
        justify-self: center;
        margin: 0;
        max-width: 100%;
        min-width: 0;
        gap: 10px;
    }

    /* Logo sizing unified in brand-ar.css — keep layout hooks only */
    body.page-home #navbar .logo-text {
        min-width: 0;
    }

    /* Premium compact hamburger */
    body.page-home #navbar .menu-btn {
        order: 2;
        width: 46px;
        height: 46px;
        min-width: 46px;
        min-height: 46px;
        margin: 0;
        padding: 0;
        border-radius: 12px;
        font-size: 1.05rem;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(0, 232, 200, 0.24);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
        transition:
            transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
            background 0.38s ease,
            border-color 0.38s ease,
            box-shadow 0.38s ease;
    }

    body.page-home #navbar .menu-btn:hover {
        transform: translateY(-1px);
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(0, 232, 200, 0.38);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    }

    body.page-home #navbar .menu-btn:active {
        transform: scale(0.96);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
    }

    /* Open menu: smooth panel, richer blur, no horizontal overflow */
    body.page-home #navbar.navbar--menu-open .nav-container {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
    }

    body.page-home #navbar.navbar--menu-open .logo {
        justify-content: flex-start;
        justify-self: start;
        max-width: calc(100% - 58px);
    }

    body.page-home #navbar.navbar--menu-open .nav-links {
        animation: index-home-nav-menu-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        margin-top: 10px;
        padding: 10px 0 14px;
        max-height: min(70dvh, 520px);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        backdrop-filter: blur(26px) saturate(1.12);
        -webkit-backdrop-filter: blur(26px) saturate(1.12);
        transform: translateZ(0);
        will-change: opacity, transform;
        box-shadow: 0 22px 52px rgba(0, 0, 0, 0.34);
    }

    body.page-home #navbar .nav-links > a,
    body.page-home #navbar .nav-dropdown__trigger {
        overflow-wrap: anywhere;
    }
}

@media (max-width: 400px) {
    body.page-home #navbar .logo-img {
        height: 48px;
        max-height: 48px;
    }

    body.page-home #navbar .menu-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 1rem;
    }

    body.page-home #navbar.navbar--menu-open .logo {
        max-width: calc(100% - 54px);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.page-home #navbar.navbar--menu-open .nav-links {
        animation: none;
    }

    body.page-home #navbar .menu-btn {
        transition: background 0.2s ease, border-color 0.2s ease;
    }
}
