:root {
    --g-bg: #080808;
    --g-red: #e30620;
    --g-red-2: #ff2340;
}

body,
.site {
    background: var(--g-bg) !important;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a,
a:visited {
    color: inherit;
    text-decoration: none;
}

*:focus,
*:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.col-full {
    max-width: none !important;
}

/* Storefront Shell */
.site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 0 !important;
    background: #fff !important;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.site-header > .col-full {
    padding: 0 !important;
}

/* Header */
.g-header {
    width: 100%;
    height: 92px;
    padding: 0 48px;
    display: flex;
    align-items: center;
    gap: 30px;
    background: #fff;
}

.g-logo {
    flex: 0 0 auto;
}

.g-logo img {
    max-height: 64px;
    width: auto;
    display: block;
}

.g-nav {
    flex: 1;
}

.g-nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.g-nav-menu a {
    color: #111 !important;
    font-size: 16px;
    font-weight: 900;
}

.g-nav-menu .current-menu-item a {
    background: var(--g-red);
    color: #fff !important;
    padding: 12px 18px;
    border-radius: 999px;
}

/* Header Buttons */
.g-search-toggle,
.g-cart,
.g-account,
.g-menu-toggle {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.g-search-toggle,
.g-menu-toggle {
    background: var(--g-red-2);
    color: #fff;
}

.g-cart {
    position: relative;
    background: #111;
    color: #fff !important;
}

.g-account {
    background: #f7f7f7;
    border: 1px solid #e7e7e7;
    color: #111;
}

.g-search-toggle::before,
.g-cart::before,
.g-account::before,
.g-menu-toggle::before {
    content: "";
    display: block;
    background: currentColor;
}

.g-search-toggle::before {
    width: 19px;
    height: 19px;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.g-cart::before {
    width: 20px;
    height: 20px;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.4'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 4h2l2.3 11.2A2 2 0 0 0 9.3 17h7.9a2 2 0 0 0 1.9-1.4L21 8H6.2'/%3E%3Ccircle cx='9' cy='21' r='1.4'/%3E%3Ccircle cx='18' cy='21' r='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.g-account::before {
    width: 20px;
    height: 20px;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.4'%3E%3Ccircle cx='12' cy='7.5' r='4'/%3E%3Cpath stroke-linecap='round' d='M4.5 21a7.5 7.5 0 0 1 15 0'/%3E%3C/svg%3E") center / contain no-repeat;
}

.g-menu-toggle {
    display: none;
}

.g-menu-toggle::before {
    width: 21px;
    height: 21px;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.7'%3E%3Cpath stroke-linecap='round' d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E") center / contain no-repeat;
}

.g-menu-toggle.is-open::before {
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='3'%3E%3Cpath stroke-linecap='round' d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
}

.g-cart-price {
    display: none;
}

.g-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff8fa0;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Search */
.g-search {
    display: none;
    position: absolute;
    top: 104px;
    right: 170px;
    z-index: 9999;
}

.g-search.is-open {
    display: block;
}

.g-search input {
    width: 300px;
    height: 46px;
    border-radius: 999px !important;
    border: 1px solid #e7e7e7 !important;
    background: #fff !important;
    padding: 0 18px !important;
}

/* Content */
.site-content {
    background:
        radial-gradient(circle at top left, rgba(130,0,0,.18), transparent 36%),
        #080808 !important;
}

.hentry {
    margin: 0 !important;
}

.entry-title {
    color: #fff;
    font-size: clamp(42px, 7vw, 88px);
    font-weight: 900;
    letter-spacing: -.06em;
}

/* Buttons */
button,
.button,
input[type="button"],
input[type="submit"],
.added_to_cart {
    border-radius: 999px !important;
    background: linear-gradient(135deg, var(--g-red-2), var(--g-red)) !important;
    color: #fff !important;
    border: 0 !important;
    font-weight: 900;
}

/* Account */
.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.woocommerce-account .woocommerce-MyAccount-navigation li {
    margin: 0 !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation a {
    min-height: 64px;
    padding: 22px 24px !important;
    border-radius: 22px;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.84) !important;
    display: flex !important;
    align-items: center;
    font-weight: 800;
}

.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation a:hover {
    background: rgba(227,6,32,.18);
    border-color: rgba(227,6,32,.45);
    color: #fff !important;
}

.woocommerce-MyAccount-navigation ul li a::before {
    display: none !important;
}

/* Footer */
.site-footer {
    background: #050505 !important;
    color: rgba(255,255,255,.5);
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 34px 0 !important;
}

.site-info a {
    display: none;
}

/* Mobile */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        padding-bottom: 96px !important;
    }

    .g-header {
        height: auto;
        min-height: 82px;
        padding: 14px 20px;
        gap: 12px;
        justify-content: space-between;
    }

    .g-logo {
        flex: 1;
        min-width: 0;
    }

    .g-logo img {
        max-width: 190px;
        max-height: 58px;
    }

    .g-nav {
        display: none;
    }

    .g-cart,
    .g-account {
        display: none !important;
    }

    .g-search-toggle,
    .g-menu-toggle {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
    }

    .g-menu-toggle {
        display: inline-flex;
    }

    .g-nav.is-open {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 9998;
        background:
            radial-gradient(circle at top left, rgba(227,6,32,.22), transparent 36%),
            #080808;
        padding: 118px 28px 42px;
        overflow-y: auto;
    }

    .g-nav.is-open .g-nav-menu {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 26px;
    }

    .g-nav.is-open .g-nav-menu a {
        color: #fff !important;
        font-size: 36px;
        line-height: 1;
        font-weight: 900;
        letter-spacing: -.06em;
    }

    .g-nav.is-open .current-menu-item a {
        background: transparent;
        padding: 0;
        color: var(--g-red-2) !important;
    }

    .g-search {
        position: fixed;
        top: 96px;
        left: 18px;
        right: 18px;
        z-index: 9999;
    }

    .g-search input {
        width: 100%;
    }

    .storefront-handheld-footer-bar {
        display: flex !important;
        position: fixed;
        bottom: 12px;
        left: 18px;
        right: 18px;
        height: 64px;
        background: rgba(18,18,18,.92);
        backdrop-filter: blur(18px);
        border: 1px solid rgba(255,255,255,.08);
        border-radius: 999px;
        z-index: 99999;
        padding: 0 10px;
        box-shadow:
            0 10px 40px rgba(0,0,0,.45),
            inset 0 1px 0 rgba(255,255,255,.04);
        overflow: visible;
    }

    .storefront-handheld-footer-bar ul {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: space-around;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none;
    }

    .storefront-handheld-footer-bar li {
        flex: 1;
        border: 0 !important;
    }

    .storefront-handheld-footer-bar a {
        width: 52px;
        height: 52px;
        margin: 0 auto;
        border-radius: 999px;
        font-size: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        color: rgba(255,255,255,.72) !important;
        transition: .2s ease;
    }

    .storefront-handheld-footer-bar a::before {
        color: rgba(255,255,255,.78) !important;
        font-size: 22px !important;
        line-height: 1 !important;
    }

    .storefront-handheld-footer-bar .count,
    .storefront-handheld-footer-bar span {
        display: none !important;
    }

    .storefront-handheld-footer-bar li.current a,
    .storefront-handheld-footer-bar li.active a,
    .storefront-handheld-footer-bar li:hover a {
        background: linear-gradient(135deg, var(--g-red-2), var(--g-red));
        color: #fff !important;
        transform: translateY(-2px);
    }

    .storefront-handheld-footer-bar li.current a::before,
    .storefront-handheld-footer-bar li.active a::before,
    .storefront-handheld-footer-bar li:hover a::before {
        color: #fff !important;
    }

    .woocommerce-account .site-main {
        padding: 42px 20px 70px !important;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation,
    .woocommerce-account .woocommerce-MyAccount-content {
        width: 100% !important;
        float: none !important;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation {
        margin-bottom: 34px;
    }

    .woocommerce-account .entry-title {
        font-size: clamp(46px, 14vw, 72px);
        line-height: .9;
        margin-bottom: 30px;
    }
}

@media (max-width: 420px) {
    .g-header {
        padding: 14px;
        gap: 9px;
    }

    .g-logo img {
        max-width: 155px;
    }
}
/* FINAL ICON FIX: Webkit mask support */

.g-search-toggle::before,
.g-cart::before,
.g-account::before,
.g-menu-toggle::before {
    content: "" !important;
    display: block !important;
    background-color: currentColor !important;
    opacity: 1 !important;
}

/* Suche */
.g-search-toggle {
    color: #fff !important;
}

.g-search-toggle::before {
    width: 22px !important;
    height: 22px !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.7'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.7'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Cart */
.g-cart {
    color: #fff !important;
}

.g-cart::before {
    width: 23px !important;
    height: 23px !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.5'%3E%3Cpath d='M3 4h2l2.4 11.2a2 2 0 0 0 2 1.6h7.8a2 2 0 0 0 1.9-1.4L21 8H6.2'/%3E%3Ccircle cx='9' cy='21' r='1.5'/%3E%3Ccircle cx='18' cy='21' r='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.5'%3E%3Cpath d='M3 4h2l2.4 11.2a2 2 0 0 0 2 1.6h7.8a2 2 0 0 0 1.9-1.4L21 8H6.2'/%3E%3Ccircle cx='9' cy='21' r='1.5'/%3E%3Ccircle cx='18' cy='21' r='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Account */
.g-account {
    color: #111 !important;
}

.g-account::before {
    width: 22px !important;
    height: 22px !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.5'%3E%3Ccircle cx='12' cy='7.5' r='4'/%3E%3Cpath d='M4.5 21a7.5 7.5 0 0 1 15 0'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.5'%3E%3Ccircle cx='12' cy='7.5' r='4'/%3E%3Cpath d='M4.5 21a7.5 7.5 0 0 1 15 0'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Menu */
.g-menu-toggle {
    color: #fff !important;
}

.g-menu-toggle::before {
    width: 24px !important;
    height: 24px !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='3'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='3'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E") center / contain no-repeat;
}

<?php

/* Assets */
add_action('wp_enqueue_scripts', function () {
    wp_enqueue_style(
        'gabbiano-base',
        get_stylesheet_directory_uri() . '/assets/css/base.css',
        [],
        time()
    );

    wp_enqueue_style(
        'gabbiano-pizza-menu',
        get_stylesheet_directory_uri() . '/assets/css/pizza-menu.css',
        ['gabbiano-base'],
        time()
    );

    wp_enqueue_script(
        'gabbiano-header',
        get_stylesheet_directory_uri() . '/assets/js/header.js',
        [],
        time(),
        true
    );
});

/* Remove Storefront sidebar */
add_action('get_header', function () {
    remove_action('storefront_sidebar', 'storefront_get_sidebar', 10);
});

/* Body class */
add_filter('body_class', function ($classes) {
    if (is_product_category() || is_shop()) {
        $classes[] = 'gabbiano-menu-page';
    }

    return $classes;
});

/* Product short description in loop */
add_action('woocommerce_after_shop_loop_item_title', function () {
    global $product;

    if (!$product) {
        return;
    }

    $desc = $product->get_short_description();

    if ($desc) {
        echo '<div class="gabbiano-product-desc">' . wp_kses_post($desc) . '</div>';
    }
}, 7);

/* Category hero */
add_action('woocommerce_before_main_content', function () {
    if (!is_product_category()) {
        return;
    }

    $term = get_queried_object();
    $thumbnail_id = get_term_meta($term->term_id, 'thumbnail_id', true);
    $image_url = $thumbnail_id ? wp_get_attachment_image_url($thumbnail_id, 'full') : '';

    if (!$image_url) {
        return;
    }

    echo '<section class="gabbiano-category-hero" style="background-image:url(' . esc_url($image_url) . ')">';
    echo '<div class="gabbiano-category-hero__overlay">';
    echo '<h1>' . esc_html($term->name) . '</h1>';

    if (!empty($term->description)) {
        echo '<p>' . wp_kses_post($term->description) . '</p>';
    }

    echo '</div>';
    echo '</section>';
}, 4);

/* Show all products per category */
add_filter('loop_shop_per_page', function ($cols) {
    if (is_product_category()) {
        return 999;
    }

    return $cols;
}, 20);

/* Remove complete Storefront header */
add_action('init', function () {
    remove_all_actions('storefront_header');
    add_action('storefront_header', 'gabbiano_custom_header', 10);
}, 99);

function gabbiano_custom_header() {
    ?>
    <div class="g-header">

        <a class="g-logo" href="<?php echo esc_url(home_url('/')); ?>">
            <?php the_custom_logo(); ?>
        </a>

        <nav class="g-nav">
            <?php
            wp_nav_menu([
                'theme_location' => 'primary',
                'container' => false,
                'menu_class' => 'g-nav-menu',
            ]);
            ?>
        </nav>

        <button class="g-search-toggle" aria-label="Suche"></button>

        <form class="g-search" method="get" action="<?php echo esc_url(home_url('/')); ?>">
            <input type="search" name="s" placeholder="Produkte suchen …">
            <input type="hidden" name="post_type" value="product">
        </form>

        <a class="g-cart" href="<?php echo esc_url(wc_get_cart_url()); ?>">
            <span class="g-cart-price"><?php echo WC()->cart->get_cart_total(); ?></span>
            <span class="g-cart-count"><?php echo WC()->cart->get_cart_contents_count(); ?></span>
        </a>

        <a class="g-account" href="<?php echo esc_url(get_permalink(get_option('woocommerce_myaccount_page_id'))); ?>"></a>

        <button class="g-menu-toggle" aria-label="Menu"></button>

    </div>
    <?php
}

add_action('storefront_footer', 'storefront_handheld_footer_bar', 999);