/* Baluth - Shopping Cart Stylesheet
 * Premium Modern E-Commerce + Heritage Artisan Aesthetic
 */

@import url('index.css');

/* ==========================================================================
   Base Layout & Container
   ========================================================================== */
.cart-container {
    max-width: 1480px;
    width: 100%;
    margin: 30px auto 60px;
    padding: 0 clamp(16px, 2.5vw, 36px);
    box-sizing: border-box;
}

/* Header & Intro Area */
.cart-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light, #F0ECE1);
    gap: 20px;
    flex-wrap: wrap;
}

.cart-header-left {
    flex: 1;
    min-width: 260px;
}

.cart-header {
    font-family: var(--font-sans, Arial, sans-serif);
    font-size: 2.1rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text, #1C201D);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.cart-header i {
    color: var(--primary, #205A3E);
    font-size: 1.85rem;
}

.cart-subtitle {
    color: var(--muted, #667068);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

/* Checkout Progress Steps */
.checkout-steps-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #FFFFFF;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--border, #E5E0D5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.step-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted, #667068);
}

.step-badge .step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-subtle, #F7F4EB);
    color: var(--muted, #667068);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.step-badge.active {
    color: var(--primary, #205A3E);
}

.step-badge.active .step-num {
    background: var(--primary, #205A3E);
    color: #FFFFFF;
}

.step-divider {
    color: var(--border, #E5E0D5);
    font-size: 0.7rem;
}

/* ==========================================================================
   Cart Grid (Left: Items & Form, Right: Order Summary)
   ========================================================================== */
.cart-grid {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    gap: 32px;
    align-items: start;
}

.cart-main-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ==========================================================================
   Cart Items Section
   ========================================================================== */
.cart-items-section {
    background: #FFFFFF;
    border: 1px solid var(--border, #E5E0D5);
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.025);
}

.cart-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-light, #F0ECE1);
}

.cart-items-pill {
    font-size: 0.76rem;
    font-weight: 700;
    background: var(--primary-soft, rgba(32, 90, 62, 0.08));
    color: var(--primary, #205A3E);
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: 0.3px;
}

.cart-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light, #F0ECE1);
    align-items: center;
    transition: background 0.2s;
}

.cart-item:first-of-type {
    padding-top: 0;
}

.cart-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Product Image Box with Aspect Ratio Containment */
.item-img {
    width: 96px;
    height: 96px;
    min-width: 96px;
    background: var(--surface2, #F8F6F0);
    border: 1px solid var(--border-light, #F0ECE1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 6px;
    box-sizing: border-box;
}

.item-img img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.25s ease;
}

.cart-item:hover .item-img img {
    transform: scale(1.05);
}

/* Item Details */
.item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

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

.item-title {
    font-family: var(--font-sans, Arial, sans-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text, #1C201D);
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin: 0;
}

.item-option {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--muted, #667068);
    background: var(--bg-subtle, #F7F4EB);
    padding: 3px 8px;
    border-radius: 6px;
    width: fit-content;
    font-weight: 500;
    border: 1px solid var(--border-light, #F0ECE1);
}

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

.item-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.item-current-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary, #205A3E);
}

.item-old-price {
    font-size: 0.9rem;
    color: #8E9890;
    text-decoration: line-through;
    font-weight: 500;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Compact Touch-Friendly Quantity Selector */
.qty-selector {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--border, #E5E0D5);
    border-radius: 8px;
    overflow: hidden;
    background: #FAF8F5;
    height: 36px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.qty-btn {
    width: 34px;
    height: 100%;
    background: transparent;
    border: none;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text, #1C201D);
    transition: background 0.15s, color 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    user-select: none;
}

.qty-btn:hover {
    background: var(--primary-soft, rgba(32, 90, 62, 0.12));
    color: var(--primary, #205A3E);
}

.qty-btn:active {
    transform: scale(0.92);
}

.qty-val {
    width: 36px;
    text-align: center;
    font-weight: 700;
    font-size: 0.92rem;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text, #1C201D);
    padding: 0;
}

/* Remove Button */
.remove-btn {
    background: transparent;
    border: none;
    color: #8E9890;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.remove-btn:hover {
    color: #DC2626;
    background: rgba(220, 38, 38, 0.08);
}

/* ==========================================================================
   Delivery Details Customer Form
   ========================================================================== */
.customer-form {
    background: #FFFFFF;
    border: 1px solid var(--border, #E5E0D5);
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.025);
}

.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light, #F0ECE1);
    padding-bottom: 16px;
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}

.section-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-card-icon {
    font-size: 1.3rem;
    color: var(--primary, #205A3E);
    background: var(--primary-soft, rgba(32, 90, 62, 0.08));
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-card-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text, #1C201D);
}

.section-card-sub {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--muted, #667068);
}

/* Use My Current Location Button */
.location-btn {
    background: rgba(32, 90, 62, 0.06);
    color: var(--primary, #205A3E);
    border: 1.5px solid rgba(32, 90, 62, 0.2);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    outline: none;
}

.location-btn:hover {
    background: var(--primary, #205A3E);
    color: #FFFFFF;
    border-color: var(--primary, #205A3E);
    box-shadow: 0 4px 12px rgba(32, 90, 62, 0.18);
}

.location-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form Grid */
.form-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
}

.form-grid-layout .full-width {
    grid-column: span 2;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-light, #2D332F);
    margin-bottom: 6px;
}

.form-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.form-input-wrapper i.input-icon {
    position: absolute;
    left: 14px;
    color: #8E9890;
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.2s;
    z-index: 2;
}

.form-input-wrapper .form-control {
    width: 100%;
    height: 46px;
    padding: 10px 14px 10px 42px !important;
    border: 1.5px solid var(--border, #E5E0D5);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text, #1C201D);
    background: #FFFFFF;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-input-wrapper select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667068' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    padding-right: 36px;
}

.form-input-wrapper .form-control:focus {
    border-color: var(--primary, #205A3E);
    box-shadow: 0 0 0 3.5px rgba(32, 90, 62, 0.12);
}

.form-input-wrapper .form-control:focus + i.input-icon {
    color: var(--primary, #205A3E);
}

/* ==========================================================================
   Order Summary Card (Sticky)
   ========================================================================== */
.summary-card {
    background: #FFFFFF;
    border: 1px solid var(--border, #E5E0D5);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 96px;
    border-top: 3.5px solid var(--primary, #205A3E);
}

.summary-title {
    font-size: 1.22rem;
    font-weight: 700;
    color: var(--text, #1C201D);
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light, #F0ECE1);
    display: flex;
    align-items: center;
    letter-spacing: -0.01em;
}

/* Promo / Coupon Box */
.promo-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.promo-box input {
    flex: 1;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--border, #E5E0D5);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text, #1C201D);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-sizing: border-box;
}

.promo-box input:focus {
    border-color: var(--primary, #205A3E);
    box-shadow: 0 0 0 3px rgba(32, 90, 62, 0.12);
}

.promo-box button {
    height: 44px;
    background: var(--primary, #205A3E);
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 0 18px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(32, 90, 62, 0.2);
}

.promo-box button:hover {
    background: var(--primary-dark, #153E2A);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(32, 90, 62, 0.3);
}

.promo-box button:active {
    transform: translateY(0);
}

/* Applied Coupon Card */
#appliedCouponCard {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: rgba(32, 90, 62, 0.06);
    border: 1.5px dashed var(--primary, #205A3E);
    border-radius: 12px;
    align-items: center;
    justify-content: space-between;
}

/* Free Shipping Note */
.free-shipping-note {
    background: rgba(32, 90, 62, 0.08);
    color: var(--primary, #205A3E);
    border: 1px solid rgba(32, 90, 62, 0.2);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

/* Breakdown Rows */
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 13px;
    font-size: 0.92rem;
    color: var(--muted, #667068);
}

.summary-row span:last-child {
    font-weight: 600;
    color: var(--text, #1C201D);
}

.summary-row#mrpDiscountRow span:last-child,
.summary-row#couponDiscountRow span:last-child,
.summary-row #shippingLabel {
    color: var(--primary, #205A3E);
    font-weight: 700;
}

.summary-row.total {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1.5px dashed var(--border, #E5E0D5);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text, #1C201D);
}

.summary-row.total span:last-child {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary, #205A3E);
}

/* Primary Checkout CTA Button */
.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, var(--primary, #205A3E) 0%, #17442F 100%);
    color: #FFFFFF;
    text-align: center;
    padding: 0 20px;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 24px;
    box-shadow: 0 6px 20px rgba(32, 90, 62, 0.28);
    box-sizing: border-box;
}

.btn-checkout:hover {
    background: linear-gradient(135deg, var(--primary-dark, #153E2A) 0%, #0F2D1F 100%);
    color: #FFFFFF !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(32, 90, 62, 0.38);
}

.btn-checkout:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(32, 90, 62, 0.2);
}

/* Trust Badges */
.trust-badges {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light, #F0ECE1);
    color: var(--muted, #667068);
    font-size: 0.78rem;
    font-weight: 500;
}

.trust-badge-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.trust-badge-item i {
    color: var(--primary, #205A3E);
    font-size: 0.95rem;
}

/* ==========================================================================
   Empty Cart State
   ========================================================================== */
.empty-cart-state {
    text-align: center;
    padding: 60px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-cart-icon-wrap {
    width: 88px;
    height: 88px;
    background: var(--primary-soft, rgba(32, 90, 62, 0.08));
    color: var(--primary, #205A3E);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-bottom: 20px;
    border: 1px solid rgba(32, 90, 62, 0.15);
}

.empty-cart-state h3 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text, #1C201D);
    margin: 0 0 8px;
}

.empty-cart-state p {
    color: var(--muted, #667068);
    font-size: 0.95rem;
    margin: 0 0 24px;
    max-width: 340px;
    line-height: 1.5;
}

.btn-empty-shop {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--primary, #205A3E);
    color: #FFFFFF;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(32, 90, 62, 0.25);
}

.btn-empty-shop:hover {
    background: var(--primary-dark, #153E2A);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(32, 90, 62, 0.35);
}

/* ==========================================================================
   Success & Map Modals
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #FFFFFF;
    padding: 36px 32px;
    border-radius: 20px;
    text-align: center;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(24px) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-icon {
    width: 76px;
    height: 76px;
    background: rgba(32, 90, 62, 0.1);
    color: var(--primary, #205A3E);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 18px;
    border: 2px solid rgba(32, 90, 62, 0.2);
}

.modal-content h3 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text, #1C201D);
    margin: 0 0 10px;
}

.modal-content p {
    color: var(--muted, #667068);
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0 0 24px;
}

.modal-btn {
    background: var(--primary, #205A3E);
    color: #FFFFFF;
    border: none;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.modal-btn:hover {
    background: var(--primary-dark, #153E2A);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablets (1024px and below) */
@media (max-width: 1024px) {
    .cart-grid {
        grid-template-columns: 1.4fr 1fr;
        gap: 24px;
    }

    .cart-container {
        padding: 0 20px;
    }
}

/* Small Tablets / Large Mobiles (900px and below) */
@media (max-width: 900px) {
    .cart-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .summary-card {
        position: static;
        top: auto;
    }

    .cart-header-wrapper {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .checkout-steps-badge {
        align-self: flex-start;
    }
}

/* Standard Mobile (640px and below) */
@media (max-width: 640px) {
    .cart-container {
        padding: 0 14px 50px;
        margin-top: 16px;
    }

    .cart-header {
        font-size: 1.7rem;
    }

    .cart-items-section,
    .customer-form,
    .summary-card {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .form-grid-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .form-grid-layout .full-width {
        grid-column: span 1;
    }

    .cart-item {
        align-items: flex-start;
        gap: 14px;
        padding: 16px 0;
    }

    .item-img {
        width: 80px;
        height: 80px;
        min-width: 80px;
        border-radius: 10px;
    }

    .item-title {
        font-size: 0.96rem;
    }

    .item-bottom-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .item-current-price {
        font-size: 1.05rem;
    }

    .remove-btn .remove-text {
        display: none;
    }

    .remove-btn {
        padding: 6px 8px;
        font-size: 0.95rem;
    }

    .section-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .location-btn {
        width: 100%;
        justify-content: center;
        padding: 9px 12px;
    }

    .promo-box {
        flex-direction: row;
    }

    .promo-box input,
    .promo-box button {
        height: 44px;
    }

    .trust-badges {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

/* Small Mobile (380px and below) */
@media (max-width: 380px) {
    .cart-container {
        padding: 0 10px 40px;
    }

    .cart-item {
        gap: 10px;
    }

    .item-img {
        width: 70px;
        height: 70px;
        min-width: 70px;
    }

    .item-title {
        font-size: 0.9rem;
    }

    .qty-btn {
        width: 28px;
    }

    .qty-val {
        width: 30px;
        font-size: 0.86rem;
    }

    .btn-checkout {
        font-size: 0.96rem;
        height: 48px;
    }
}