:root {
    --primary-color:      #c9303c;
    --primary-color-dark: #c1121f;
    --primary-color-rgb:  201, 48, 60;
    --secondary-color:    #1d3557;
    --accent-color:       #f1faee;
    --dark-color:         #121212;
    --light-gray:         #f8f9fa;
    --gold:               #d4af37;
    --font-heading:       'Playfair Display', serif;
    --font-body:          'Montserrat', sans-serif;
}

body {
    font-family: var(--font-body);
    background-color: var(--light-gray);
    color: var(--dark-color);
}

h1, h2, h3, .navbar-brand {
    font-family: var(--font-heading);
}

/* Navbar */
.navbar {
    background-color: var(--dark-color);
    padding: 1rem 0;
}

.navbar > .container {
    flex-wrap: wrap;
}

.navbar .navbar-brand {
    order: 3;
    width: 100%;
    text-align: center;
    margin: 0.25rem 0 0;
}

.navbar .btn-link.text-white { order: 1; }
.navbar .ms-auto          { order: 2; }

@media (min-width: 768px) {
    .navbar > .container {
        flex-wrap: nowrap;
    }
    .navbar .navbar-brand {
        order: 0;
        width: auto;
        text-align: left;
        margin: 0;
    }
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 52vh;
    background-image: url('../img/hero-pizza.jpg');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.hero-section .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: 0.35;
}

.hero-section .content {
    position: relative;
    z-index: 1;
}
.hero-section .content.has-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    text-align: left;
}
.hero-logo {
    max-height: 26vh;
    max-width: 40vw;
    flex-shrink: 0;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}
@media (max-width: 767px) {
    .hero-section .content.has-logo {
        flex-direction: column;
        text-align: center;
    }
    .hero-logo { max-height: 18vh; max-width: 60vw; }
}

/* Sidebar */
.sticky-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar for Sidebar */
.sticky-sidebar::-webkit-scrollbar {
    width: 4px;
}

.sticky-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sticky-sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.list-group-item {
    border: none;
    padding: 1rem 1.25rem;
    transition: background-color 0.3s ease, color 0.3s ease, padding-left 0.3s ease;
}

.list-group-item:hover, .list-group-item.active {
    background-color: var(--primary-color);
    color: white;
    padding-left: 1.5rem;
}

/* Category Banner */
.category-banner {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
}

@media (min-width: 768px) {
    .category-banner {
        height: 240px;
    }
}

/* Product Cards */
.category-title {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 2rem;
}

.product-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    animation: fadeIn 0.5s ease forwards;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.product-name {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.product-desc {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.price-select {
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    border: 1px solid #ced4da;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
    transform: scale(1.05);
}

/* Cart Offcanvas */
.cart-item {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.cart-item-name {
    font-weight: 600;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Global Focus Styles – keyboard & screen-reader accessibility */
:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.35);
}

/* Search Styling */
.search-container .input-group {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-container .input-group:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25);
}

.search-container .form-control:focus {
    box-shadow: none; /* outer container handles focus ring via :focus-within */
    outline: none;
}

.search-clear-btn {
    border: none !important;
}

.search-clear-btn:hover {
    background: transparent !important;
    color: var(--primary-color) !important;
}

/* Customization Modal Styles */
.cursor-pointer {
    cursor: pointer;
}

.customization-extras .list-group-item:hover {
    background-color: rgba(var(--primary-color-rgb), 0.07);
    color: var(--dark-color);
    padding-left: inherit;
    border-color: rgba(var(--primary-color-rgb), 0.25) !important;
}

/* Option chips – unselected */
.chip-incr.btn-outline-secondary {
    white-space: nowrap;
    transition: all 0.15s ease;
}
.chip-incr.btn-outline-secondary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Option chip stepper (selected state) */
.chip-stepper {
    display: inline-flex;
    align-items: stretch;
    border-radius: 2rem;
    overflow: hidden;
    border: 2px solid var(--primary-color);
    font-size: 0.875rem;
    line-height: 1;
    white-space: nowrap;
}
.chip-stepper .chip-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.3rem 0.55rem;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.chip-stepper .chip-btn:hover:not(:disabled) {
    background: var(--primary-color-dark);
}
.chip-stepper .chip-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.chip-stepper .chip-label {
    background: var(--primary-color);
    color: #fff;
    padding: 0.3rem 0.55rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}
.group-counter {
    font-size: 0.75rem;
    transition: background-color 0.2s;
}

.italic {
    font-style: italic;
}

/* Back to Top Button */
#btn-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    z-index: 1000;
    width: 45px;
    height: 45px;
    padding: 0;
    line-height: 45px;
    text-align: center;
}

/* Mobile adjustments for Search, Hero and Categories */
@media (max-width: 991.98px) {
    .search-container .input-group {
        border: 1px solid rgba(0, 0, 0, 0.1);
        background: white;
    }

    .mobile-search {
        background: white !important;
        color: var(--dark-color) !important;
    }

    .search-container .input-group-text {
        background: white !important;
        color: #6c757d !important;
    }

    .hero-section {
        height: 50vh;
    }
    
    .sticky-sidebar {
        /* Im normalen Fluss: kein Background/Padding – Pills sitzen direkt unter der Suche */
        position: relative;
        top: 0;          /* Desktop hat top:100px – auf Mobile zurücksetzen */
        max-height: none;
        overflow: visible;
    }

    .sticky-sidebar.cat-fixed {
        /* Fixiert unter der Navbar – kein extra Padding, damit Höhe = natürliche Höhe */
        position: fixed;
        /* top wird per JS gesetzt (echte Navbar-Höhe) */
        left: 0;
        right: 0;
        z-index: 100;
        background: var(--light-gray);
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }
    
    #category-list {
        flex-direction: row !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        display: flex !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 12px; /* Space for scrollbar */
        background: transparent;
    }

    /* Modern visible scrollbar for mobile categories */
    #category-list::-webkit-scrollbar {
        display: block;
        height: 4px;
    }

    #category-list::-webkit-scrollbar-track {
        background: rgba(0,0,0,0.05);
        border-radius: 10px;
    }

    #category-list::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 10px;
    }
    
    #category-list .list-group-item {
        border-radius: 25px !important;
        margin-right: 8px;
        padding: 0.4rem 1.25rem !important;
        border: 1px solid rgba(0,0,0,0.1) !important;
        background: white;
        width: auto !important; /* Allow natural width */
        flex: 0 0 auto !important; /* Don't grow or shrink */
    }
    
    #category-list .list-group-item.active {
        background-color: var(--primary-color) !important;
        color: white !important;
        border-color: var(--primary-color) !important;
    }

    /* mask-image auf Mobile deaktiviert – erzeugt Compositing-Konflikt mit position:fixed
       und macht Pill-Inhalt unsichtbar. Der custom Scrollbar zeigt bereits mehr Inhalt an. */

    /* Scroll-Anker: Navbar-Höhe + Kategorienleiste, per JS als --cat-bar-offset gesetzt */
    .category-section {
        scroll-margin-top: var(--cat-bar-offset, 120px);
    }
}

/* Straßen-Autocomplete */
.street-ac-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 .375rem .375rem;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.street-ac-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: .875rem;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.3;
}
.street-ac-item:last-child { border-bottom: none; }
.street-ac-item:hover,
.street-ac-item.active { background: #f0f4ff; }
.street-ac-item small { color: #6c757d; }

/* ── Allergen-Badges ──────────────────────────────────────────────── */
.allergen-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.allergen-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: .72rem;
    color: #555;
    white-space: nowrap;
    cursor: default;
}
.allergen-badge small {
    font-weight: 700;
    color: #333;
}
.allergen-info-link {
    font-size: .75rem;
    color: #adb5bd;
    text-decoration: none;
}
.allergen-info-link:hover { color: var(--primary-color); }

/* Admin: Allergen-Checkbox-Label */
.allergen-cb-label {
    font-size: .78rem;
    user-select: none;
    background: #f8f9fa;
}
.allergen-cb-label:hover { background: #e9ecef; }

/* ── Shop-Status-Banner ───────────────────────────────────────────────────── */
.status-banner {
    width: 100%;
    padding: 2rem 1rem;
    text-align: center;
    border-bottom: 4px solid rgba(0,0,0,.15);
}
.status-banner .status-banner-icon {
    font-size: 2.8rem;
    display: block;
    margin-bottom: .6rem;
    opacity: .9;
}
.status-banner .status-banner-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: .35rem;
    line-height: 1.2;
}
.status-banner .status-banner-sub {
    font-size: .95rem;
    opacity: .85;
    max-width: 560px;
    margin: 0 auto;
}
.status-banner-danger  { background: #c1121f; color: #fff; }
.status-banner-warning { background: #ff8800; color: #fff; }
.status-banner-closed  { background: #1d3557; color: #fff; }

/* ── Bootstrap-Modal Scrollbalken-Kompensation deaktivieren ──────────────────
   Bootstrap berechnet die Scrollbalken-Breite als
   Math.abs(window.innerWidth - document.documentElement.clientWidth).
   Wenn irgendein Element horizontal überläuft, liefert diese Berechnung
   einen großen Wert und Bootstrap fügt diesen als padding-right zum body
   hinzu – das quetscht den gesamten Seiteninhalt nach links.
   Auf Mobilgeräten gibt es keinen sichtbaren Scrollbalken, daher ist
   die Kompensation immer 0 und kann sicher überschrieben werden. */
body.modal-open {
    padding-right: 0 !important;
}
body.modal-open .navbar.sticky-top {
    padding-right: 0 !important;
}

