/*
 * ============================================================================
 * 🚀 ARCHITEKTUR & DOKUMENTATION (V2.0 PRO STRUKTUR)
 * ============================================================================
 * HINWEIS FÜR ENTWICKLER:
 * 1. Globale Elemente (Buttons, Inputs, Checkboxen, Spinner) liegen NUR HIER!
 * 2. Keine roten Schatten auf Buttons (box-shadow: none !important).
 * ============================================================================
 */

:root {
    /* === Primärfarben === */
    --bre-primary:       #bd0000;
    --bre-primary-hover: #990000;
    --bre-accent:        #bd0000;
    --bre-accent-hover:  #990000;

    /* === Semantische Farben === */
    --bre-success:       #34c759;
    --bre-success-hover: #2daf4f;
    --bre-info:          #007aff;
    --bre-warning:       #ff9500;
    --bre-danger:        #ff3b30;

    /* === Neutrale Farben === */
    --bre-dark:          #1e293b;
    --bre-dark-hover:    #0f172a;
    --bre-gray-btn:      #64748b;
    --bre-gray-btn-hover:#475569;
    --bre-border:        #e2e8f0;
    --bre-gray-bg:       #f8fafc;
    --bre-white:         #ffffff;

    /* === Radius-Skala === */
    --bre-radius-btn:    8px;
    --bre-radius-modal:  20px;
}

/* =========================================================================
   GLOBALE BUTTONS (GARANTIERT OHNE SCHATTEN!)
   ========================================================================= */
.bre-btn, 
.bre-btn-save, 
.bre-btn-submit, 
.bre-btn-primary, 
.bre-btn-danger, 
.bre-btn-pdf { 
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; 
    padding: 14px 20px; border-radius: var(--bre-radius-btn); 
    font-weight: 800; font-size: 14px; cursor: pointer; transition: 0.2s ease; 
    border: none !important; text-decoration: none; line-height: 1; 
    width: auto;
    box-shadow: none !important; /* Blockiert Theme-Schatten */
    outline: none !important;
}

.bre-btn-block { width: 100%; }

/* Farb-Varianten */
.bre-btn-dark { background: var(--bre-dark) !important; color: #fff !important; box-shadow: none !important; }
.bre-btn-dark:hover { background: var(--bre-dark-hover) !important; transform: translateY(-1px); }

.bre-btn-primary { background: var(--bre-primary) !important; color: #fff !important; box-shadow: none !important; }
.bre-btn-primary:hover { background: var(--bre-primary-hover) !important; transform: translateY(-1px); }

.bre-btn-secondary { background: var(--bre-gray-btn) !important; color: #fff !important; box-shadow: none !important; }
.bre-btn-secondary:hover { background: var(--bre-gray-btn-hover) !important; transform: translateY(-1px); }

.bre-btn-success { background: var(--bre-success) !important; color: #fff !important; box-shadow: none !important; }
.bre-btn-success:hover { background: var(--bre-success-hover) !important; transform: translateY(-1px); }

/* Wichtige Haupt-Buttons (Speichern & Frontend Submit) */
.bre-btn-save, .bre-btn-submit { 
    background: var(--bre-primary) !important; 
    color: #fff !important; 
    padding: 16px 30px !important; 
    font-size: 16px !important; 
    font-weight: 900 !important; 
    border-radius: 12px !important; 
}
.bre-btn-save:hover, .bre-btn-submit:hover {
    background: var(--bre-primary-hover) !important;
    transform: translateY(-2px) !important;
}

/* =========================================================================
   VEREINHEITLICHTE CLOSE-BUTTONS
   ========================================================================= */
.bre-close-btn, .bre-search-close, .bre-modal-close-corner {
    display: inline-flex !important; align-items: center; justify-content: center;
    width: 36px; height: 36px; background: var(--bre-gray-bg) !important;
    color: var(--bre-text-muted) !important; border-radius: 50%; cursor: pointer;
    transition: all 0.2s ease; border: 1px solid transparent; z-index: 100;
}
.bre-close-btn:hover, .bre-modal-close-corner:hover {
    background: var(--bre-border) !important; color: var(--bre-dark) !important; transform: scale(0.95);
}
.bre-modal-close-corner { position: absolute !important; top: 20px !important; right: 20px !important; }

/* =========================================================================
   GLOBALE EINGABEFELDER
   ========================================================================= */
.bre-input { 
    width: 100%; padding: 12px 15px; border-radius: var(--bre-radius-btn); 
    border: 1px solid var(--bre-border); font-size: 14px; font-weight: 600; 
    color: var(--bre-text-main); box-sizing: border-box; outline: none; 
    transition: 0.2s; background: #fff; 
}
.bre-input:focus { border-color: var(--bre-dark); box-shadow: 0 0 0 3px rgba(30,41,59,0.05); }

/* =========================================================================
   Z-INDEX HIERARCHIE (STRIKT & EXPLIZIT - KEINE WILDCARDS!)
   ========================================================================= */

/* LEVEL 1: Haupt-Hintergründe und Basis-Modals (Warenkorb, Kalender, Manager) */
.bre-modal-backdrop,
#quickActionModal,
#bre-crm-modal-wrapper,
#bre-bm-modal-wrapper,
#bre-hotel-modal-wrapper,
#bre-contracts-modal-wrapper,
#bre-mini-cart-modal,
.bre-bm-wrap .bre-modal {
    z-index: 999990 !important;
}

/* LEVEL 2: Sekundäre Modals (Extras, Kundendaten, Verfügbarkeit) */
#extras_popup,
#customer_data_popup,
#avail-modal {
    z-index: 999995 !important;
}

/* LEVEL 3: Warnungen, Storno, Löschen & Bestätigungen (IMMER IM VORDERGRUND) */
#bre-contact-modal,
#bre-discount-modal,
#bre-signature-modal,
#bre-return-modal,
#bre-delete-modal,
#checklist-modal,
#cart-warning-modal,
#size_conflict_modal,
#call-modal,
#partial-call-modal,
#contract-error-modal,
#bre-bm-global-alert-modal,
#bre-bm-global-confirm-modal,
#bre-bm-force-delete-confirm-modal,
#bre-bm-new-category-modal,
#bre-bm-new-brand-modal,
#bre-bm-new-attribute-modal,
#bre-bm-copy-modal,
#bre-bm-delete-modal,
#bre-bm-sync-modal,
#bre-search-modal,
#bre-global-confirm-modal {
    z-index: 999999 !important;
}

/* LEVEL 4: WordPress Core Mediathek (ABSOLUTES MAXIMUM) */
.media-modal-backdrop { z-index: 2147483646 !important; }
.media-modal { z-index: 2147483647 !important; }


/* ==========================================================================
   GLOBALER FAHRRAD-SPINNER
   ========================================================================== */
.bre-spinner, .bre-spinner::after, .bre-spinner::before {
    border: none !important; border-radius: 0 !important; background-color: transparent !important;
}
.bre-spinner {
    width: 50px !important; height: 50px !important; margin: 20px auto !important;
    background-image: url("data:image/svg+xml,%3Csvg id='Layer_2' viewBox='0 0 70 70' xmlns='http://www.w3.org/2000/svg' fill='%23bd0000'%3E%3Cpath d='m69 57.81-6.85-3.91a1 1 0 0 0 -1 0l-3 1.9-4.69-3.8a1 1 0 0 0 -1.21 0l-4 2.81-4.72-2.74a8.91 8.91 0 0 0 6.84-9.72 8.92 8.92 0 0 0 -9.89-7.84 8.6 8.6 0 0 0 -2.1.51l-2.95-5.82a2.42 2.42 0 0 0 1.2-.32 2.39 2.39 0 0 0 1-1.15l.1.07a1 1 0 0 0 1.4-.18 1 1 0 0 0 -.13-1.43 5 5 0 0 0 -1.62-.83 2.34 2.34 0 0 0 -1.08-.82l-4.22-1.54-2.95-3.69a.51.51 0 0 1 -.1-.38 2.43 2.43 0 0 0 -.25-1.43 4 4 0 0 0 3.22-1.68 3.93 3.93 0 0 0 -.95-5.5 3.86 3.86 0 0 0 -3-.65 3.91 3.91 0 0 0 -2.54 1.62 4 4 0 0 0 -.4 3.71 3 3 0 0 0 -1.75.24c-4.47 2.16-8.47 11.89-7.79 14.41.32 1.23 2.24 3.23 4.13 5l-2.11 3.64a8.8 8.8 0 0 0 -4.49-.65 8.93 8.93 0 0 0 -4.53 15.87q.35.27.72.51l-8.29 4.5a1 1 0 0 0 .5 1.88.94.94 0 0 0 .5-.13l9.57-5.21h.08c.32.1 5.85 1.39 5.85 1.39a1 1 0 0 0 .86-.19l5.84-4.7 5 7a1 1 0 0 0 1 .41l6.8-1.29a1 1 0 0 0 .63-.4l3.25-4.49 7 4.05a1 1 0 0 0 1.07-.05l3.89-2.73 4.63 3.77a1 1 0 0 0 1.17.07l3.09-2 6.27 3.64a1 1 0 1 0 1-1.73zm-31.46-20.11 3.1 6.11a1 1 0 0 0 .89.55 1 1 0 0 0 .45-.11 1 1 0 0 0 .44-1.35l-3.1-6.11a7.33 7.33 0 0 1 1.42-.32 7 7 0 1 1 -3.2 1.23zm-10.37-25.26a2 2 0 0 1 1.26-.81 2.07 2.07 0 0 1 .35 0 1.92 1.92 0 0 1 1.89 1.61 1.94 1.94 0 1 1 -3.5-.77zm-9.63 15.88c.46-2.65 3.46-9.67 6.69-11.23a1 1 0 0 1 .87 0 7 7 0 0 1 1.8 1.14.49.49 0 0 1 .15.42 2.47 2.47 0 0 0 .52 1.91l3.12 3.91a1 1 0 0 0 .43.31l4.45 1.64a.4.4 0 0 1 .06.72.42.42 0 0 1 -.32 0l-5.8-1.77-3.58-4.77a1 1 0 0 0 -1.4-.2 1 1 0 0 0 -.21 1.39l1.19 1.6-2.91 4.75a10.28 10.28 0 0 1 -5.06.18zm10.7 5.47-.2-.26 5.63-.65-5 8.13.49-3.68a4.75 4.75 0 0 0 -.92-3.54zm.37 11.73-3.61.53.06-1.37 2-.31zm-2-13.84-2.14-2.74 2.34-3.82 1.3 1.74a.93.93 0 0 0 .51.36l4.28 1.31 1.16 2.29zm-8.22-1.18c.41 0 .82.07 1.26.07a12.48 12.48 0 0 0 3.22-.42l3.79 4.85a2.79 2.79 0 0 1 .56 2l-.72 5.37-1.37.21v-5.57a1 1 0 0 0 -.38-.78 54 54 0 0 1 -6.36-5.73zm-11.15 16.8a6.93 6.93 0 0 1 6.09-7.67 6.82 6.82 0 0 1 3.24.4l-3.48 6a1 1 0 0 0 .36 1.37 1 1 0 0 0 .5.13 1 1 0 0 0 .86-.49l3.51-6 .11.07a6.94 6.94 0 0 1 -3.52 12.29 7.4 7.4 0 0 1 -1.94 0l-.87-.21a6.94 6.94 0 0 1 -4.86-5.89zm29 8.48-5.84 1.07-5.21-7.29a1 1 0 0 0 -.68-.41 1 1 0 0 0 -.76.21l-1.81 1.45a8.91 8.91 0 0 0 -2.27-11.29l-.34-.25 1.9-3.27c.76.65 1.42 1.2 1.87 1.56v6.21l-.1 2.1a2.08 2.08 0 0 0 2.11 2.13h.3l4.19-.63a1.7 1.7 0 0 0 .78-3l-.93-.72 6.06-9.94 1.12 2.2a8.92 8.92 0 0 0 2.39 16z'/%3E%3C/svg%3E") !important;
    background-size: contain !important; background-repeat: no-repeat !important; background-position: center !important;
    animation: breBikeDrive 1.2s infinite ease-in-out !important;
}

@keyframes breBikeDrive {
    0% { transform: translateX(-20px); opacity: 0; }
    20% { opacity: 1; transform: translateX(-10px) translateY(-2px); }
    80% { opacity: 1; transform: translateX(10px) translateY(2px); }
    100% { transform: translateX(20px); opacity: 0; }
}

/* ==========================================================================
   APPLE iOS STYLE TOGGLE CHECKBOX
   ========================================================================== */
.bre-checkbox-box {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 25px !important;
}

.bre-checkbox-box label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    background: #f8fafc !important; 
    border: 1px solid #e2e8f0 !important;
    padding: 16px 20px !important;
    border-radius: 16px !important; 
    cursor: pointer !important;
    margin: 0 !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02) !important;
}

.bre-checkbox-box label:hover {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06) !important;
    transform: translateY(-1px) !important;
}

.bre-checkbox-box input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 51px !important;
    height: 31px !important;
    min-width: 51px !important;
    border-radius: 31px !important;
    background-color: #e9e9ea !important; 
    cursor: pointer !important;
    position: relative !important;
    transition: background-color 0.3s ease, border-color 0.3s ease !important;
    flex-shrink: 0 !important;
    border: 2px solid transparent !important;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05) !important;
    display: inline-block !important;
}

.bre-checkbox-box input[type="checkbox"]::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    width: 23px !important;
    height: 23px !important;
    background-color: #ffffff !important;
    border-radius: 50% !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15), 0 3px 1px rgba(0,0,0,0.06) !important; 
    transition: transform 0.3s cubic-bezier(0.2, 0.85, 0.32, 1.2) !important;
}

.bre-checkbox-box input[type="checkbox"]:checked {
    background-color: var(--bre-primary, #bd0000) !important; 
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1) !important;
}

.bre-checkbox-box input[type="checkbox"]:checked::after {
    transform: translateX(20px) !important;
}

.bre-checkbox-box label span {
    font-size: 15px !important;
    color: #1c1c1e !important; 
    font-weight: 500 !important;
    line-height: 1.4 !important;
    user-select: none !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    display: block !important;
    text-align: left !important;
}

.bre-checkbox-box label span strong {
    color: #000000 !important;
    font-weight: 800 !important;
}