/* --- Cart Page Redesign --- */
.cart-page-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px 20px 120px;
}

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    font-size: 32px;
    color: #182848;
    margin-bottom: 30px;
    font-weight: 700;
}

.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

/* --- Header Redesign --- */
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 5%;
    background: linear-gradient(90deg, #4b6cb7, #182848) !important; /* Blue accent color matching home page header */
    border: none !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.cart-header-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    letter-spacing: -0.02rem;
}

.cart-header-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: transform 0.2s, background 0.2s;
}

.cart-header-btn:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    transform: scale(1.05);
}

[data-theme="dark"] .cart-header {
    background: linear-gradient(90deg, #1e3a8a, #0f172a) !important;
    border: none !important;
}

[data-theme="dark"] .cart-header-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

/* --- Cart Items List & Cards --- */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item-card {
    background: white;
    border-radius: 24px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: none !important; /* Strictly no borders */
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.cart-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.item-image {
    width: 90px;
    height: 90px;
    border-radius: 18px;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
    border: none !important;
}

.item-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 90px;
    gap: 6px;
}

.item-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.item-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color, #0f172a);
    line-height: 1.3;
    margin: 0;
}

.btn-remove-item {
    background: transparent;
    border: none !important;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
    border-radius: 50%;
}

.btn-remove-item:hover {
    color: #ef4444;
    transform: scale(1.15);
}

.item-subtitle-row {
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.item-cat-tag {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 500;
}

.item-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    gap: 10px;
}

.item-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-color, #0f172a);
}

.qty-control {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 50px;
    padding: 4px 6px;
    gap: 6px;
    border: none !important; /* Strictly no borders */
}

[data-theme="dark"] .qty-control {
    background: rgba(255, 255, 255, 0.08);
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none !important;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-color, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.qty-btn-minus {
    background: white;
    color: var(--text-color, #0f172a);
}

[data-theme="dark"] .qty-btn-minus {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-color, #ffffff);
}

.qty-btn-plus {
    background: #0f172a;
    color: white;
}

[data-theme="dark"] .qty-btn-plus {
    background: var(--primary-color, #38bdf8);
    color: white;
}

.qty-btn:hover:not(:disabled) {
    transform: scale(1.08);
}

.qty-display {
    min-width: 20px;
    text-align: center;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-color, #0f172a);
}

/* --- Promo Card Redesign --- */
.promo-card {
    background: white;
    border-radius: 20px;
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: none !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

[data-theme="dark"] .promo-card {
    background: var(--card-bg, #1e293b);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    border: none !important;
}

.promo-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

#promo-code-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-color, #0f172a);
    outline: none;
    text-transform: uppercase;
    box-shadow: none !important;
}

[data-theme="dark"] #promo-code-input {
    background: transparent !important;
    color: var(--text-color, #ffffff) !important;
    border: none !important;
    box-shadow: none !important;
}

#apply-promo-btn {
    padding: 10px 22px;
    background: #3b82f6 !important; /* Blue Apply Button */
    color: white !important;
    border: none !important;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.88rem;
    transition: transform 0.2s, background 0.2s;
    box-shadow: none !important; /* Remove shadows around apply button */
}

#apply-promo-btn:hover {
    background: #2563eb !important;
    transform: scale(1.02);
    box-shadow: none !important;
}

[data-theme="dark"] #apply-promo-btn {
    background: #3b82f6 !important;
    color: white !important;
    border: none !important;
    box-shadow: none !important;
}

/* --- Summary Card Redesign --- */
.summary-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: none !important;
    position: sticky;
    top: 90px;
}

.summary-card h3,
.summary-card-title {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-color, #0f172a);
    font-size: 1.15rem;
    font-weight: 800;
    border: none !important;
    padding-bottom: 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 500;
}

.summary-row span:last-child {
    color: var(--text-color, #0f172a);
    font-weight: 700;
}

.summary-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 18px 0;
    border: none !important;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-color, #0f172a);
    margin-bottom: 20px;
}

.summary-total span:last-child {
    color: #ff5722;
    font-weight: 800;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    border: none !important;
    border-radius: 12px;
    background: linear-gradient(135deg, #4b6cb7, #182848);
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(75, 108, 183, 0.3);
}

.secure-badge {
    text-align: center;
    margin-top: 20px;
    color: #888;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.free-text {
    color: #27ae60;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 900px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .summary-card {
        position: static;
    }
}

/* --- Dark Mode Overrides --- */
[data-theme="dark"] .cart-page-wrapper {
    background: #0f172a;
}

[data-theme="dark"] .page-title {
    color: var(--text-color);
}

[data-theme="dark"] .cart-item-card,
[data-theme="dark"] .summary-card,
[data-theme="dark"] .phone-popup-card,
[data-theme="dark"] .empty-cart-container {
    background: var(--card-bg, #1e293b) !important;
    border: none !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .item-name {
    color: var(--text-color);
}

[data-theme="dark"] .item-price {
    color: var(--text-color, #ffffff);
}

[data-theme="dark"] .summary-card h3,
[data-theme="dark"] .summary-card-title {
    color: var(--text-color, #ffffff) !important;
    border: none !important;
}

[data-theme="dark"] .summary-row {
    color: #94a3b8 !important;
}

[data-theme="dark"] .summary-row span:last-child {
    color: var(--text-color, #ffffff) !important;
}

[data-theme="dark"] .summary-divider {
    background: rgba(255, 255, 255, 0.08) !important;
    border: none !important;
}

[data-theme="dark"] .summary-total {
    color: var(--text-color, #ffffff) !important;
}

[data-theme="dark"] .summary-total span:last-child {
    color: #ff5722 !important;
}

[data-theme="dark"] .secure-badge {
    color: #64748b;
}

/* --- Empty Cart Container Styling --- */
.empty-cart-container {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid transparent;
}
.empty-cart-container i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 20px;
}
.empty-cart-container p {
    color: #666;
    font-size: 18px;
}
.empty-cart-container a {
    display: inline-block;
    margin-top: 20px;
    color: #4b6cb7;
    text-decoration: none;
    font-weight: bold;
}

[data-theme="dark"] .empty-cart-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
[data-theme="dark"] .empty-cart-container p {
    color: var(--text-color);
}
[data-theme="dark"] .empty-cart-container a {
    color: var(--primary-color);
}
[data-theme="dark"] .empty-cart-container i {
    color: #475569;
}

/* --- Multi-stage Cart Views --- */
.cart-view {
    display: none;
}
.cart-view.active {
    display: block;
}

/* --- Swipe Button Slider UI (Clean Glassmorphism) --- */
.swipe-button-container {
    position: relative;
    width: 100%;
    height: 56px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none !important; /* Force no borders */
    margin: 20px 0 10px;
}

[data-theme="dark"] .swipe-button-container {
    background: rgba(255, 255, 255, 0.04);
}

.swipe-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(75, 108, 183, 0.5), var(--primary-color, #4b6cb7));
    border-radius: 28px;
    z-index: 1;
    pointer-events: none;
    transition: width 0.05s linear;
}

.swipe-track {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: transparent;
}

.swipe-label {
    position: relative;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
    opacity: 0.8;
    z-index: 2;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.swipe-thumb {
    position: absolute;
    left: 4px;
    width: 48px;
    height: 48px;
    background: var(--primary-color, #4b6cb7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: grab;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border: none !important; /* Force no borders */
}

.swipe-thumb:active {
    cursor: grabbing;
}

/* --- Glassmorphic Mobile Money Checkout Popup --- */
.phone-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.phone-popup-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 24px;
    padding: 30px 22px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
    border: none !important; /* Force no borders */
    color: var(--text-color);
}

[data-theme="dark"] .phone-popup-card {
    background: rgba(30, 41, 59, 0.75);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
}

.close-popup-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-color);
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.2s;
}

.close-popup-btn:hover {
    opacity: 1;
}

.popup-icon {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.phone-popup-card h3 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 1.35rem;
    font-weight: 800;
}

.popup-subtitle {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 18px;
    line-height: 1.4;
}

.popup-section-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    margin-bottom: 15px;
}

.popup-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.popup-field label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-color);
    opacity: 0.85;
}

/* Mapbox GL Map Container & Navigation Controls */
#checkout-map-container {
    position: relative;
    width: 100%;
    height: 230px;
    min-height: 230px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}

#checkout-map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px;
}

.mapboxgl-map {
    font-family: inherit;
    border-radius: 12px;
    width: 100% !important;
    height: 100% !important;
}

.mapboxgl-canvas-container,
.mapboxgl-canvas {
    width: 100% !important;
    height: 100% !important;
}

.mapboxgl-ctrl-group {
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.mapboxgl-ctrl-group button {
    width: 32px !important;
    height: 32px !important;
    border: none !important;
}

.mapboxgl-ctrl-icon {
    filter: invert(1);
}

.popup-field label .req {
    color: #ef4444;
}

.popup-field input,
.popup-field select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    border: none !important;
    outline: none !important;
    color: var(--text-color) !important;
    font-size: 0.95rem;
    font-weight: 600;
    box-sizing: border-box;
    box-shadow: none !important;
    font-family: inherit;
}

[data-theme="dark"] .popup-field input,
[data-theme="dark"] .popup-field select {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-color) !important;
}

.popup-field select option {
    background: var(--card-bg, #ffffff);
    color: var(--text-color, #000000);
}

/* Modern Glassmorphic Input Row */
.phone-input-row-modern {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 2px 5px;
    margin-top: 4px;
    border: none !important; /* Force no borders */
}

[data-theme="dark"] .phone-input-row-modern {
    background: rgba(255, 255, 255, 0.06);
}

.phone-prefix-badge-modern {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 15px;
    font-weight: 700;
    color: var(--text-color);
    opacity: 0.8;
}

.phone-input-row-modern input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    padding: 12px;
    font-size: 1.05rem;
    color: var(--text-color) !important;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: none !important;
}

.phone-input-row-modern.is-locked {
    background: rgba(0, 0, 0, 0.04);
    cursor: default;
}

[data-theme="dark"] .phone-input-row-modern.is-locked {
    background: rgba(255, 255, 255, 0.05);
}

.phone-input-row-modern.is-locked input {
    cursor: default;
    user-select: all;
}

.phone-locked-notice {
    font-size: 0.76rem;
    color: var(--text-muted, #94a3b8);
}

.phone-locked-notice a {
    color: var(--accent-blue, #38bdf8);
    transition: opacity 0.2s;
}

.phone-locked-notice a:hover {
    opacity: 0.8;
}

/* Detection status details and carrier single badge display */
.payment-detection-info {
    min-height: 65px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    gap: 8px;
}

#subscriber-name {
    font-size: 0.95rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.single-carrier-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    animation: scaleUp 0.2s ease-out forwards;
    border: none !important; /* Force no borders */
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.single-carrier-badge.mtn {
    background: linear-gradient(135deg, #eab308, #ca8a04);
}

.single-carrier-badge.airtel {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.single-carrier-badge.zamtel {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

/* --- Glassmorphic Payment Overlays --- */
.payment-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.glass-payment-card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 24px !important;
    border: none !important; /* Force no borders */
    max-width: 420px;
    width: 100%;
    padding: 35px 25px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25) !important;
    color: var(--text-color, #0f172a) !important;
    text-align: center;
}

[data-theme="dark"] .glass-payment-card {
    background: rgba(15, 23, 42, 0.92) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7) !important;
    color: #f8fafc !important;
}

.overlay-heading {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: #0f172a !important;
}

[data-theme="dark"] .overlay-heading {
    color: #ffffff !important;
}

.overlay-subtext {
    font-size: 0.95rem;
    color: #334155 !important;
    font-weight: 600;
    opacity: 1 !important;
    margin-bottom: 25px;
    line-height: 1.5;
}

[data-theme="dark"] .overlay-subtext {
    color: #cbd5e1 !important;
}

.pin-simulation-glass {
    background: rgba(0, 0, 0, 0.05) !important;
    padding: 20px;
    border-radius: 16px;
    border: none !important; /* Force no borders */
    margin-top: 15px;
}

[data-theme="dark"] .pin-simulation-glass {
    background: rgba(255, 255, 255, 0.08) !important;
}

.pin-input-field {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none !important;
    background: rgba(0, 0, 0, 0.08) !important;
    color: #0f172a !important;
    text-align: center;
    font-size: 1.6rem;
    letter-spacing: 0.5rem;
    margin-bottom: 15px;
    outline: none !important;
    box-sizing: border-box;
    font-weight: 700;
}

[data-theme="dark"] .pin-input-field {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

.btn-secondary-glass {
    width: 100%;
    padding: 14px;
    background: rgba(0, 0, 0, 0.08) !important;
    color: #0f172a !important;
    border: none !important;
    border-radius: 30px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

[data-theme="dark"] .btn-secondary-glass {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}