/**
 * KAÏA Fashion - Cart Page Styles
 */

.cart-page {
    min-height: 100vh;
    padding: 6rem 0 3rem 0;
    background: #f8fafc;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #0f172a;
    font-family: 'Playfair Display', serif;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.empty-cart .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-cart h2 {
    font-size: 1.5rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.empty-cart p {
    color: #64748b;
    margin-bottom: 2rem;
}

/* Cart Content Layout */
.cart-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Cart Table */
.cart-items {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow-x: auto;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.cart-table th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid #e2e8f0;
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-table td {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.cart-table .product-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-table .product-info img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-table .product-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: #0f172a;
}

.cart-table .product-info .view-product {
    font-size: 0.85rem;
    color: #6D3FEA;
    text-decoration: none;
}

.cart-table .product-size {
    font-weight: 600;
    color: #475569;
}

.cart-table .product-price,
.cart-table .product-total {
    font-weight: 600;
    color: #0f172a;
}

/* Quantity Control */
.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: fit-content;
}

.qty-btn {
    width: 32px;
    height: 32px;
    background: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #0f172a;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #f1f5f9;
}

.qty-input {
    width: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    height: 32px;
    font-weight: 600;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mobile-label {
    display: none;
    color: #64748b;
    font-weight: 500;
    font-size: 0.85rem;
}

.remove-btn {
    background: none;
    border: none;
    font-size: 0.9rem;
    color: #ef4444;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.remove-btn:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* Cart Summary */
.cart-summary {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: sticky;
    top: 100px;
}

.cart-summary h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: #475569;
}

.summary-row.total {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* ============================================
   RESPONSIVE MOBILE-FIRST CARDS
   ============================================ */
@media (max-width: 768px) {
    .cart-page {
        padding: 5rem 0 2rem 0;
    }

    .cart-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cart-summary {
        position: static;
        margin-top: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }

    .cart-items {
        padding: 0;
        background: transparent;
        box-shadow: none;
        overflow-x: visible;
    }

    .cart-table {
        min-width: 100%;
        display: block;
        border-collapse: separate;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tbody {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .cart-table tr {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 1.25rem;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);
        gap: 0.75rem;
        position: relative;
    }

    .cart-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.25rem 0;
        border-bottom: none;
    }

    .cart-table td.product-info {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid #f1f5f9;
        justify-content: flex-start;
    }

    .cart-table td.product-info img {
        width: 70px;
        height: 70px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .cart-table td.product-info h4 {
        font-size: 1.05rem;
        margin-bottom: 0.2rem;
    }

    .mobile-label {
        display: inline-block;
        font-size: 0.85rem;
        color: #64748b;
        font-weight: 500;
    }

    .cart-table td.product-quantity {
        padding-top: 0.5rem;
        border-top: 1px solid #f1f5f9;
    }

    .quantity-control {
        border-radius: 8px;
    }

    .qty-btn {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }

    .qty-input {
        width: 44px;
        height: 36px;
        font-size: 1rem;
    }

    .cart-table td.product-remove {
        position: absolute;
        top: 1rem;
        right: 1rem;
        padding: 0;
    }

    .cart-table td.product-remove .remove-btn {
        font-size: 0.85rem;
        background: #fee2e2;
        color: #b91c1c;
        padding: 0.35rem 0.65rem;
        border-radius: 6px;
        font-weight: 600;
    }
}

/* Animación de error para tallas */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}