/* ==========================================================
   HERITAGE MOTORWORKS
   PRODUCT CATEGORY HERO
   ========================================================== */


/* ----------------------------------------------------------
   Produktkategorie-Seite:
   Hero startet direkt am oberen Fensterrand
   ---------------------------------------------------------- */

.single-product .site-content {
    padding-top: 0 !important;
}


/* ----------------------------------------------------------
   Header transparent über dem Hero
   ---------------------------------------------------------- */

.single-product .site-header {
    background: transparent !important;
    box-shadow: none !important;

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;

    z-index: 9999;
}

.single-product .ast-primary-header-bar,
.single-product .site-primary-header-wrap,
.single-product .ast-builder-grid-row {
    background: transparent !important;
    box-shadow: none !important;
}


/* ==========================================================
   HERO
   ========================================================== */

.hm-product-hero {
    position: relative;

    width: 100%;
    height: 38.5vh;
    min-height: 480px;
    max-height: 600px;

    overflow: visible;

    background: #111;

    z-index: 100;
}


/* ----------------------------------------------------------
   Hintergrundbild
   ---------------------------------------------------------- */

.hm-product-hero__bg {
    position: absolute;
    inset: 0;

    z-index: 1;
}

.hm-product-hero__bg img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center center;
}


/* ----------------------------------------------------------
   Dunkler Cinematic Overlay
   ---------------------------------------------------------- */

.hm-product-hero__overlay {
    position: absolute;
    inset: 0;

    z-index: 2;

    background:
        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.78) 0%,
            rgba(0, 0, 0, 0.55) 38%,
            rgba(0, 0, 0, 0.25) 72%,
            rgba(0, 0, 0, 0.32) 100%
        );
}


/* ==========================================================
   HERO INHALT
   ========================================================== */

.hm-product-hero__inner {
    position: relative;

    z-index: 3;

    width: min(1200px, calc(100% - 80px));
    height: 100%;

    margin: 0 auto;

    display: flex;
    align-items: flex-end;

    padding-bottom: 75px;

    box-sizing: border-box;
}


/* ----------------------------------------------------------
   TEXT
   ---------------------------------------------------------- */

.hm-product-hero__content {
    max-width: 1100px;
}


/* ----------------------------------------------------------
   EYEBROW
   ---------------------------------------------------------- */

.hm-product-hero__subtitle {
    display: block;

    margin-bottom: 16px;

    color: #18A891;

    font-size: 11px;
    font-weight: 600;

    line-height: 1.4;

    letter-spacing: 2.8px;

    text-transform: uppercase;
}


/* ----------------------------------------------------------
   TITEL
   ---------------------------------------------------------- */

.hm-product-hero__content h1 {
    display: block;

    width: 100%;
    max-width: 100%;

    margin: 0;

    color: #fff;

    font-size: clamp(28px, 2.9vw, 40px);
    font-weight: 600;

    line-height: 1;

    letter-spacing: -1.5px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ----------------------------------------------------------
   BESCHREIBUNG
   ---------------------------------------------------------- */

.hm-product-hero__content p {
    max-width: 560px;

    margin: 22px 0 0;

    color: rgba(255, 255, 255, 0.82);

    font-size: 15px;

    line-height: 1.65;
}


/* ==========================================================
   PRODUCT CATEGORY HERO
   KATEGORIEN DROPDOWNS
   ========================================================== */


/* ----------------------------------------------------------
   Beide Dropdowns nebeneinander
   ---------------------------------------------------------- */

.hm-product-hero__buttons {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    margin-top: 15px;
}


/* ----------------------------------------------------------
   Dropdown Container
   ---------------------------------------------------------- */

.hm-product-hero__dropdown {
    position: relative;

    z-index: 1000;
}


/* ----------------------------------------------------------
   Toggle
   ---------------------------------------------------------- */

.hm-product-hero__dropdown-toggle {
    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;

    min-width: 240px;
    min-height: 64px;

    padding: 10px 42px 10px 14px;

    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;

    background: rgba(0,0,0,.22);

    backdrop-filter: blur(8px);

    color: #fff;

    cursor: pointer;

    text-align: left;

    transition:
        border-color .25s ease,
        background .25s ease;
}


.hm-product-hero__dropdown-toggle:hover,
.hm-product-hero__dropdown.is-open
.hm-product-hero__dropdown-toggle {
    border-color: #18A891;

    background: rgba(0,0,0,.34);

    color: #fff;
}


/* ----------------------------------------------------------
   Hauptzeile
   ---------------------------------------------------------- */

.hm-product-hero__dropdown-toggle > span:first-child {
    display: block;

    margin-bottom: 8px;

    color: #fff;

    font-size: 14px;
    font-weight: 700;

    line-height: 1.2;

    letter-spacing: 1px;
}


.hm-product-hero__dropdown-toggle:hover > span:first-child,
.hm-product-hero__dropdown.is-open
.hm-product-hero__dropdown-toggle > span:first-child {
    color: #18A891;
}


/* ----------------------------------------------------------
   Unterzeile
   ---------------------------------------------------------- */

.hm-product-hero__dropdown-toggle small {
    display: block;

    color: rgba(255,255,255,.72);

    font-size: 11px;

    line-height: 1.3;
}


/* ----------------------------------------------------------
   Pfeil
   ---------------------------------------------------------- */

.hm-product-hero__dropdown-arrow {
    position: absolute;

    top: 50%;
    right: 16px;

    color: #18A891;

    font-size: 20px;

    line-height: 1;

    transform: translateY(-50%);

    transition: transform .25s ease;
}


.hm-product-hero__dropdown.is-open
.hm-product-hero__dropdown-arrow {
    transform:
        translateY(-50%)
        rotate(180deg);
}


/* ----------------------------------------------------------
   Dropdown Liste
   ---------------------------------------------------------- */

.hm-product-hero__dropdown-menu {
    position: absolute;

    top: calc(100% + 10px);
    left: 0;

    z-index: 9999;

    width: 260px;

    padding: 8px;

    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px;

    background: rgba(15,15,15,.94);

    backdrop-filter: blur(12px);

    box-shadow:
        0 18px 45px rgba(0,0,0,.35);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-8px);

    transition:
        opacity .2s ease,
        visibility .2s ease,
        transform .2s ease;
}


/* ----------------------------------------------------------
   Geöffnet
   ---------------------------------------------------------- */

.hm-product-hero__dropdown.is-open
.hm-product-hero__dropdown-menu {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}


/* ----------------------------------------------------------
   Kategorie Links
   ---------------------------------------------------------- */

.hm-product-hero__dropdown-menu a {
    display: block;

    padding: 10px 12px;

    border-radius: 8px;

    color: rgba(255,255,255,.82);

    font-size: 12px;
    font-weight: 500;

    line-height: 1.35;

    text-decoration: none;

    transition:
        background .2s ease,
        color .2s ease;
}


.hm-product-hero__dropdown-menu a:hover {
    background: rgba(24,168,145,.12);

    color: #18A891;
}


/* ----------------------------------------------------------
   Aktuelle Baugruppe
   ---------------------------------------------------------- */

.hm-product-hero__dropdown-menu a.is-current {
    color: #18A891;

    background: rgba(24,168,145,.08);

    font-weight: 600;
}


/* ==========================================================
   ZURÜCK ZU DEN PRODUKTEN
   Kompakte Navigation im Hero-Kartenstil
   ========================================================== */

.single-product .hm-product-hero__back {
    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;

    width: 190px;
    min-height: 58px;

    padding: 9px 42px 9px 14px;

    box-sizing: border-box;

    border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px;

    background: rgba(0,0,0,.24);

    backdrop-filter: blur(8px);

    color: #fff;
    text-decoration: none;

    cursor: pointer;

    transition:
        border-color .25s ease,
        background .25s ease,
        transform .25s ease;
}


.single-product .hm-product-hero__back:hover {
    border-color: #18A891;

    background: rgba(0,0,0,.34);

    color: #fff;

    transform: translateY(-1px);
}


/* ----------------------------------------------------------
   Kleine obere Zeile
   ---------------------------------------------------------- */

.single-product .hm-product-hero__back-label {
    display: block;

    margin-bottom: 3px;

    color: #18A891;

    font-size: 8px;
    font-weight: 600;

    line-height: 1.2;

    letter-spacing: 1.8px;

    text-transform: uppercase;
}


/* ----------------------------------------------------------
   Hauptzeile
   ---------------------------------------------------------- */

.single-product .hm-product-hero__back-title {
    display: block;

    color: #fff;

    font-size: 13px;
    font-weight: 700;

    line-height: 1.15;

    letter-spacing: .8px;
}


/* ----------------------------------------------------------
   Pfeil
   ---------------------------------------------------------- */

.single-product .hm-product-hero__back-arrow {
    position: absolute;

    top: 50%;
    right: 14px;

    color: #18A891;

    font-size: 18px;
    font-weight: 400;

    line-height: 1;

    transform: translateY(-50%);

    transition: transform .25s ease;
}


.single-product .hm-product-hero__back:hover
.hm-product-hero__back-arrow {
    transform: translate(3px, -50%);
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 768px) {

    .hm-product-hero__buttons {
        gap: 10px;

        margin-top: 22px;
    }


    .hm-product-hero__dropdown-toggle {
        min-width: 170px;
        min-height: 58px;

        padding: 9px 38px 9px 13px;
    }


    .hm-product-hero__dropdown-toggle > span:first-child {
        margin-bottom: 7px;

        font-size: 13px;
    }


    .hm-product-hero__dropdown-toggle small {
        font-size: 10px;
    }


    .hm-product-hero__dropdown-menu {
        width: 230px;

        top: calc(100% + 8px);
    }


    .hm-product-hero__dropdown-menu a {
        padding: 9px 11px;

        font-size: 11px;
    }

}


/* ----------------------------------------------------------
   MOBILE
   ---------------------------------------------------------- */

@media (max-width: 768px) {

    .hm-product-hero__buttons {
        margin-top: 22px;
    }


    .hm-product-hero__back {
        min-width: 155px;
        min-height: 58px;

        padding: 9px 13px;
    }


    .hm-product-hero__back span {
        font-size: 13px;
    }


    .hm-product-hero__back small {
        font-size: 10px;
    }

}


/* ==========================================================
   MOBILE HERO
   ========================================================== */

@media (max-width: 768px) {

    .single-product .site-header {
        position: absolute;
    }


    .hm-product-hero {
        height: 36vh;

        min-height: 270px;
        max-height: 558px;
    }


    .hm-product-hero__bg img {
        object-position: center center;
    }


    .hm-product-hero__overlay {
        background:
            linear-gradient(
                90deg,
                rgba(0, 0, 0, 0.80) 0%,
                rgba(0, 0, 0, 0.50) 100%
            );
    }


    .hm-product-hero__inner {
        width: calc(100% - 40px);

        padding-bottom: 45px;
    }


    .hm-product-hero__subtitle {
        margin-bottom: 12px;

        font-size: 9px;

        letter-spacing: 2px;
    }


    .hm-product-hero__content h1 {
        font-size: clamp(38px, 10vw, 50px);

        line-height: 1.02;
    }


    .hm-product-hero__content p {
        margin-top: 17px;

        font-size: 13px;

        line-height: 1.6;
    }


    /* ----------------------------------------------
       Zurück-Button Mobile
       ---------------------------------------------- */

    .single-product .hm-product-hero__back {
        width: 160px;
        min-width: 160px;
        min-height: 54px;

        padding: 8px 36px 8px 12px;

        border-radius: 11px;
    }


    .single-product .hm-product-hero__back-label {
        margin-bottom: 3px;

        font-size: 7px;

        letter-spacing: 1.5px;
    }


    .single-product .hm-product-hero__back-title {
        font-size: 12px;
    }


    .single-product .hm-product-hero__back-arrow {
        right: 12px;

        font-size: 17px;
    }

}


/* ==========================================================
   SHOP STARTSEITE
   DROPDOWNS IM SHOP HERO
   ========================================================== */

.hm-shop-hero__buttons {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    margin-top: 30px;
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 768px) {

    .hm-shop-hero__buttons {
        display: flex;

        flex-direction: row;
        align-items: flex-start;

        gap: 10px;

        flex-wrap: nowrap;

        margin-top: 12px;
    }

}


/* ==========================================================
   HERO DROPDOWN – STACKING ORDER
   ========================================================== */


/* Header bleibt immer über dem Hero */

.single-product .site-header {
    position: absolute;

    z-index: 100000 !important;
}


/* Hero liegt über dem nachfolgenden Filter */

.single-product .hm-product-hero {
    position: relative;

    z-index: 99990 !important;

    overflow: visible !important;
}


/* Hero-Inhalt */

.single-product .hm-product-hero__inner {
    position: relative;

    z-index: 99991 !important;
}


/* Dropdown-Bereich */

.single-product .hm-product-hero__buttons {
    position: relative;

    z-index: 99992 !important;
}


.single-product .hm-product-hero__dropdown {
    position: relative;

    z-index: 99993 !important;
}


/* Dropdown selbst ganz oben innerhalb des Hero */

.single-product .hm-product-hero__dropdown-menu {
    position: absolute;

    z-index: 99999 !important;
}


/* ==========================================================
   HERO SPACING — FINAL OVERRIDE
   ========================================================== */


/* DESKTOP
   - Headline -> dropdown: 15px -> 7.5px
   - Content moves 30px closer to the bottom edge:
     padding-bottom 75px -> 45px
*/

@media (min-width: 769px) {

    .single-product .hm-product-hero__inner {
        padding-bottom: 45px !important;
    }

}


/* MOBILE
   - Headline -> dropdown: 22px -> 11px
   - Content moves 15px closer to the bottom edge:
     padding-bottom 45px -> 30px
*/

@media (max-width: 768px) {

    .single-product .hm-product-hero__inner {
        padding-bottom: 30px !important;
    }

}


/* ==========================================================
   PRODUCT HERO — EINZEILIGER PRODUKTTITEL
   ========================================================== */

.single-product .hm-product-hero__content {
    width: 100%;

    max-width: 1100px;
}


.single-product .hm-product-hero__content h1 {
    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


@media (max-width: 768px) {

    .single-product .hm-product-hero__content {
        width: 100%;

        max-width: 100%;
    }


    .single-product .hm-product-hero__content h1 {
        white-space: nowrap;

        overflow: hidden;

        text-overflow: ellipsis;
    }

}


/* ==========================================================
   PRODUCT HERO — HÖHE REDUZIERT
   ========================================================== */

/* Desktop: 10 % weniger Höhe */
@media (min-width: 769px) {
    .single-product .hm-product-hero {
        height: 34.65vh !important; /* 38.5vh × 0.90 */
        min-height: 432px !important; /* 480px × 0.90 */
        max-height: 540px !important; /* 600px × 0.90 */
    }
}

/* Mobile: 30 % weniger Höhe */
@media (max-width: 768px) {
    .single-product .hm-product-hero {
        height: 25.2vh !important; /* 36vh × 0.70 */
        min-height: 189px !important; /* 270px × 0.70 */
        max-height: 391px !important; /* 558px × 0.70 */
    }
}


/* ==========================================================
   MOBILE WARENKORB – ÜBER PRODUCT HERO
   ========================================================== */

/*
 * Der Product Hero besitzt bewusst einen sehr hohen z-index,
 * damit sein Dropdown korrekt über dem Seiteninhalt liegt.
 *
 * Der geöffnete Astra/WooCommerce-Warenkorb muss auf Mobile
 * jedoch darüber liegen. Andernfalls laufen die Warenkorb-
 * elemente hinter dem Hero und sind dort nicht sichtbar.
 */

@media (max-width: 768px) {

    .astra-cart-drawer {
        position: fixed !important;
        z-index: 100001 !important;
    }

    /*
     * Der Header mit dem Schließen-Kreuz muss über dem
     * Warenkorbinhalt liegen. Der vorherige z-index des
     * Content-Bereichs konnte den Header überlagern und
     * dadurch den Klick auf das X blockieren.
     */
    .astra-cart-drawer .astra-cart-drawer-header {
        position: relative !important;
        z-index: 100003 !important;
    }

    .astra-cart-drawer .astra-cart-drawer-close {
        position: absolute !important;
        z-index: 100004 !important;
        pointer-events: auto !important;
        cursor: pointer !important;
    }

    .astra-cart-drawer .astra-cart-drawer-content {
        position: relative !important;
        z-index: 100002 !important;
    }

    .astra-mobile-cart-overlay {
        z-index: 100000 !important;
    }

}


/* ==========================================================
   MOBILE WARENKORB – KOMPAKTE DARSTELLUNG
   ========================================================== */

@media (max-width: 768px) {

    /*
     * Der Warenkorb soll nicht den kompletten verfügbaren
     * freien Bereich zwischen Produkt und Summe auffüllen.
     * Dadurch verschwindet die große weiße Leerfläche.
     */
    .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart {
        flex: 0 1 auto !important;
        overflow-y: auto !important;
        min-height: 0 !important;
        max-height: calc(100vh - 300px) !important;
    }

    /*
     * Mehr Platz rechts für das Entfernen-Symbol, damit lange
     * Produktnamen nicht darunter laufen.
     */
    .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart-item {
        position: relative !important;
        padding-right: 48px !important;
    }

    .astra-cart-drawer .astra-cart-drawer-content
    .woocommerce-mini-cart-item .ast-mini-cart-price-wrap {
        max-width: 100% !important;
    }

    /*
     * Lange Produktnamen sauber umbrechen.
     */
    .astra-cart-drawer .astra-cart-drawer-content
    .woocommerce-mini-cart-item a:not(.remove) {
        overflow-wrap: break-word !important;
        word-break: normal !important;
    }

}
