/* ═══════════════════════════════════════
   CART PAGE — Chethi Batik 2026
═══════════════════════════════════════ */

/* ─── Page Hero (Small) ─── */
.page-hero {
    position: relative;
    background: var(--bg-card);
    padding: clamp(8rem, 15vw, 12rem) 0 clamp(3rem, 6vw, 4.5rem);
    overflow: hidden;
    text-align: center;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(211,47,47,0.08) 0%, transparent 65%);
    pointer-events: none;
}

.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(0deg,transparent,transparent 39px,rgba(0,0,0,0.025) 39px,rgba(0,0,0,0.025) 40px),
    repeating-linear-gradient(90deg,transparent,transparent 39px,rgba(0,0,0,0.025) 39px,rgba(0,0,0,0.025) 40px);
    pointer-events: none;
}

.page-hero-content {
    position: relative;
    z-index: 2;
    padding: 0 var(--pad);
}

.page-hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.page-hero-content h1 em {
    font-style: italic;
    color: var(--red);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: rgba(0,0,0,0.4);
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: rgba(0,0,0,0.65);
    transition: color 0.2s;
}

.breadcrumbs a:hover { color: var(--red); }
.breadcrumbs .sep { color: rgba(0,0,0,0.25); }
.breadcrumbs .current { color: var(--text-main); }

/* ─── Cart Section ─── */
.cart-section {
    padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(5rem, 10vw, 8rem);
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2.5rem;
    align-items: start;
}

/* ─── Empty Cart ─── */
.empty-cart {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
}

.empty-cart-icon {
    width: 100px;
    height: 100px;
    background: var(--bg-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    font-size: 2.5rem;
    color: var(--text-muted);
}

.empty-cart h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.8rem;
}

.empty-cart p {
    color: var(--text-muted);
    font-size: 0.98rem;
    max-width: 400px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

/* ─── Cart Items Panel ─── */
.cart-items-panel { min-width: 0; }

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.8rem;
}

.cart-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.cart-count-badge {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--red);
    color: var(--white);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.cart-continue-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: color 0.2s;
}

.cart-continue-link:hover { color: var(--red); }

/* ─── Cart Item ─── */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 1.2rem;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.2rem;
    transition: box-shadow 0.25s, transform 0.25s;
}

.cart-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.cart-item.removing {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s, transform 0.3s;
}

.cart-item-image {
    width: 100px;
    height: 120px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--bg-2);
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.cart-item-image:hover img { transform: scale(1.05); }

.cart-item-details { min-width: 0; }

.cart-item-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1.3;
}

.cart-item-name:hover { color: var(--red); }

.cart-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.cart-item-discount {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.orig-price {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.disc-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--red);
    background: rgba(211,47,47,0.08);
    padding: 0.1rem 0.4rem;
    border-radius: 2px;
}

.cart-item-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.8rem;
}


.quantity-selector {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.qty-btn {
    width: 34px;
    height: 38px;
    background: var(--bg-2);
    border: none;
    font-size: 1rem;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-body);
}

.qty-btn:hover { background: var(--bg-3); }

.cart-qty-input {
    width: 48px;
    height: 38px;
    border: none;
    border-left: 1.5px solid var(--border);
    border-right: 1.5px solid var(--border);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--text-main);
    background: var(--bg-card);
    outline: none;
    appearance: textfield;
    -webkit-appearance: none;
}

.cart-item-line-total {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: right;
}

.cart-remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cart-remove-btn:hover {
    background: #fee2e2;
    color: var(--red);
}

/* ─── Cart Summary Panel ─── */
.cart-summary-panel {
    position: sticky;
    top: 90px;
}

.cart-summary {
    background: #fff;
    color: var(--text-main);
    border-radius: 4px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-light);
}

.cart-summary h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0.9rem;
}

.free-tag {
    color: #4ade80;
    font-weight: 700;
    font-size: 0.82rem;
}

.free-shipping-progress {
    background: var(--bg-2);
    border-radius: 4px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.free-shipping-progress p { margin-bottom: 0.6rem; }
.free-shipping-progress strong { color: var(--text-main); }

.shipping-bar {
    height: 4px;
    background: var(--bg-3);
    border-radius: 2px;
    overflow: hidden;
}

.shipping-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red-dark), var(--red-bright));
    border-radius: 2px;
    transition: width 0.5s var(--ease);
}

.free-shipping-earned {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: #4ade80;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-divider {
    height: 1px;
    background: var(--border);
    margin: 1rem 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.btn-checkout {
    width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.trust-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1.2rem;
}

.trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.trust-item i {
    font-size: 1rem;
    color: var(--text-main);
}

/* ─── Toast Notification ─── */
.cart-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #fff;
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 4px;
    border-left: 3px solid var(--red);
    font-size: 0.88rem;
    z-index: 9999;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.35s var(--spring);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 240px;
    box-shadow: var(--shadow-light);
}

.cart-toast.show { transform: translateY(0); opacity: 1; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary-panel {
        position: relative;
        top: auto;
    }
}

@media (max-width: 600px) {
    .cart-item {
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto;
    }

    .cart-item-controls {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .cart-item-line-total { font-size: 0.88rem; }
}
