/* ===================================================
   cart.css — Cart & Checkout page styles
   =================================================== */

:root {
    --primary-gold: #D4AF37;
    --dark-gold: #b5952f;
    --light-bg: #F8F9FA;
    --text-dark: #333333;
    --text-muted: #888;
    --success-green: #2ECC71;
    --border-radius: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0; padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background: linear-gradient(135deg, #f8f5ec 0%, #f0ebe0 100%);
    min-height: 100vh;
    color: var(--text-dark);
    direction: rtl;
}

/* --- Page header --- */
.cart-header {
    background: #fff;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.cart-header .logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-gold);
    text-decoration: none;
    flex: 1;
}
.back-link {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.back-link:hover { color: var(--primary-gold); }

/* --- Main content wrapper --- */
.cart-content {
    max-width: 560px;
    margin: 32px auto;
    padding: 0 20px 60px;
}

.cart-page-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 24px;
}

/* --- Order summary card --- */
.order-summary-card {
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: var(--border-radius);
    padding: 28px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}
.order-summary-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-gold);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e8ddb0;
}

/* --- Line items --- */
.line-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #f0f0f0;
    font-size: 15px;
    color: var(--text-dark);
}
.line-item:last-of-type {
    border-bottom: none;
}
.line-item .label  { color: #555; }
.line-item .amount { font-weight: 600; }

/* --- Grand total row --- */
.grand-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 4px;
    margin-top: 10px;
    border-top: 2px solid #e8ddb0;
}
.grand-total-row .label {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
}
.grand-total-row .amount {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-gold);
}
.vat-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* --- Discount badge shown after promo applied --- */
.discount-badge {
    display: inline-block;
    background: #e8f8ee;
    color: #27ae60;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-right: 6px;
}

/* --- Promo code section --- */
.promo-section {
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.promo-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 14px;
}
.promo-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
#promo-input {
    flex: 1;
    padding: 11px 14px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Tajawal', sans-serif;
    direction: ltr;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.2s;
}
#promo-input:focus { border-color: var(--primary-gold); }
#promo-input:disabled { background: #f9f9f9; color: #aaa; }
.btn-apply-promo {
    padding: 11px 18px;
    background: var(--primary-gold);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-apply-promo:hover { background: var(--dark-gold); transform: translateY(-1px); }
.btn-apply-promo:disabled { background: #ccc; cursor: not-allowed; transform: none; }

#promo-msg {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    min-height: 18px;
}
#promo-msg.success { color: #27ae60; }
#promo-msg.error   { color: #E74C3C; }

/* --- Checkout button --- */
.checkout-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-gold);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    font-size: 18px;
    font-weight: 800;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(212,175,55,0.35);
    margin-bottom: 12px;
}
.checkout-btn:hover {
    background: var(--dark-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212,175,55,0.45);
}

/* --- Empty cart state --- */
#empty-cart {
    text-align: center;
    padding: 60px 20px;
}
#empty-cart .empty-icon { font-size: 64px; margin-bottom: 16px; }
#empty-cart h2 { font-size: 22px; color: var(--text-dark); margin-bottom: 10px; }
#empty-cart p  { color: var(--text-muted); margin-bottom: 28px; font-size: 15px; }
.btn-back-pricing {
    display: inline-block;
    background: var(--primary-gold);
    color: #fff;
    padding: 12px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: var(--transition);
}
.btn-back-pricing:hover { background: var(--dark-gold); transform: translateY(-2px); }

/* --- Processing overlay --- */
#processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}
#processing-overlay[hidden] {
    display: none !important;
}
#processing-overlay .spinner {
    width: 52px;
    height: 52px;
    border: 4px solid #f0e8c0;
    border-top-color: var(--primary-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#processing-overlay p {
    font-size: 16px;
    color: #666;
    font-weight: 600;
}

/* --- Success dialog --- */
#success-dialog {
    border: none;
    padding: 0;
    background: transparent;
    margin: auto;
}
#success-dialog::backdrop {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}
.success-card {
    background: #fff;
    border-radius: 24px;
    padding: 44px 36px;
    text-align: center;
    width: 320px;
    max-width: 90vw;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    animation: successPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
@keyframes successPop {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}
.success-checkmark {
    width: 72px;
    height: 72px;
    background: #e8f8ee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.success-checkmark svg { width: 36px; height: 36px; }
.success-card h2 {
    font-size: 20px;
    font-weight: 800;
    color: #1A1A1A;
    margin-bottom: 8px;
}
.success-card p {
    font-size: 14px;
    color: #888;
    line-height: 1.6;
    margin-bottom: 4px;
}
.success-card .redirect-note {
    font-size: 12px;
    color: #bbb;
    margin-top: 12px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .cart-content { padding: 0 14px 60px; }
    .order-summary-card { padding: 20px 18px; }
    .grand-total-row .amount { font-size: 22px; }
}
