/* ============================================================
   LIGHTWEIGHT MEGA MENU & MINIMALIST NAV - OPUS3A STYLE
   ============================================================ */

/* Trennstriche zwischen den Menüpunkten (Desktop) */
@media (min-width: 922px) {

    /* Updated Selector for Astra Theme - ROBUST BORDER STRATEGY */
    /* Remove old pseudo-element separators */
    .main-navigation .menu-item:after,
    .ast-primary-menu .menu-item:after {
        content: none !important;
    }

    /* Apply Border-Right as separator */
    /* Apply Border-Right as separator - ONLY TOP LEVEL */
    .main-navigation>ul>li.menu-item:not(:last-child),
    .ast-primary-menu>ul>li.menu-item:not(:last-child) {
        border-right: 1px solid rgba(0, 0, 0, 0.15);
        /* Separator Line */
        padding-right: 20px;
        /* Space between text and line */
        margin-right: 20px;
        /* Space between line and next item */
    }

    /* Remove border from the very last visible item explicitly */
    .main-navigation>ul>li:last-of-type,
    .ast-primary-menu>ul>li:last-of-type {
        border-right: none !important;
        margin-right: 0 !important;
        padding-right: 0 !important;
    }

    /* REMOVE SEPARATORS FROM TOP ICON MENU (Account, Fav, Cart) */
    .menu-item.gk-icon-account,
    .menu-item.gk-icon-fav,
    .menu-item.gk-icon-cart {
        border-right: none !important;
        margin-right: 0 !important;
        padding-right: 0 !important;
    }
}


/* Minimalistischer Text-Stil */
.main-navigation .menu-link {
    text-transform: uppercase !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    font-size: 12px !important;
    color: #333 !important;
}

/* MEGA MENU LOGIK */
@media (min-width: 922px) {

    /* Macht den Menüpunkt zum Mega Menu Container */
    .ast-primary-menu .gk-mega-menu,
    .gk-mega-menu {
        position: static !important;
    }

    /* Das Dropdown-Fenster selbst - VOLLE BREITE HINTERGRUND */
    .ast-primary-menu .gk-mega-menu>.sub-menu,
    .gk-mega-menu>.sub-menu,
    .gk-mega-menu>.gk-menu-custom-content {
        display: grid !important;
        position: absolute !important;
        top: 100% !important;
        left: 50% !important;
        width: 100vw !important;
        /* Ganze Bildschirmbreite */
        max-width: 100vw !important;
        transform: translateX(-50%) translateY(10px);
        margin: 0 !important;
        padding: 40px 0 !important;
        /* Nur oben/unten Padding */
        background: #fff !important;
        border-top: 1px solid #eee !important;
        border-bottom: 2px solid rgba(0, 0, 0, 0.05) !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
        opacity: 0;
        visibility: hidden;
        transition: all 0.25s ease;
        pointer-events: none;
        z-index: 99999;
    }

    .gk-mega-menu:hover>.sub-menu,
    .gk-mega-menu:hover>.gk-menu-custom-content {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateX(-50%) translateY(0);
        pointer-events: auto;
    }

    /* INHALTS-CONTAINER (Exakt am Raster ausgerichtet) */
    .gk-mega-wrapper {
        display: grid !important;
        grid-template-columns: repeat(4, 160px) 1fr !important;
        grid-template-rows: auto auto !important;
        gap: 20px;
        width: 100% !important;
        max-width: 800px !important;
        /* Gleiche Breite wie dein Header/Content */
        margin: 0 auto !important;
        /* Zentriert den Inhalt auf dem weißen Band */
        padding: 0 !important;
        /* KEIN PADDING, damit es exakt bündig anfängt! */
        text-align: left !important;
    }

    /* 3-Column Compact Layout (e.g. for Holzposter) */
    .gk-mega-wrapper.gk-layout-3col {
        grid-template-columns: 220px minmax(300px, 1fr) 300px !important;
        gap: 30px;
    }

    .gk-mega-wrapper.gk-layout-3col .gk-mega-featured-grid {
        grid-column: 3 / 4 !important;
        border-left: 1px solid #eee;
        padding-left: 30px !important;
        max-width: none !important;
        /* Allow it to fill the 300px */
    }

    .gk-mega-title {
        font-family: inherit !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        color: #000 !important;
        margin-bottom: 8px !important;
        padding-bottom: 0px;
        text-transform: none;
        border: none !important;
        line-height: 1.2 !important;
    }

    /* Visuelle Kategorien (Meksa Style) */
    .gk-mega-visual-cats {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .gk-mega-cat-img {
        position: relative;
        display: block;
        width: 100%;
        height: 40px;
        /* Noch etwas dünner (vorher 45px) */
        overflow: hidden;
        border-radius: 4px;
        border: 1px solid #eee;
        transition: transform 0.3s ease;
        background: #000;
        /* Hintergrund für Overlay-Effekt */
    }

    .gk-mega-cat-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0.7;
        /* Dunkler gemacht für bessere Lesbarkeit des Texts */
        transition: transform 0.5s ease, opacity 0.5s ease;
    }

    .gk-mega-cat-img span {
        position: absolute;
        top: 50%;
        left: 15px;
        transform: translateY(-50%);
        width: auto;
        text-align: left;
        color: #fff;
        font-size: 13px;
        /* Größerer Text (vorher 11px) */
        font-weight: 900;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        z-index: 2;
    }

    .gk-mega-cat-img:hover img {
        transform: scale(1.1);
        opacity: 0.8;
    }

    .gk-mega-cat-img:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    /* Trennlinien zwischen Gruppen innerhalb einer Spalte */
    .gk-mega-sep {
        border-top: 1px solid #f0f0f0;
        margin: 10px 0 !important;
        width: 80%;
    }

    .gk-mega-list {
        list-style: none !important;
        margin: 0 0 12px 0 !important;
        padding: 0 !important;
    }

    .gk-mega-list li {
        margin-bottom: 4px !important;
        line-height: 1.1 !important;
    }

    .gk-mega-list a {
        color: #666 !important;
        font-size: 12px !important;
        font-weight: 500 !important;
        text-decoration: none !important;
        transition: all 0.2s ease;
        display: inline-block;
    }

    .gk-mega-list a:hover {
        color: #000 !important;
        transform: translateX(3px);
    }

    /* Rechte Spalte mit Produkten (2x2 Grid) */
    .gk-mega-featured-grid {
        grid-column: 5 / 6;
        grid-row: 1 / 3;
        /* SPANNT ÜBER BEIDE REIHEN - Zieht Banner hoch! */
        border-left: 1px solid #f0f0f0;
        padding-left: 20px !important;
        max-width: 260px !important;
        /* Etwas breiter für größere Bilder */
        min-width: 240px !important;
    }

    /* Slick/Flickity Carousel in der Mega Menu Spalte deaktivieren */
    .gk-mega-featured-grid .gk-psr-container,
    .gk-mega-featured-grid .gk-psr-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        width: 100% !important;
        transform: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Verhindert Flickity-Dinge */
    .gk-mega-featured-grid .flickity-viewport,
    .gk-mega-featured-grid .flickity-enabled {
        height: auto !important;
        overflow: visible !important;
    }

    .gk-mega-featured-grid .gk-psr-item.product,
    .gk-mega-featured-grid .gk-pif-item.product {
        position: relative !important;
        left: 0 !important;
        width: 100% !important;
        margin: 0 0 10px 0 !important;
        /* Abstand nach unten */
        border: none !important;
        padding: 0 !important;
        background: transparent !important;
        text-align: center;
    }

    .gk-mega-featured-grid .woocommerce-loop-product__title,
    .gk-mega-featured-grid h2.woocommerce-loop-product__title {
        font-size: 11px !important;
        /* Winziger Titel */
        color: #777 !important;
        margin: 5px 0 0 0 !important;
        line-height: 1.1 !important;
        height: auto !important;
        min-height: 0 !important;
        font-weight: 500 !important;
        text-transform: none !important;
    }

    /* RADIKALES AUSBLENDEN */
    .gk-mega-featured-grid .price,
    .gk-mega-featured-grid .button,
    .gk-mega-featured-grid .star-rating,
    .gk-mega-featured-grid .added_to_cart,
    .gk-mega-featured-grid .flickity-page-dots,
    .gk-mega-featured-grid .flickity-prev-next-button {
        display: none !important;
    }

    .gk-mega-featured-grid img {
        width: 100px !important;
        /* Feste kleine Größe */
        height: 100px !important;
        object-fit: cover !important;
        border-radius: 3px !important;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06) !important;
        margin: 0 auto !important;
        display: block !important;
    }

    /* Bottom Banner Area */
    .gk-mega-bottom-banner {
        grid-column: 1 / 5;
        grid-row: 2 / 3;
        /* Direkt unter dem Text */
        margin-top: 5px;
        /* Ganz nah dran */
        position: relative;
        overflow: hidden;
        border-radius: 6px;
        height: 85px;
        /* Etwas flacher */
        background: #000;
    }

    .gk-mega-bottom-banner img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0.7;
        transition: transform 0.5s ease;
    }

    .gk-banner-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
        display: flex;
        align-items: center;
        padding-left: 25px;
        color: #fff;
        font-weight: 800;
        font-size: 14px;
        letter-spacing: 1px;
        text-transform: uppercase;
    }
}

/* 
     * NEW: Dynamic Attribute Grid
     * Handles the [gk_product_attribute_list] styling
     * Simple Grid Layout - No internal hover hiding/revealing
     */
.gk-attr-grid-container {
    display: block;
    width: 100%;
    /* Container Constraint */
    max-width: 700px;
    margin: 0 auto;
    /* Center it like the other mega content */
}

/* The Grid - 4 Columns for better text handling */
.gk-attr-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px 20px;
    list-style: none !important;
    padding: 0 !important;
    margin: 10px 0 0 0 !important;
    max-width: 650px;
}

/* Button/Pill Sytle Items */
.gk-attr-grid li {
    margin: 0 !important;
}

.gk-attr-grid a {
    display: block;
    text-align: center;
    padding: 6px 4px;
    background: #fcfcfc;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #444 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    line-height: 1.2;
    height: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gk-attr-grid a:hover {
    background: #000;
    color: #fff !important;
    border-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}


/* ============================================================
   CUSTOM MENU ICONS (MANUAL CLASSES)
   Usage: Add these classes to Menu Items in WordPress Admin
   ============================================================ */

/* Use High Specificity Selectors to override Theme Defaults */
/* Target .menu-link specifically for Astra theme compatibility */
.gk-icon-home .menu-link,
.gk-icon-account .menu-link,
.gk-icon-fav .menu-link,
.gk-icon-cart .menu-link,
.gk-icon-home>a,
.gk-icon-account>a,
.gk-icon-fav>a,
.gk-icon-cart>a {
    display: flex !important;
    flex-direction: column !important;
    /* Force stacking - Icon on top */
    align-items: center !important;
    justify-content: flex-start !important;
    /* Align to top so icons stay on one line */
    line-height: normal !important;
    padding-top: 15px !important;
    /* Fixed top spacing */
    padding-bottom: 5px !important;
    min-height: 85px !important;
    /* Ensure enough space for 3 lines (Icon + Text + Price) */
    text-align: center !important;
    position: relative !important;
}

.gk-icon-home a::before,
.gk-icon-account a::before,
.gk-icon-fav a::before,
.gk-icon-cart a::before {
    content: '';
    display: block !important;
    width: 28px;
    /* Slightly larger */
    height: 28px;
    margin: 0 auto 4px auto !important;
    /* Centered and spacing below */
    background-color: #333;
    /* Default Dark Color */
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transition: background-color 0.3s ease;
}

/* HOVER & ACTIVE STATES (Orange) */
/* Target specific parent combinations to ensure it works */
.menu-item.gk-icon-home:hover>a::before,
.menu-item.gk-icon-account:hover>a::before,
.menu-item.gk-icon-fav:hover>a::before,
.menu-item.gk-icon-cart:hover>a::before,
.gk-icon-home a:hover::before,
.gk-icon-account a:hover::before,
.gk-icon-fav a:hover::before,
.gk-icon-cart a:hover::before,
.gk-icon-home.current-menu-item>a::before,
.gk-icon-account.current-menu-item>a::before,
.gk-icon-fav.current-menu-item>a::before,
.gk-icon-cart.current-menu-item>a::before,
.gk-icon-home.current_page_item>a::before,
.gk-icon-account.current_page_item>a::before,
.gk-icon-fav.current_page_item>a::before,
.gk-icon-cart.current_page_item>a::before {
    background-color: #ff6600 !important;
    /* Matches Cart Orange */
}

/* Also color the text on hover/active */
.menu-item.gk-icon-home:hover>a,
.menu-item.gk-icon-account:hover>a,
.menu-item.gk-icon-fav:hover>a,
.menu-item.gk-icon-cart:hover>a,
.gk-icon-home a:hover,
.gk-icon-account a:hover,
.gk-icon-fav a:hover,
.gk-icon-cart a:hover,
.gk-icon-home.current-menu-item>a,
.gk-icon-account.current-menu-item>a,
.gk-icon-fav.current-menu-item>a,
.gk-icon-cart.current-menu-item>a {
    color: #ff6600 !important;
}

/* WOOCOMMERCE CART EXTRAS */
.gk-cart-count {
    position: absolute;
    top: 5px;
    left: 50%;
    margin-left: 8px;
    /* Position next to center-aligned icon */
    background: #ff6600;
    color: #fff !important;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    padding: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.gk-cart-total {
    display: block;
    font-size: 11px;
    font-weight: 800;
    margin-top: 3px;
    opacity: 0.9;
}

.gk-cart-count:empty,
.gk-cart-count[data-count="0"],
.gk-cart-count:contains("0") {
    display: none;
}


/* Home Icon (House Outline) - Managed via gk-icon-controller.php */
.gk-icon-home a::before {}

/* Account Icon (User Outline) - Managed via gk-icon-controller.php */
.gk-icon-account a::before {}

/* Favorites Icon (Heart Outline) - Managed via gk-icon-controller.php */
.gk-icon-fav a::before {}

/* Cart Icon (Shopping Bag Outline) - Managed via gk-icon-controller.php */
.gk-icon-cart a::before {}