/* ============================================================
   BeyondO2.ca — Cart Styles
   Slide-in cart panel + region selection modal
   ============================================================ */

/* ── OVERLAY ─────────────────────────────────────────────── */
#cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#cart-overlay.active {
    display: block;
    opacity: 1;
}

/* ── SLIDE-IN PANEL ──────────────────────────────────────── */
#cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 95vw;
    height: 100vh;
    background: #0d1120;
    border-left: 1px solid rgba(0, 212, 255, 0.2);
    z-index: 9100;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
}

#cart-panel.open {
    transform: translateX(0);
}

/* Cart Header */
#cart-header {
    padding: 20px 22px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#cart-title {
    font-family: 'Rajdhani', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #00d4ff;
    letter-spacing: 1px;
}

#cart-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #8892a0;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}
#cart-close:hover { background: rgba(239,68,68,0.2); color: #ef4444; border-color: rgba(239,68,68,0.4); }

/* Cart Items */
#cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #8892a0;
}
.cart-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.cart-empty p    { font-size: 15px; margin-bottom: 6px; color: #e8f4f8; }
.cart-empty small { font-size: 12px; }

/* Cart Item */
.cart-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s ease;
}
.cart-item:hover { background: rgba(0, 212, 255, 0.04); }

.cart-item-img {
    width: 56px; height: 56px;
    background: rgba(0, 212, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.cart-item-img img {
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 4px;
}

.cart-item-details { flex: 1; min-width: 0; }

.cart-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #e8f4f8;
    line-height: 1.4;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 12px;
    color: #8892a0;
    margin-bottom: 10px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-btn {
    width: 26px; height: 26px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #e8f4f8;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s ease;
}
.qty-btn:hover { background: rgba(0, 212, 255, 0.15); border-color: #00d4ff; color: #00d4ff; }

.qty-value {
    min-width: 28px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #e8f4f8;
}

.remove-btn {
    margin-left: 4px;
    width: 22px; height: 22px;
    background: transparent;
    border: none;
    color: #4a5568;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.remove-btn:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

.cart-item-subtotal {
    font-size: 14px;
    font-weight: 700;
    color: #00d4ff;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Cart Footer */
#cart-footer {
    padding: 18px 22px;
    border-top: 1px solid rgba(0, 212, 255, 0.15);
    flex-shrink: 0;
    display: none;
}

#cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    color: #e8f4f8;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

#cart-total-amount {
    font-size: 20px;
    font-weight: 700;
    color: #00d4ff;
}

#cart-checkout-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #00d4ff, #0099bb);
    color: #0a0e27;
    text-decoration: none;
    text-align: center;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1.5px;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 10px;
    border: none;
    cursor: pointer;
}
#cart-checkout-btn:hover {
    background: linear-gradient(135deg, #33ddff, #00bbdd);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
    transform: translateY(-1px);
}

#cart-continue-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: #8892a0;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
#cart-continue-btn:hover { color: #e8f4f8; border-color: rgba(255,255,255,0.25); }

/* Cart icon button (in nav) */
#cart-btn {
    position: relative;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.25);
    color: #00d4ff;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}
#cart-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.2);
}

.cart-count {
    background: #00d4ff;
    color: #0a0e27;
    border-radius: 50%;
    width: 18px; height: 18px;
    font-size: 10px;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── REGION MODAL ────────────────────────────────────────── */
#region-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 9200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#region-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#region-modal-box {
    background: #0d1120;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 16px;
    padding: 40px 36px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 0 80px rgba(0, 212, 255, 0.15);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

#region-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    background: transparent; border: none;
    color: #4a5568; font-size: 18px;
    cursor: pointer; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: all 0.15s;
}
#region-modal-close:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

#region-modal-icon { font-size: 40px; margin-bottom: 16px; }

#region-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #e8f4f8;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

#region-modal-sub {
    font-size: 14px;
    color: #8892a0;
    margin-bottom: 28px;
    line-height: 1.6;
}

#region-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.region-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}
.region-option:hover {
    background: rgba(0, 212, 255, 0.12);
    border-color: #00d4ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.2);
}

.region-flag { font-size: 22px; flex-shrink: 0; }

.region-name {
    font-size: 15px;
    font-weight: 700;
    color: #e8f4f8;
    display: block;
    margin-bottom: 2px;
}

.region-desc {
    font-size: 12px;
    color: #8892a0;
    display: block;
}

/* Scrollbar in cart */
#cart-items::-webkit-scrollbar { width: 4px; }
#cart-items::-webkit-scrollbar-track { background: transparent; }
#cart-items::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

@media (max-width: 768px) {
    /* Slide-in panel */
    #cart-panel { width: 100% !important; max-width: 420px; }

    /* Panel header/footer */
    #cart-panel-header { padding: 16px; }
    #cart-panel-footer { padding: 16px; }
    #cart-panel-items  { padding: 12px; }

    /* Cart item layout */
    .cart-item { padding: 12px 0; gap: 10px; }
    .cart-item-img { width: 56px !important; height: 56px !important; flex-shrink: 0; }
    .cart-item-name { font-size: 13px; }
    .cart-item-price { font-size: 14px; }

    /* Qty controls bigger touch targets */
    .cart-qty-btn { width: 30px !important; height: 30px !important; font-size: 16px !important; }

    /* Region modal */
    #region-modal-box { padding: 24px 16px; margin: 16px; width: calc(100% - 32px) !important; max-width: none !important; }
    .region-btn { padding: 14px 12px; font-size: 13px; }
}

@media (max-width: 480px) {
    #cart-panel { width: 100% !important; max-width: 100% !important; }
    #region-modal-box { padding: 20px 14px; }
}
