﻿/* ================================================================
   1. GLOBAL & FONTS
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Tenor+Sans&family=Inter:wght@300;400;600;700&display=swap');

/* ================================================================
   2. PAGE HEADER & WRAPPER
   ================================================================ */
.cart-page-header {
    text-align: center;
    padding: 60px 20px 30px;
    background-color: #ffffff;
}

.elegant-title {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 2.2rem;
    color: #2f6f3e;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.elegant-subtitle {
    color: #888;
    font-style: italic;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

.cart-wrapper { 
    background: #fdfdfd; 
    padding-bottom: 100px; 
    min-height: 60vh;
}

/* ================================================================
   3. LAYOUT GRID
   ================================================================ */
.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 40px;
    padding: 0 20px;
}

/* ================================================================
   4. PRODUCT LIST & CARDS
   ================================================================ */
.elegant-cart-grid { 
    width: 100%; 
}

.elegant-cart-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    border-bottom: 1px solid #eee;
    transition: background 0.3s;
}

.prod-info { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
}

.prod-img { 
    width: 90px; 
    height: 115px; 
    object-fit: cover; 
    border-radius: 4px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Typography Hierarchy */
.prod-category { 
    font-size: 8px !important; 
    text-transform: uppercase; 
    letter-spacing: 3px; 
    color: #bbb; 
    margin-bottom: 6px;
    display: block;
    font-family: 'Inter', sans-serif;
}

.item-name { 
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.95rem !important; 
    font-weight: 400;
    color: #1a1a1a; 
    letter-spacing: 0.5px; 
    line-height: 1.4;
    text-transform: capitalize;
    margin: 0;
}

.item-variety { 
    font-size: 10px !important; 
    color: #d4af37; /* Boutique Gold accent */
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    display: block;
    margin-top: 4px;
}

/* ================================================================
   5. PRICING & QUANTITY
   ================================================================ */
.prod-pricing { 
    display: flex; 
    align-items: center; 
    gap: 30px; 
}

.unit-price { 
    font-family: 'Inter', sans-serif;
    font-weight: 400; 
    color: #888; 
    width: 70px; 
    font-size: 0.9rem;
}

.item-subtotal { 
    font-family: 'Inter', sans-serif;
    font-weight: 700; 
    color: #2f6f3e; 
    width: 90px; 
    text-align: right; 
}

.elegant-qty-selector {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    padding: 4px 12px;
    background: #fff;
}

.elegant-qty-selector a { 
    text-decoration: none; 
    color: #2f6f3e; 
    font-size: 1.1rem; 
    padding: 0 5px;
    transition: opacity 0.2s;
}

.elegant-qty-selector a:hover { opacity: 0.6; }

.qty-val { 
    padding: 0 12px; 
    font-weight: 600; 
    min-width: 20px; 
    text-align: center; 
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

.prod-remove { 
    color: #ccc; 
    transition: 0.3s; 
    font-size: 1.1rem;
    margin-left: 10px;
}

.prod-remove:hover { color: #ff4b4b; }

/* ================================================================
   6. SUMMARY SIDEBAR
   ================================================================ */
.summary-card-elegant {
    background: #fff;
    padding: 35px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    border: 1px solid #f0f0f0;
    position: sticky;
    top: 120px;
    height: fit-content;
}

.summary-card-elegant h3 {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 1.4rem;
    color: #2f6f3e;
    margin-bottom: 25px;
}

.summary-line { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 18px; 
    color: #444; 
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

.summary-divider { 
    height: 1px; 
    background: #eee; 
    margin: 20px 0; 
}

.total { 
    font-family: 'Tenor Sans', sans-serif; 
    font-size: 1.4rem; 
    color: #2f6f3e; 
    font-weight: bold; 
}

.btn-checkout-elegant {
    width: 100%;
    padding: 18px;
    background: #2f6f3e;
    color: white;
    border: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 25px;
    transition: 0.3s;
    font-family: 'Inter', sans-serif;
}

.btn-checkout-elegant:hover { 
    background: #d4af37; 
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.trust-badges {
    margin-top: 20px;
    text-align: center;
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ================================================================
   7. MOBILE ADAPTABILITY (Card Transformation)
   ================================================================ */
@media (max-width: 992px) {
    .cart-container { 
        grid-template-columns: 1fr; 
    }
}

@media (max-width: 768px) {
    .elegant-title { font-size: 1.8rem; }
    
    /* Transform Table Rows to standalone Cards */
    .elegant-cart-card {
        flex-direction: column;
        align-items: flex-start;
        background: #fff;
        padding: 20px;
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 8px;
        position: relative;
    }

    .prod-info {
        width: 100%;
        border-bottom: 1px solid #f9f9f9;
        padding-bottom: 15px;
    }

    .prod-pricing {
        width: 100%;
        margin-top: 15px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 15px;
    }

    .item-name { font-size: 0.85rem !important; }
    .item-variety { font-size: 9px !important; }

    /* Hide labels on mobile or style them as card segments */
    .unit-price, .item-subtotal {
        width: auto;
        text-align: left;
    }

    .prod-remove {
        position: absolute;
        top: 20px;
        right: 20px;
    }

    .summary-card-elegant {
        position: static;
        margin-top: 20px;
    }
}
/* ================================================================
   SCRATCH CARD REWARD SECTION
   ================================================================ */

/* Section divider */
.reward-divider {
    display: flex;
    align-items: center;
    margin: 20px 0 14px;
    gap: 10px;
}
.reward-divider::before,
.reward-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #d4af37, transparent);
}
.reward-divider-text {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #d4af37;
    white-space: nowrap;
}

/* Locked progress card */
.reward-locked-card {
    background: linear-gradient(135deg, #f8fdf9, #fff);
    border: 1.5px dashed #c8e6c9;
    border-radius: 10px;
    padding: 16px 14px 14px;
    text-align: center;
}
.reward-locked-icon {
    font-size: 22px;
    color: #d4af37;
    margin-bottom: 8px;
    animation: rewardBob 2s ease-in-out infinite;
}
@keyframes rewardBob {
    0%, 100% { transform: translateY(0);    }
    50%       { transform: translateY(-4px); }
}
.reward-locked-msg {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: #555;
    margin: 0 0 10px;
    line-height: 1.5;
}
.reward-locked-msg strong {
    color: #1b7a3e;
    font-weight: 700;
}
.reward-progress-track {
    height: 6px;
    background: #e8f5e9;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 6px;
}
.reward-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ea855, #d4af37);
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(.4,0,.2,1);
    width: 0%;
}
.reward-progress-label {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: #aaa;
    margin: 0;
}

/* Scratch instruction */
.scratch-instruction {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: #1b5e30;
    text-align: center;
    margin: 0 0 10px;
    font-weight: 600;
    animation: fadeSlideIn 0.5s ease;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Scratch card outer container — positions reward layer + canvas */
.scratch-card-outer {
    position: relative;
    width: 260px;
    height: 120px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(27,122,62,0.15), 0 2px 6px rgba(0,0,0,0.08);
    user-select: none;
}

/* Green gradient reward layer (behind canvas) */
.scratch-reward-inner {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1b7a3e 0%, #2ea855 60%, #1b5e30 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    border-radius: 12px;
}
.scratch-reward-emoji {
    font-size: 18px;
    line-height: 1;
}
.scratch-reward-tag {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 800;
    color: #d4af37;
    letter-spacing: 3px;
    line-height: 1.1;
    text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
.scratch-reward-desc {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 11px;
    color: rgba(255,255,255,0.9);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Canvas sits on top of reward layer */
#scratchCanvas {
    position: absolute;
    top: 0; left: 0;
    border-radius: 12px;
    touch-action: none;
    display: block;
    cursor: crosshair;
}

/* Apply bar below the scratch card */
.promo-apply-bar {
    margin-top: 12px;
    animation: fadeSlideIn 0.4s ease;
}
.promo-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.promo-input {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid #d4edda;
    border-radius: 8px;
    font-family: 'Tenor Sans', sans-serif;
    font-size: 13px;
    letter-spacing: 2px;
    color: #1b5e30;
    background: #f8fdf9;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: default;
}
.promo-input:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212,175,55,0.12);
}
.promo-apply-btn {
    height: 40px;
    padding: 0 16px;
    background: #1b7a3e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Tenor Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.25s, transform 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.promo-apply-btn:hover    { background: #d4af37; }
.promo-apply-btn:active   { transform: scale(0.97); }
.promo-apply-btn:disabled { background: #aaa; cursor: not-allowed; }

.promo-feedback {
    min-height: 18px;
    margin-top: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    line-height: 1.4;
}
.promo-feedback.success { color: #2ea855; }
.promo-feedback.error   { color: #e05252; }

/* Remove button inside applied row */
.promo-remove-btn {
    background: none;
    border: none;
    color: #ccc;
    font-size: 10px;
    cursor: pointer;
    padding: 0 3px;
    line-height: 1;
    transition: color 0.2s;
}
.promo-remove-btn:hover { color: #e05252; }

@keyframes promoRowIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .scratch-card-outer { width: 100%; }
    #scratchCanvas       { width: 100%; }
}

/* ================================================================
   SUMMARY DISCOUNT ROW  (sits between Shipping and gold divider)
   ================================================================ */
.summary-discount-row {
    animation: promoRowIn 0.4s cubic-bezier(.4,0,.2,1);
}
.summary-discount-label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #2ea855 !important;
    font-weight: 600;
}
.summary-discount-label i {
    color: #d4af37;
    font-size: 12px;
}
.summary-discount-value {
    color: #e05252 !important;
    font-weight: 800 !important;
    font-size: 15px;
}
@keyframes promoRowIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Apply button — full width below scratch card */
#promoApplyBar .promo-apply-btn {
    width: 100%;
    height: 42px;
    font-size: 12px;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 8px;
}
