/* ============================================
   CART PAGE - cart.css
   ============================================ */

/* ===== CART HERO ===== */
.cart-hero {
    position: relative;
    background: var(--dark-bg);
    padding-top: 120px;
    padding-bottom: 60px;
    overflow: hidden;
}

/* Dot-grid texture (same as shop hero) */
.cart-hero-bg {
    position: absolute;
    inset: 0;
    opacity: 0.02;
    background-image: radial-gradient(circle at 1px 1px, white 1px, transparent 0);
    background-size: 40px 40px;
}

/* Ambient glow top-right */
.cart-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 500px;
    height: 500px;
    background: rgba(229, 62, 62, 0.06);
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
}

.cart-hero-content {
    position: relative;
    z-index: 10;
}

.cart-title {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.cart-subtitle {
    margin-top: 12px;
    color: #999;
    font-size: 16px;
}

/* ===== CART CONTENT ===== */
.cart-content {
    padding: 56px 0 96px;
    background: var(--background);
}

/* ===== EMPTY STATE ===== */
.cart-empty {
    text-align: center;
    padding: 80px 20px;
    max-width: 480px;
    margin: 0 auto;
}

.cart-empty-icon {
    width: 96px;
    height: 96px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    font-size: 40px;
    color: var(--muted);
    border: 2px dashed var(--border);
}

.cart-empty-title {
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 12px;
}

.cart-empty-text {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.cart-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--foreground);
    color: white;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.cart-empty-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

/* ===== MAIN LAYOUT ===== */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}

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

/* ===== CART ITEMS PANEL ===== */
.cart-items-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cart Items List */
.cart-items-list {
    display: grid;
    gap: 20px;
}

/* Toolbar */
.cart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.cart-items-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--foreground);
    letter-spacing: 0.02em;
}

.cart-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cart-clear-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== CART ITEM CARD ===== */
.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: white;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cart-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Item image */
.cart-item-img-wrap {
    width: 100px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--secondary);
    cursor: pointer;
}

.cart-item-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

/* Item details */
.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-item-category {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
}

.cart-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--foreground);
    cursor: pointer;
    transition: color 0.2s ease;
}

.cart-item-name:hover {
    color: var(--primary);
}

/* Size / Color meta */
.cart-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.cart-item-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    background: var(--secondary);
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    border: 1px solid var(--border);
}

/* Price */
.cart-item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--foreground);
    margin-top: 8px;
}

/* Quantity control inside cart item */
.cart-item-qty {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 12px;
    width: fit-content;
}

.cart-qty-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--foreground);
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s ease;
}

.cart-qty-btn:hover {
    background: var(--secondary);
}

.cart-qty-val {
    min-width: 36px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    border-left: 1.5px solid var(--border);
    border-right: 1.5px solid var(--border);
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Right side: line total + remove */
.cart-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    min-width: 80px;
}

.cart-item-line-total {
    font-size: 17px;
    font-weight: 800;
    color: var(--foreground);
    text-align: right;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 4px;
    line-height: 1;
}

.cart-item-remove:hover {
    color: var(--primary);
    transform: scale(1.1);
}

/* Continue shopping link */
.cart-continue-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s ease;
    padding-top: 8px;
}

.cart-continue-link:hover {
    color: var(--primary);
}

/* ===== ORDER SUMMARY ===== */
.cart-summary-panel {
    position: sticky;
    top: 120px;
}

.cart-summary-box {
    background: var(--secondary);
    border-radius: 16px;
    padding: 28px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.summary-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--foreground);
    letter-spacing: 0.02em;
}

/* Promo code */
.promo-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.promo-input-wrap {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

.promo-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--foreground);
    outline: none;
}

.promo-input::placeholder {
    color: var(--muted);
}

.promo-apply-btn {
    padding: 12px 20px;
    background: var(--foreground);
    color: white;
    border: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.promo-apply-btn:hover {
    background: var(--primary);
}

.promo-message {
    font-size: 13px;
    font-weight: 500;
    padding: 0 4px;
}

.promo-message.success {
    color: #10b981;
}

.promo-message.error {
    color: var(--primary);
}

/* Summary divider */
.summary-divider {
    height: 1px;
    background: var(--border);
}

/* Summary lines */
.summary-lines {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--muted);
}

.summary-line span:last-child {
    font-weight: 600;
    color: var(--foreground);
}

.discount-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #10b981;
}

.discount-label i {
    font-size: 12px;
}

.discount-amount {
    color: #10b981 !important;
    font-weight: 700 !important;
}

/* Total */
.summary-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--foreground);
    padding: 4px 0;
}

.summary-total-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--foreground);
}

/* Checkout Button */
.checkout-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(229, 62, 62, 0.25);
}

.checkout-btn:hover {
    background: #d73030;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(229, 62, 62, 0.35);
}

.checkout-btn:active {
    transform: translateY(0);
}

/* Trust badges */
.trust-badges {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    flex: 1;
}

.trust-badge i {
    font-size: 16px;
    color: var(--primary);
}

/* Payment icons */
.payment-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 26px;
    color: var(--muted);
    padding-top: 4px;
}

/* ===== CHECKOUT MODAL ===== */
.checkout-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.checkout-modal {
    background: white;
    border-radius: 20px;
    padding: 56px 40px 40px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal close */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--muted);
    transition: all 0.25s ease;
    z-index: 20;
}

.modal-close-btn:hover {
    background: var(--primary);
    color: white;
}

/* Step Indicator */
.checkout-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 36px;
    padding-right: 56px;
}

.checkout-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    background: white;
    transition: all 0.3s ease;
}

.checkout-step.active .step-circle {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.checkout-step.done .step-circle {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

.checkout-step span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.checkout-step.active span {
    color: var(--primary);
}

.checkout-step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 8px;
    margin-bottom: 20px;
    min-width: 40px;
    transition: background 0.3s ease;
}

.checkout-step-line.done {
    background: #10b981;
}

/* Step content */
.modal-step-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 24px;
    letter-spacing: 0.01em;
}

/* Form grid */
.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.form-full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--foreground);
}

.form-input {
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--foreground);
    outline: none;
    transition: border-color 0.3s ease;
    background: var(--secondary);
}

.form-input:focus {
    border-color: var(--primary);
    background: white;
}

.form-input::placeholder {
    color: var(--muted);
}

.form-input.error {
    border-color: var(--primary);
}

/* Modal action buttons */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-cancel-btn,
.modal-back-btn {
    padding: 12px 24px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.modal-cancel-btn:hover,
.modal-back-btn:hover {
    border-color: var(--foreground);
    color: var(--foreground);
}

.modal-next-btn {
    padding: 12px 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(229, 62, 62, 0.2);
}

.modal-next-btn:hover {
    background: #d73030;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(229, 62, 62, 0.3);
}

.modal-place-order-btn {
    background: var(--foreground);
    box-shadow: none;
}

.modal-place-order-btn:hover {
    background: var(--primary);
}

/* Review order items */
.review-order-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.review-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--secondary);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.review-item img {
    width: 56px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.review-item-info {
    flex: 1;
}

.review-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 4px;
}

.review-item-sub {
    font-size: 12px;
    color: var(--muted);
}

.review-item-total {
    font-size: 15px;
    font-weight: 800;
    color: var(--foreground);
}

.review-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 0 24px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.review-total-amount {
    font-size: 22px;
    font-weight: 800;
    color: var(--foreground);
}

/* Success Screen */
.order-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 0;
    gap: 16px;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    border: 3px solid #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #10b981;
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.success-title {
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--foreground);
}

.success-text {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
    max-width: 360px;
}

.success-order-num {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--primary);
    background: rgba(229, 62, 62, 0.06);
    padding: 8px 20px;
    border-radius: 999px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .cart-hero {
        padding-top: 80px;
        padding-bottom: 40px;
    }

    .cart-content {
        padding: 40px 0 60px;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto;
    }

    .cart-item-right {
        grid-column: 2;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-width: unset;
    }

    .cart-summary-panel {
        position: static;
    }
}

@media (max-width: 480px) {
    .cart-item {
        grid-template-columns: 72px 1fr;
        padding: 14px;
        gap: 14px;
    }

    .cart-item-img-wrap {
        width: 72px;
        height: 90px;
    }

    .checkout-modal {
        padding: 56px 20px 28px;
    }

    .checkout-steps {
        padding-right: 44px;
    }

    .modal-form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.form-full {
        grid-column: 1;
    }
}