:root { --r-red:#bd0000; --r-blue:#003366; --r-dark:#1a1a1a; --r-border:#444; }
body, .bike-rental-app { font-family: 'Open Sans', sans-serif !important; }

.cart_item.category-versicherung td.product-quantity, 
.cart_item.category-zusatzprodukte td.product-quantity { display: table-cell !important; }

.bike-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; margin-top: 30px; }
.bike-card { background: #fcfcfc; border-radius: 20px; padding: 25px; border: 1.5px solid var(--r-border); position: relative; display: flex; flex-direction: column; min-height: 700px; transition: all 0.3s ease; }
.bike-card:hover:not(.is-out) { transform: translateY(-10px); border-color: var(--r-red); box-shadow: 0 25px 50px rgba(0,0,0,0.15); }

.badge-status { position: absolute; top: 0; left: 0; padding: 8px 15px; font-weight: 800; z-index: 10; font-size: 12px; border-top-left-radius: 20px; border-bottom-right-radius: 12px; background: var(--r-blue); color: #fff; }
.shop-logo-container { position: absolute; top: 15px; right: 15px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; z-index: 10; }
.shop-logo-container img { width: 90px; height: auto; }

.img-container {
    height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* WICHTIG: Verhindert, dass das Bild aus dem Container bricht */
    background: #fff;
}
.img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Bild wird perfekt eingepasst, ohne Verzerrung */
}
.img-container:hover img { transform: scale(1.1); }

.specs-btn { width: 100%; background: #f1f1f1; border: 1px solid #ddd; padding: 12px 15px; border-radius: 10px; font-weight: 800; cursor: pointer; font-size: 11px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.specs-content { display: none; padding: 15px; background: #fff; border: 1px solid #ddd; border-top: none; border-radius: 0 0 10px 10px; margin-bottom: 15px; font-size: 13px; border-left: 4px solid var(--r-red); }
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 15px; }
.tech-box { background: #eee; padding: 8px; border-radius: 8px; border: 1px solid #ccc; font-size: 10px; font-weight: 800; }
.tech-box span { display: block; color: var(--r-blue); font-size: 12px; }

.pill { padding:14px 5px; border:1px solid var(--r-border); border-radius:10px; text-align:center; cursor:pointer; font-weight:800; background:#fff; flex:1; }
.pill.active-frame { background: var(--r-dark) !important; color: #fff !important; }


/* Debug-Modus: Alle Overlays werden halbdurchsichtig rot markiert */
.modal-overlay {
    background: rgba(88, 84, 84, 0.3) !important;
    outline: 2px solid red !important;
}

.calc-trigger { font-size: 11px; text-decoration: underline; cursor: pointer; color: var(--r-red); font-weight: 800; margin-left: auto; }
/* .calc-modal { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.85); z-index:20000; align-items:center; justify-content:center; } */


/* Modal Grundstil */
.calc-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 999999;
    justify-content: center;
    align-items: center;
}

.calc-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Schließen-Button */
.close-calc {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 20px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
}

.close-calc:hover {
    color: #666;
}


.calc-box { background:#fff; padding:40px; border-radius:30px; width:95%; max-width:500px; text-align:center; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.calc-box h2 { font-size: 28px; font-weight: 800; margin-bottom: 10px; color: var(--r-blue); }


#sticky_bar { position:fixed; bottom:25px; 
    left:50%; transform:translateX(-50%) translateY(250px); 
    width:95%; max-width:1300px; background:#fff; border-top:6px solid var(--r-red); 
    padding:15px 35px; display:flex; align-items:center; 
    justify-content:space-between; border-radius:25px; 
    box-shadow:0 20px 60px rgba(0,0,0,0.3);  z-index: 999999 !important; 
    transition: transform 0.4s ease-in-out; }

/* Wenn die Bar aktiv ist */
#sticky_bar.is-visible {
    transform: translateX(-50%) translateY(0);
}



.modal-overlay { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.85); z-index:10000; align-items:center; justify-content:center; }
.extras-modal { background:#fff; width:95%; max-width:800px; padding:35px; border-radius:30px; max-height:85vh; overflow-y:auto; }
.extra-item { display:flex; align-items:center; gap:20px; padding:15px; border:2px solid #eee; border-radius:15px; margin-bottom:12px; cursor:pointer; }
.extra-item.selected { border-color: var(--r-red); background: #fff5f5; }

.lb-modal { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.9); z-index:100000; align-items:center; justify-content:center; }
.lb-modal img { max-width: 90%; max-height: 90%; border: 5px solid #fff; }

.woocommerce-cart-form img, .cart_item img, .product-thumbnail img { height: 130px !important; width: auto !important; object-fit: contain !important; border-radius: 10px; }
.woocommerce-cart-form .product-thumbnail { width: 175px !important; text-align: center; }

.search_row{
    display:flex;
    flex-direction:column;
    width:100%;
}

.label_search_row{
    font-size:14px;
    font-weight:600;
    margin-bottom:6px;
}

.search_row input,
.search_row select{
    width:100%;
    height:55px;
    border-radius:4px;
    border:1px solid #444;
    padding:0 12px;
    box-sizing:border-box;
    background:#fff;
}

.search_place_holder{
    font-size: 0.9rem;
    font-weight: 700;
}

.calendar-icon { 
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%); 
    width: 24px; height: 24px; fill: var(--ski-red); z-index: 5; pointer-events: none; }
.fp-reset-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 10; cursor: pointer; background: #f0f0f0; color: #333; }



#bookingModal > div {
    background: #fff;
    margin: 10% auto;
    padding: 25px;
    width: 350px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border: 1px solid #ddd;
    font-family: sans-serif;
}
#bookingModal h3 { margin-top: 0; color: #d32f2f; }
#bookingModal .button { margin-top: 15px; width: 100%; text-align: center; }

#btn-cancel {
    position: relative !important;
    z-index: 9999999 !important;
    cursor: pointer !important;
}

#bre-custom-tooltip {
    position: fixed !important; /* WICHTIG: fixed statt absolute */
    background: #333 !important;
    color: #fff !important;
    padding: 12px 18px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    z-index: 999999999 !important; /* Das höchste, was geht */
    pointer-events: none !important;
    display: none;
    white-space: pre-line;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    font-family: sans-serif;
}

#customer_data_popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000001; /* Höher als das Zusatzprodukte-Modal */
    justify-content: center;
    align-items: center;
}

#customer_data_popup .modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Sicherstellen, dass Modals immer obenauf liegen */
#extras_popup, #customer_data_popup {
    z-index: 1000005 !important;
}

/* Sicherstellen, dass Zusatzartikel klickbar sind */
.extra-item.selected {
    background-color: #ffebee; /* Helles Rot für Auswahl */
    border-color: red;
}

.extra-item {
    cursor: pointer;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    transition: 0.3s;
}

.qty-control {
    background: #fff !important;
    border: 1px solid #ccc;
}

#add_another_popup {
    display: none; /* Standard */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); /* Transparenter Hintergrund */
    z-index: 9999999 !important; /* Muss das Höchste sein */
    justify-content: center;
    align-items: center;
}

#sticky_bar {
    transition: transform 0.4s ease-in-out;
}

/* Warenkorb-Badge Container */
#cart_badge {
    background: #ff0000;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 50px;
    margin-left: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: inline-block;
    vertical-align: middle;
}

#cart_badge {
    background: #ff0000;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 50px;
    margin-left: 8px;
    display: inline-block;
}

.booking-header-title {
    font-size: 1.2rem !important;
    line-height: 1.5 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding: 10px 0 !important; 
    display: block; /* Hilft bei der korrekten Ausrichtung, falls es eine Zeile für sich ist */
}

/* In dein Custom CSS einfügen */
.woocommerce-cart-form__cart-item {
    border-left: 4px solid #bd0000; /* Deine RENT-Farbe */
    margin-bottom: 10px;
}
/* Wenn es ein Zusatzprodukt ist, etwas einrücken */
.cart_item.category-zusatzprodukte {
    margin-left: 20px;
    border-left-style: dashed;
}

/* Haupt-Fahrrad hervorheben */
.cart_item:not(.category-zusatzprodukte):not(.category-versicherung) {
    border-top: 2px solid #bd0000;
}

/* Extras einrücken */
.cart_item.category-zusatzprodukte, 
.cart_item.category-versicherung {
    background-color: #fcfcfc;
    padding-left: 30px !important;
}

.cart_item.category-zusatzprodukte td.product-name::before {
    content: "↳ ";
    color: #999;
}

/* Verstecke Extras standardmäßig */
.cart_item.category-zusatzprodukte, 
.cart_item.category-versicherung {
    display: none !important;
}

/* Verstecke Extras sofort beim Laden */
.category-extra {
    display: none !important;
}

/* Button-Styling damit er neben dem Namen gut aussieht */
.cart-accordion-trigger-wrapper {
    margin-top: 5px;
}

.toggle-extras {
    background: #f8f8f8;
    border: 1px solid #ddd;
    padding: 2px 8px;
    font-size: 50px;
    cursor: pointer;
    border-radius: 3px;
    color: #555;
}

/* Erlaube, dass Extras standardmäßig angezeigt werden, 
   bis dein Akkordeon-Skript eingreift */
.woocommerce-cart-form .cart_item.category-versicherung,
.woocommerce-cart-form .cart_item.category-zusatzprodukte {
    display: table-row !important;
}

/* Der rote Rahmen erscheint jetzt nur noch über dem ersten Produkt eines Fahrers */
.woocommerce-cart-form__cart-item.driver-group-start {
    border-top: 4px solid #bd0000 !important;
    margin-top: 20px; /* Optional: etwas Abstand zum vorherigen Bereich */
}

.driver-group-start {
    border-top: 4px solid #bd0000 !important; /* Rote Linie wie im Bild */
    margin-top: 20px !important;
}

/* Basis: 1 Spalte (Mobil) */
#ajax_results, .bike-grid {
    display: grid !important;
    gap: 25px;
    width: 100% !important;
    grid-template-columns: 1fr;
}

.extra-item {
    position: relative;
    z-index: 1000; /* Muss über allem liegen */
}
.qty-input-plus, .qty-input-minus {
    position: relative;
    z-index: 1001; /* Buttons müssen noch höher sein */
    cursor: pointer;
}

#frame_calc_modal {
    z-index: 9999999 !important; /* Sehr weit oben */
}

#do_calc {
    position: relative;
    z-index: 10000;
    pointer-events: auto;
}

/* Ab Tablet (768px): 2 Spalten */
@media (min-width: 768px) {
    #ajax_results, .bike-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Ab Laptop (1024px): 3 Spalten */
@media (min-width: 1140px) {
    #ajax_results, .bike-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Ab Desktop (1200px): 4 Spalten */
@media (min-width: 1400px) {
    #ajax_results, .bike-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/*Karten-Optimierung */
.bike-card {
    min-height: auto !important; /* Wichtig, damit sie auf Mobil nicht zu lang sind */
    height: 100%;
}

/* @media (max-width: 1200px) { .bike-grid { grid-template-columns: repeat(2, 1fr); } } */

@media (max-width: 767px) {
    .search-row {
        display: grid !important;
        grid-template-columns: 1fr !important; /* Alles untereinander */
        gap: 15px !important;
        padding: 20px !important;
        align-items: stretch !important; /* Elemente füllen die volle Breite */
    }

    /* Buttons und Inputs auf Mobilgeräten vereinheitlichen */
    .search-row button, 
    .search-row select, 
    .search-row input {
        width: 100% !important;
        height: 50px !important; /* Etwas kompakter für Mobil */
    }
    
    /* Reset-Button-Breite korrigieren */
    #filter_reset {
        width: 100% !important;
    }
}