/* ==========================================================================
   BIKE RENTAL ENGINE — FRONTEND STYLES (Refactored)
   Apple-Style Design System | Mobile-First | Touch-Targets 44px
   ========================================================================== */

/* --- DESIGN TOKENS --- */
:root {
    --bre-accent:       #bd0000;
    --bre-accent-hover: #990000;
    --bre-dark:         #1e293b;
    --bre-dark-mid:     #0f172a;
    --bre-muted:        #64748b;
    --bre-border:       #e2e8f0;
    --bre-bg:           #f8fafc;
    --bre-white:        #ffffff;
    --bre-r-sm:         8px;
    --bre-r-md:         12px;
    --bre-r-lg:         16px;
    --bre-r-xl:         20px;
    --bre-r-2xl:        24px;
    --bre-text-xs:      0.6875rem;
    --bre-text-sm:      0.8125rem;
    --bre-text-base:    0.9375rem;
    --bre-text-md:      1rem;
    --bre-text-lg:      1.125rem;
    --bre-text-xl:      1.5rem;
    --bre-text-2xl:     1.75rem;
    --bre-space-xs:     4px;
    --bre-space-sm:     8px;
    --bre-space-md:     16px;
    --bre-space-lg:     24px;
    --bre-space-xl:     40px;
    --bre-shadow-sm:    0 2px 8px rgba(0,0,0,0.06);
    --bre-shadow-md:    0 8px 24px rgba(0,0,0,0.08);
    --bre-shadow-lg:    0 20px 48px rgba(0,0,0,0.12);
    --bre-touch-min:    44px;
}

body, .bike-rental-app {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ====== BIKE GRID ====== */
#ajax_results, .bike-grid {
    display: grid;
    gap: var(--bre-space-lg);
    width: 100%;
    grid-template-columns: 1fr;
}
@media (min-width: 640px)  { #ajax_results, .bike-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { #ajax_results, .bike-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1440px) { #ajax_results, .bike-grid { grid-template-columns: repeat(4, 1fr); } }

/* ====== SKELETON LOADER ====== */
.bre-skeleton-card { background: var(--bre-white); border-radius: var(--bre-r-xl); padding: var(--bre-space-lg); border: 1px solid var(--bre-border); min-height: 420px; display: flex; flex-direction: column; gap: var(--bre-space-md); }
.bre-skeleton-img, .bre-skeleton-line { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: bre-shimmer 1.5s infinite; border-radius: var(--bre-r-md); }
.bre-skeleton-img { height: 200px; }
.bre-skeleton-line { height: 16px; }
.bre-skeleton-line.bre-short { width: 60%; }
.bre-skeleton-line.bre-xshort { width: 40%; }
@keyframes bre-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ====== BIKE CARDS ====== */
.bike-card { background: var(--bre-white); border-radius: var(--bre-r-xl); padding: var(--bre-space-lg); border: 1px solid var(--bre-border); position: relative; display: flex; flex-direction: column; height: 100%; transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.bike-card:hover:not(.is-out) { transform: translateY(-4px); border-color: var(--bre-accent); box-shadow: var(--bre-shadow-lg); }
.badge-status { position: absolute; top: 0; left: 0; padding: 6px 14px; font-weight: 700; z-index: 10; font-size: var(--bre-text-xs); border-top-left-radius: var(--bre-r-xl); border-bottom-right-radius: var(--bre-r-md); background: var(--bre-dark); color: #fff; }
.shop-logo-container { position: absolute; top: var(--bre-space-md); right: var(--bre-space-md); display: flex; flex-direction: column; gap: var(--bre-space-sm); align-items: flex-end; z-index: 10; }
.shop-logo-container img { width: 80px; height: auto; }
.img-container { height: 200px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--bre-bg); border-radius: var(--bre-r-md); margin-bottom: var(--bre-space-md); }
.img-container img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.3s ease; }
.img-container:hover img { transform: scale(1.05); }
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--bre-space-sm); margin-bottom: var(--bre-space-md); background: var(--bre-bg); padding: var(--bre-space-sm); border-radius: var(--bre-r-md); }
.tech-box { font-size: var(--bre-text-xs); font-weight: 600; color: var(--bre-muted); display: flex; flex-direction: column; align-items: flex-start; }
.tech-box .dashicons { font-size: 1rem; width: 1rem; height: 1rem; margin-bottom: 2px; color: var(--bre-accent); }
.tech-box span:not(.dashicons) { font-size: var(--bre-text-sm); color: var(--bre-dark); margin-top: 2px; font-weight: 700; }
.specs-btn { width: 100%; background: var(--bre-bg); border: 1px solid var(--bre-border); padding: var(--bre-space-sm) var(--bre-space-md); border-radius: var(--bre-r-sm); font-weight: 700; cursor: pointer; font-size: var(--bre-text-xs); display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--bre-space-md); min-height: var(--bre-touch-min); color: var(--bre-dark); }
.specs-content { display: none; padding: var(--bre-space-md); background: var(--bre-white); border: 1px solid var(--bre-border); border-top: none; border-radius: 0 0 var(--bre-r-sm) var(--bre-r-sm); margin-bottom: var(--bre-space-md); font-size: var(--bre-text-sm); border-left: 3px solid var(--bre-accent); color: var(--bre-muted); }
.pill { padding: var(--bre-space-sm) var(--bre-space-xs); border: 1px solid var(--bre-border); border-radius: var(--bre-r-sm); text-align: center; cursor: pointer; font-weight: 700; font-size: var(--bre-text-sm); background: var(--bre-white); flex: 1; min-height: var(--bre-touch-min); display: flex; align-items: center; justify-content: center; transition: background 0.15s, color 0.15s; }
.pill.active-frame { background: var(--bre-dark); color: var(--bre-white); border-color: var(--bre-dark); }

/* ====== WARENKORB & CHECKOUT (VON PHP ÜBERNOMMEN) ====== */
.woocommerce-cart-form img, .cart_item img, .product-thumbnail img { height: 120px !important; width: auto !important; object-fit: contain !important; border-radius: var(--bre-r-md); }
.woocommerce-cart-form .product-thumbnail { width: 160px !important; text-align: center; }
.driver-header-row td { background: #fdf2f2 !important; border-top: 2px solid var(--bre-accent) !important; padding: var(--bre-space-md) !important; }
.cart_item:not(.category-zusatzprodukte):not(.category-versicherung) { border-top: 2px solid var(--bre-accent); }
.cart_item.category-zusatzprodukte, .cart_item.category-versicherung { background: var(--bre-bg); padding-left: 24px !important; }
.cart_item.category-zusatzprodukte td.product-name::before { content: "↳ "; color: var(--bre-muted); }

.bre-split-checkout { display: flex; flex-wrap: wrap; gap: var(--bre-space-xl); align-items: flex-start; max-width: 1300px; margin: var(--bre-space-xl) auto; }
.bre-checkout-left { flex: 1 1 480px; position: sticky; top: 24px; }
.bre-checkout-right { flex: 1 1 560px; background: var(--bre-white); padding: var(--bre-space-xl); border-radius: var(--bre-r-xl); box-shadow: var(--bre-shadow-md); border: 1px solid var(--bre-border); }
.bre-checkout-title { font-size: var(--bre-text-xl); font-weight: 700; margin-bottom: var(--bre-space-lg); }

/* Desktop Grid Checkout (War vorher im PHP) */
@media (min-width: 1025px) {
    body.woocommerce-checkout form.woocommerce-checkout { display: grid !important; grid-template-columns: 55% 40% !important; gap: 0 5% !important; align-items: start !important; max-width: 1400px !important; margin: 30px auto !important; }
    body.woocommerce-checkout #customer_details { grid-column: 1 !important; grid-row: 1 / span 10 !important; display: block !important; }
    body.woocommerce-checkout #bre-custom-cart-summary { grid-column: 2 !important; grid-row: 1 !important; }
    body.woocommerce-checkout #order_review { grid-column: 2 !important; grid-row: 2 !important; }
}

/* Mobile Flex Checkout (Behebt die Quetschung) */
@media (max-width: 1024px) {
    body.woocommerce-checkout form.woocommerce-checkout { display: flex !important; flex-direction: column !important; width: 100% !important; }
    body.woocommerce-checkout #customer_details, body.woocommerce-checkout #bre-custom-cart-summary, body.woocommerce-checkout #order_review { width: 100% !important; max-width: 100% !important; margin-bottom: 30px !important; display: block !important; }
}

body.woocommerce-checkout .col2-set { width: 100% !important; display: block !important; }
body.woocommerce-checkout .col-1, body.woocommerce-checkout .col-2 { width: 100% !important; float: none !important; margin-bottom: 20px !important; }
.bre-top-btns { display: flex; gap: 10px; margin-bottom: 25px; }
.bre-btn-add { background: #bd0000 !important; color: #fff !important; padding: 18px 20px; border-radius: 12px; font-weight: 800; text-transform: uppercase; text-decoration: none !important; flex: 2; text-align: center; font-size: 14px; border:none; }
.bre-btn-del { background: #f1f5f9 !important; color: #bd0000 !important; padding: 18px 20px; border-radius: 12px; font-weight: 800; text-transform: uppercase; text-decoration: none !important; flex: 1.2; text-align: center; font-size: 11px; display: flex; align-items: center; justify-content: center; border:none; cursor:pointer; }
body.woocommerce-checkout #payment #place_order { background-color: #bd0000 !important; color: #fff !important; padding: 22px !important; border-radius: 15px !important; font-size: 18px !important; font-weight: 900 !important; text-transform: uppercase !important; width: 100% !important; border:none; cursor: pointer !important; }
body.woocommerce-checkout #order_review_heading, body.woocommerce-checkout .woocommerce-checkout-review-order-table thead, body.woocommerce-checkout .woocommerce-checkout-review-order-table .cart_item, body.woocommerce-checkout .woocommerce-checkout-review-order-table .shipping { display: none !important; }
body.woocommerce-checkout .woocommerce-checkout-review-order-table { width: 100% !important; border:none !important; border-collapse: collapse !important; }
body.woocommerce-checkout .woocommerce-checkout-review-order-table tr td, body.woocommerce-checkout .woocommerce-checkout-review-order-table tr th { border: none !important; padding: 12px 0 !important; background: transparent !important; }
body.woocommerce-checkout .woocommerce-checkout-review-order-table .cart-subtotal td { border-top: 2px solid #e2e8f0 !important; }
body.woocommerce-checkout .woocommerce-checkout-review-order-table .order-total td { border-top: 2px solid #1e293b !important; color: #bd0000 !important; font-size: 20px !important; font-weight: 900 !important; }
.bre-card-dr { background:#fff; border:1px solid #e2e8f0; border-radius:16px; padding:25px; margin-bottom:20px; box-shadow:0 4px 15px rgba(0,0,0,0.03); }
.bre-bike-row { display: block !important; margin-top: 15px; padding-top: 15px; border-top: 1px solid #f1f5f9; }
.bre-img-container { width: 100% !important; height: auto; background: #f8fafc; border-radius: 12px; display: flex; align-items: center; justify-content: center; padding: 15px; border: 1px solid #eee; margin-bottom: 15px; }
.bre-img-container img { max-width: 100% !important; height: auto !important; max-height: 180px; object-fit: contain; }
.bre-driver-total-row { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding-top: 15px; border-top: 2px dashed #e2e8f0; font-weight: 900; font-size: 16px; color: #1e293b; }
.bre-acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 15px; margin-top: 30px; }
.bre-acc-item { border: 1px solid #e2e8f0; padding: 15px; border-radius: 16px; text-align: center; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: space-between; min-height: 280px; }
#bre-acc-modal, #bre-confirm-modal { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(15,23,42,0.8); z-index:9999999; align-items:center; justify-content:center; backdrop-filter: blur(5px); }
.bre-modal-box { background:#fff; padding:40px; border-radius:24px; max-width:850px; width:95%; position:relative; box-shadow: 0 25px 60px rgba(0,0,0,0.3); max-height: 85vh; overflow-y: auto; }
.bre-single-days { font-size: 11px; color: #64748b; margin-top: 4px; }
.bre-single-days span { display: inline-block; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; margin: 2px; }

/* ====== THANK YOU PAGE ====== */
.woocommerce-checkout .site-main, .woocommerce-page .site-main { max-width: 1400px !important; width: 95% !important; margin: 0 auto !important; }
.woocommerce-checkout .woocommerce, .woocommerce-page .woocommerce-order { width: 100% !important; max-width: 1400px !important; margin: var(--bre-space-xl) auto; background: var(--bre-white); border-radius: var(--bre-r-xl); box-shadow: var(--bre-shadow-md); padding: var(--bre-space-xl); border: 1px solid var(--bre-border); }
.woocommerce-notice.woocommerce-notice--success { background: #f0fdf4 !important; color: #166534 !important; border: 1px solid #bbf7d0 !important; border-radius: var(--bre-r-md); padding: var(--bre-space-md) var(--bre-space-lg) !important; font-weight: 700; margin-bottom: var(--bre-space-lg); }
ul.woocommerce-order-overview { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: var(--bre-space-md); background: var(--bre-bg); border-radius: var(--bre-r-md); padding: var(--bre-space-lg) !important; border: 1px solid var(--bre-border); margin-bottom: var(--bre-space-xl) !important; }
ul.woocommerce-order-overview li { border-right: none !important; margin: 0 !important; padding: 0 !important; font-size: var(--bre-text-xs) !important; color: var(--bre-muted) !important; text-transform: uppercase; font-weight: 700; }
ul.woocommerce-order-overview li strong { display: block; font-size: var(--bre-text-lg); color: var(--bre-dark); margin-top: 4px; text-transform: none; font-weight: 700; }
table.woocommerce-table--order-details { border-collapse: separate !important; border-spacing: 0 !important; width: 100%; border: 1px solid var(--bre-border) !important; border-radius: var(--bre-r-md); overflow: hidden; }
table.woocommerce-table--order-details thead th { background: var(--bre-bg); padding: var(--bre-space-md) var(--bre-space-lg); font-size: var(--bre-text-xs); color: var(--bre-muted); text-transform: uppercase; font-weight: 700; border-bottom: 2px solid var(--bre-border) !important; border-top: none !important; }
table.woocommerce-table--order-details tbody td { padding: var(--bre-space-md) var(--bre-space-lg); border-bottom: 1px solid var(--bre-bg) !important; border-top: none !important; border-left: none !important; border-right: none !important; }
table.woocommerce-table--order-details tbody td.product-name a { color: var(--bre-accent); font-weight: 700; text-decoration: none; }
table.woocommerce-table--order-details tfoot th { text-align: right; padding: var(--bre-space-sm) var(--bre-space-lg); font-size: var(--bre-text-sm); color: var(--bre-muted); font-weight: 600; border-top: 1px solid var(--bre-border) !important; }
table.woocommerce-table--order-details tfoot td { font-weight: 700; color: var(--bre-dark); padding: var(--bre-space-sm) var(--bre-space-lg); border-top: 1px solid var(--bre-border) !important; }
table.woocommerce-table--order-details tfoot tr:last-child th,
table.woocommerce-table--order-details tfoot tr:last-child td { background: var(--bre-bg); padding: var(--bre-space-md) var(--bre-space-lg); border-bottom: none !important; }
table.woocommerce-table--order-details tfoot tr:last-child td { font-size: var(--bre-text-xl); color: var(--bre-accent); font-weight: 700; }

/* ====== DIVERSES ====== */
.info-pill { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--bre-dark); color: var(--bre-white); padding: var(--bre-space-sm) var(--bre-space-lg); border-radius: 50px; font-weight: 600; font-size: var(--bre-text-sm); z-index: 9999; box-shadow: var(--bre-shadow-md); }
.barcode-container { display: inline-block; background: var(--bre-white); padding: var(--bre-space-sm); border: 1px solid var(--bre-border); border-radius: var(--bre-r-sm); line-height: 0; }
.barcode-container svg { max-width: 150px; height: auto; }
.product-cat-ladegeraete { opacity: 0.5; pointer-events: none; filter: grayscale(100%); position: relative; }
.product-cat-ladegeraete::after { content: "Ab 2 Tagen"; position: absolute; top: 5px; right: 5px; background: var(--bre-accent); color: #fff; font-size: var(--bre-text-xs); padding: 2px 6px; border-radius: var(--bre-r-sm); z-index: 10; }
.product-cat-ladegeraete.is-selectable { opacity: 1; pointer-events: auto; filter: none; }
.product-cat-ladegeraete.is-selectable::after { display: none; }
#st_cart_count { transition: transform 0.2s cubic-bezier(0.175,0.885,0.32,1.275); }
.pulse-animation { transform: scale(1.4); }

/* ====== MOBILE RESPONSIVENESS ====== */
@media (max-width: 1024px) {
    .bre-split-checkout { flex-direction: column; gap: var(--bre-space-lg); }
    .bre-checkout-left, .bre-checkout-right { flex: 1 1 100%; position: relative; top: 0; }
    .bre-checkout-right { padding: var(--bre-space-lg); }
}

@media (max-width: 768px) {
    .bike-card { min-height: auto; }
    ul.woocommerce-order-overview { grid-template-columns: 1fr 1fr; }
    .woocommerce-checkout .woocommerce, .woocommerce-page .woocommerce-order { width: 100%; padding: var(--bre-space-md); border-radius: 0; border-left: none; border-right: none; margin: 0; }
    table.woocommerce-table--order-details th,
    table.woocommerce-table--order-details td { padding: var(--bre-space-md) var(--bre-space-sm) !important; }
}

@media (max-width: 480px) {
    ul.woocommerce-order-overview { grid-template-columns: 1fr; }
}