/* =============================================
   CART PAGE — Full screen, no body scroll
============================================= */
body.page-template-page-cart {
    overflow: hidden;
}
body.page-template-page-cart .ebs-desktop-footer,
body.page-template-page-cart .mobile-bottom-nav {
    display: none !important;
}

.ebc-cart-page {
    display: flex;
    height: calc(100vh - 155px);
    overflow: hidden;
    font-family: Arial, sans-serif;
    background: #f5f6fa;
}

/* =============================================
   LEFT — Cart Items
============================================= */
.ebc-cart-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid #e5e5e5;
    background: #fff;
}

.ebc-cart-left-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 25px;
    font-size: 18px;
    font-weight: 700;
    color: #0c232c;
    flex-shrink: 0;
}

.ebc-back-btn {
    color: #0c232c;
    text-decoration: none;
    font-size: 16px;
}

/* Tabs */
.ebc-tabs {
    display: flex;
    gap: 10px;
    padding: 0 25px 12px;
    flex-shrink: 0;
}
.ebc-tab {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    background: #eee;
    color: #555;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.ebc-tab.active {
    background: #0c232c;
    color: #fff;
}

.ebc-tab-panel {
    padding: 20px 16px 16px;
    overflow-y: auto;
    flex: 1;
}

/* Grid */
.ebc-cart-items,
.ebc-testride-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    align-content: start;
}

/* Empty */
.ebc-empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    gap: 12px;
    color: #888;
}
.ebc-empty-cart i { font-size: 48px; color: #ddd; }
.ebc-shop-btn {
    background: #0c232c;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
}

/* =============================================
   CART ITEM CARD
============================================= */
.ebc-cart-item,
.ebc-testride-item {
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: visible;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    background: #fff;
    position: relative;
}

/* ── Card top bar (brand tag + specs) ── */
.ebc-card-top {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    z-index: 20;
}

.ebc-product-tag {
    background: #fff;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ebc-specs-toggle {
    background: #fff;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Image gallery carousel ── */
.ebc-gallery-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 20px;
    background: #fffff;
    flex-shrink: 0;
}

.ebc-variation-gallery {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ebc-gallery-img {
    min-width: 100%;
    width: 100%;
    height: 200px;
    object-fit: cover !important;
    flex-shrink: 0;
    transition: transform 0.4s ease;
}

/* Prev / Next buttons */
.ebc-gallery-prev,
.ebc-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    color: #fff;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.ebc-gallery-prev { left: 8px; }
.ebc-gallery-next { right: 8px; }
.ebc-gallery-prev:hover,
.ebc-gallery-next:hover { background: rgba(0,0,0,0.7); }

/* ── Specs popup ── */
.ebc-specs-popup {
    display: none;
    position: absolute;
    top: 48px;
    right: 14px;
    width: 220px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    padding: 14px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    z-index: 999;
}
.ebc-specs-title {
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 13px;
}
.ebc-spec-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 12px;
    color: #555;
}

/* ── Info section ── */
.ebc-cart-item-info {
    padding: 10px 14px 4px;
}

.ebc-cart-item-name {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    text-align: center;
    margin-bottom: 4px;
}

.ebc-cart-item-variant {
    font-size: 11px;
    color: #888;
    text-align: center;
    margin-bottom: 4px;
}

/* ── Price wrap ── */
.ebc-cart-item-price-wrap {
    position: relative;
    text-align: center;
}

.ebc-cart-item-price {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    justify-content: center;
}

.ebc-price-toggle {
    color: #0c232c;
    font-size: 11px;
    cursor: pointer;
}

.ebc-price-breakdown {
    display: none;
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    width: 210px;
    z-index: 999;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    text-align: left;
}

.ebc-price-breakdown-title {
    font-size: 13px;
    font-weight: 700;
    color: #0c232c;
    margin-bottom: 8px;
}

.ebc-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #555;
    padding: 3px 0;
}

.ebc-price-row:last-child {
    font-weight: 700;
    color: #0c232c;
    border-top: 1px solid #eee;
    padding-top: 6px;
    margin-top: 4px;
}

/* ── Qty row ── */
.ebc-cart-item-qty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 14px;
    gap: 8px;
}

.ebc-qty-btn {
    height: 38px;
    flex: 1;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ebc-qty-btn.ebc-qty-minus {
    background: #e53935;
    color: #fff;
}

.ebc-qty-btn.ebc-qty-plus {
    background: #0c232c;
    color: #fff;
}

.ebc-qty-val {
    font-size: 16px;
    font-weight: 700;
    min-width: 32px;
    text-align: center;
    color: #222;
}

/* hide right panel (total/trash) */
.ebc-cart-item-right { display: none; }
.ebc-cart-item-total { display: none; }
.ebc-remove-item { display: none; }

/* ── Test ride remove btn ── */
.ebc-testride-remove-btn {
    margin: 0 14px 14px;
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
}

/* Totals */
.ebc-cart-totals {
    padding: 14px 20px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    background: #fff;
}
.ebc-totals-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #555;
    padding: 4px 0;
}
.ebc-totals-total {
    font-size: 16px;
    font-weight: 700;
    color: #0c232c;
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 6px;
}

/* =============================================
   RIGHT — Checkout Panel
============================================= */
.ebc-cart-right {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #f5f6fa;
    overflow: hidden;
}

.ebc-checkout-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.ebc-section {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.ebc-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #0c232c;
    margin-bottom: 12px;
}

.ebc-address-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.ebc-address-empty p { font-size: 13px; color: #888; margin: 0; }

.ebc-add-address-btn {
    background: #0c232c;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.ebc-address-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #f0f4f8;
    border-radius: 8px;
    border: 2px solid #0c232c;
}
.ebc-address-card i { color: #0c232c; margin-top: 2px; }
.ebc-address-text { font-size: 13px; color: #333; line-height: 1.5; }

.ebc-address-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 10px;
    outline: none;
}

.ebc-delivery-tabs { display: flex; gap: 10px; }
.ebc-del-tab {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.ebc-del-tab.active {
    border-color: #0c232c;
    background: #0c232c;
    color: #fff;
}

.ebc-select-store-btn {
    width: 100%;
    padding: 10px;
    background: #f0f4f8;
    border: 2px dashed #0c232c;
    border-radius: 8px;
    color: #0c232c;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ebc-selected-store-card {
    background: #f0f4f8;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    color: #333;
    line-height: 1.6;
}

.ebc-payment-options { display: flex; flex-direction: column; gap: 10px; }
.ebc-payment-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.ebc-payment-opt input[type="radio"] { accent-color: #0c232c; }
.ebc-payment-opt span i { margin-right: 6px; color: #0c232c; }

/* Fixed checkout */
.ebc-checkout-fixed {
    padding: 14px 16px;
    background: #fff;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}
.ebc-checkout-summary-line {
    font-size: 13px;
    color: #777;
    margin-bottom: 4px;
}
.ebc-checkout-total {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 700;
    color: #0c232c;
    margin-bottom: 10px;
}
.ebc-checkout-btn {
    width: 100%;
    padding: 14px;
    background: #0c232c;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.ebc-checkout-btn:hover { background: #1a3d52; }

.ebc-tr-banner {
    background: #eaf7e4;
    color: #2e7d32;
    border: 1px solid #b6e2a1;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
}
.ebc-cod-note {
    font-size: 12px;
    color: #e0862c;
    margin: 8px 0 0;
}
.ebc-coupon-row { display: flex; gap: 8px; }
.ebc-coupon-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}
.ebc-coupon-row input:focus { border-color: #0c232c; }
.ebc-coupon-row button {
    background: #0c232c;
    color: #fff;
    border: none;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.ebc-coupon-row button:hover { background: #77b32f; }
#ebc-coupon-msg { font-size: 12px; margin-top: 6px; }
#ebc-coupon-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #eaf7e4;
    border: 1px solid #b6e2a1;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #2e7d32;
    font-weight: 600;
}
#ebc-coupon-remove-btn {
    background: none;
    border: none;
    color: #e53935;
    font-weight: 700;
    cursor: pointer;
    font-size: 12px;
}

/* =============================================
   STORE PICKER POPUP
============================================= */
.ebc-store-picker-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99998;
}
.ebc-store-picker-popup {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    width: 420px;
    max-width: 95vw;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.ebc-store-picker-popup h5 {
    font-size: 17px; font-weight: 700; margin: 0 0 16px; color: #0c232c;
}
.ebc-store-picker-item {
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    margin-bottom: 12px;
    cursor: pointer;
    border: 2px solid transparent;
}
.ebc-store-picker-item:hover,
.ebc-store-picker-item.selected { border-color: #0c232c; }
.ebc-store-picker-item-name { font-size: 14px; font-weight: 700; color: #0c232c; margin-bottom: 6px; }
.ebc-store-picker-item-addr { font-size: 12px; color: #666; }
.ebc-store-picker-close {
    display: block; background: none; border: none;
    color: #e53935; font-size: 14px; cursor: pointer;
    float: right; margin-top: 8px;
}
/* Address Picker Popup */
.ebc-address-picker-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99998;
}
.ebc-address-picker-popup {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    width: 420px;
    max-width: 95vw;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.ebc-address-picker-popup h5 {
    font-size: 17px; font-weight: 700; margin: 0 0 16px; color: #0c232c;
}
.ebc-address-picker-item {
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    margin-bottom: 12px;
    cursor: pointer;
    border: 2px solid transparent;
}
.ebc-address-picker-item:hover,
.ebc-address-picker-item.selected { border-color: #0c232c; }
.ebc-address-picker-name { font-size: 14px; font-weight: 700; color: #0c232c; margin-bottom: 6px; }
.ebc-address-picker-text { font-size: 12px; color: #666; }
.ebc-address-picker-close {
    display: block; background: none; border: none;
    color: #e53935; font-size: 14px; cursor: pointer;
    float: right; margin-top: 8px;
}


/* ── Hover colour override: #77b32f ── */

.ebc-tab:hover { background: #77b32f; color: #fff; }
.ebc-del-tab:not(.active):hover { background: #77b32f; border-color: #77b32f; color: #fff; }
.ebc-checkout-btn:hover { background: #77b32f; }
.ebc-qty-btn.ebc-qty-plus:hover { background: #77b32f; }
.ebc-qty-btn.ebc-qty-minus:hover { background: #77b32f; }
.ebc-add-address-btn:hover { background: #77b32f; }
.ebc-shop-btn:hover { background: #77b32f; color: #fff; }
.ebc-store-picker-close:hover { color: #77b32f; background: none; }
.ebc-address-picker-close:hover { color: #77b32f; background: none; }
.ebc-select-store-btn:hover { background: #77b32f; color: #fff; border-color: #77b32f; }
.ebc-testride-remove-btn:hover { background: #77b32f; }
.ebc-store-picker-item:hover { border-color: #77b32f; }
.ebc-address-picker-item:hover { border-color: #77b32f; }


/* ── Mixed warning popup ── */
.ebc-mixed-warning-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99998;
}
.ebc-mixed-warning-popup {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px 20px;
    width: 480px; max-width: 95vw;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    font-family: Arial, sans-serif;
}
.ebc-mixed-warning-popup h5 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    color: #222;
}
.ebc-mixed-warning-popup p {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    margin: 0 0 20px;
}
.ebc-mixed-warning-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}
.ebc-mixed-warning-actions button {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 6px;
    transition: background .2s, color .2s;
}
#ebc-mixed-warning-close   { color: #e53935; }
#ebc-mixed-remove-rides    { color: #e53935; }
#ebc-mixed-select-store    { color: #2e7d32; }
#ebc-mixed-warning-close:hover,
#ebc-mixed-remove-rides:hover,
#ebc-mixed-select-store:hover { background: #0c232c; color: #fff; }

/* Edit address btn inside card */
#ebc-edit-address-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #0c232c;
    font-size: 13px;
    margin-left: auto;
    padding: 4px 6px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: background .2s, color .2s;
}
#ebc-edit-address-btn:hover {
    background: #77b32f;
    color: #fff;
}

/* Edit address popup */
.ebc-edit-address-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99998;
}
.ebc-edit-address-popup {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    width: 420px; max-width: 95vw;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    font-family: Arial, sans-serif;
}
.ebc-edit-address-popup h5 {
    font-size: 17px; font-weight: 700;
    margin: 0 0 16px; color: #0c232c;
}
.ebc-edit-address-popup input {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid #ddd; border-radius: 8px;
    font-size: 13px; margin-bottom: 10px;
    box-sizing: border-box; outline: none;
}
.ebc-edit-address-popup input:focus { border-color: #0c232c; }
.ebc-addr-edit-row {
    display: flex; gap: 10px;
}
.ebc-addr-edit-row input { flex: 1; }
.ebc-edit-address-actions {
    display: flex; justify-content: flex-end;
    gap: 16px; margin-top: 4px;
}
.ebc-edit-address-actions button {
    background: none; border: none;
    font-size: 14px; cursor: pointer;
    padding: 6px 4px; border-radius: 6px;
    transition: background .2s, color .2s;
}
#ebc-edit-address-close  { color: #e53935; }
#ebc-edit-address-confirm { color: #2e7d32; }
#ebc-edit-address-close:hover,
#ebc-edit-address-confirm:hover { background: #0c232c; color: #fff; }

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 768px) {
    body.page-template-page-cart { overflow: auto; }
    .ebc-cart-page { flex-direction: column; height: auto; overflow: visible; }
    .ebc-cart-left { overflow: visible; border-right: none; border-bottom: 1px solid #eee; }
    .ebc-tab-panel { overflow: visible; }
    .ebc-cart-items,
    .ebc-testride-items {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .ebc-gallery-wrapper { height: 160px; }
    .ebc-gallery-img { height: 160px; }
    .ebc-cart-right { width: 100%; }
    .ebc-checkout-scroll { overflow: visible; }
    .ebc-price-breakdown { left: 0; transform: none; }
}