/* DISEÑO MEJORADO DEL CARRITO - MODESTA_PY */
/* Usando la paleta de colores original: #00304E y #f3d739 */

/* Reset y fuentes */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #00304E;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

/* Container principal mejorado */
.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 3rem;
    align-items: start;
}

/* Título del carrito mejorado */
.cart-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: #00304E;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #00304E 0%, #004066 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Items del carrito mejorados */
.cart-items-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 48, 78, 0.08);
    border: 1px solid rgba(243, 215, 57, 0.2);
}

.cart-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3d739;
}

.items-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00304E;
}

/* Botón vaciar carrito mejorado */
.btn-clear {
    background: transparent;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-clear:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* Producto individual mejorado */
.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-radius: 15px;
    border: 1px solid rgba(0, 48, 78, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.cart-item:hover {
    background: white;
    box-shadow: 0 8px 25px rgba(0, 48, 78, 0.12);
    transform: translateY(-2px);
}

/* Imagen del producto mejorada */
.item-image {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.item-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

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

/* Detalles del producto mejorados */
.item-details h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #00304E;
    margin-bottom: 0.5rem;
}

.item-details p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.product-price {
    color: #f3d739;
    font-weight: 700;
    font-size: 1rem;
    background: #00304E;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    display: inline-block;
}

/* Controles de cantidad mejorados */
.quantity-section {
    text-align: center;
}

.quantity-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #f3d739;
    border-radius: 25px;
    padding: 0.2rem;
    box-shadow: 0 2px 10px rgba(243, 215, 57, 0.2);
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3d739;
    color: #00304E;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: #00304E;
    color: #f3d739;
    transform: scale(1.1);
}

.qty-input {
    width: 50px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 700;
    color: #00304E;
    font-size: 1rem;
    padding: 0.5rem 0.2rem;
}

.qty-input:focus {
    outline: none;
}

/* Subtotal mejorado */
.subtotal-section {
    text-align: center;
}

.subtotal-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.subtotal-amount {
    font-size: 1.3rem;
    font-weight: 800;
    color: #00304E;
    background: linear-gradient(135deg, #f3d739 0%, #ffd700 100%);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(243, 215, 57, 0.3);
}

/* Botón eliminar mejorado */
.btn-remove {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(238, 90, 82, 0.3);
}

.btn-remove:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(238, 90, 82, 0.4);
}

/* Resumen del carrito mejorado */
.cart-summary {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 15px 50px rgba(0, 48, 78, 0.1);
    border: 2px solid #f3d739;
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.summary-header {
    text-align: center;
    margin-bottom: 2rem;
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #00304E;
    margin-bottom: 0.5rem;
}

.summary-subtitle {
    color: #6c757d;
    font-size: 0.9rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 48, 78, 0.1);
    font-weight: 500;
}

.summary-line:last-child {
    border-bottom: none;
}

.summary-line .label {
    color: #00304E;
}

.summary-line .value {
    font-weight: 700;
    color: #00304E;
}

.free-shipping {
    color: #27ae60 !important;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-total {
    background: linear-gradient(135deg, #00304E 0%, #004066 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1.5rem 0;
    text-align: center;
}

.total-label {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.total-amount {
    font-size: 2rem;
    font-weight: 900;
    color: #f3d739;
}

/* Botón checkout mejorado */
.btn-checkout {
    width: 100%;
    background: linear-gradient(135deg, #f3d739 0%, #ffd700 100%);
    color: #00304E;
    border: none;
    padding: 1.2rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(243, 215, 57, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-checkout::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.btn-checkout:hover::before {
    left: 100%;
}

.btn-checkout:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(243, 215, 57, 0.5);
}

/* Carrito vacío mejorado */
.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 48, 78, 0.08);
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 2rem;
    opacity: 0.3;
    background: linear-gradient(135deg, #f3d739 0%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-title {
    font-size: 2rem;
    font-weight: 800;
    color: #00304E;
    margin-bottom: 1rem;
}

.empty-subtitle {
    color: #6c757d;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.shop-now-btn {
    background: linear-gradient(135deg, #00304E 0%, #004066 100%);
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 48, 78, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shop-now-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 48, 78, 0.4);
}

/* Responsive design */
@media (max-width: 968px) {
    .cart-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .cart-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .cart-title {
        font-size: 2rem;
    }
    
    .cart-container {
        padding: 1rem;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }
    
    .cart-items-section,
    .cart-summary {
        padding: 1.5rem;
    }
    
    .total-amount {
        font-size: 1.5rem;
    }
}

/* Animaciones */
.cart-item {
    animation: slideInUp 0.5s ease;
}

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

.cart-summary {
    animation: slideInRight 0.6s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Estados de loading */
.btn-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}