/* ============================================
 * CARRITO LATERAL (SLIDE-IN CART) - VERSIÓN COMPACTA
 * ============================================ */

/* Overlay oscuro cuando el carrito está abierto */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Carrito lateral */
.side-cart {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.side-cart.active {
    right: 0;
}

/* Header del carrito */
.side-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #EDE1CF;
    background: #FFFCF9;
}

.side-cart-title {
    font-size: 18px;
    font-weight: 700;
    color: #2C2C2C;
    display: flex;
    align-items: center;
    gap: 8px;
}

.side-cart-title i {
    color: #B89573;
}

.side-cart-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.side-cart-close:hover {
    color: #B89573;
}

/* Contenido del carrito */
.side-cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.side-cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.side-cart-empty i {
    font-size: 64px;
    color: #EDE1CF;
    margin-bottom: 20px;
}

.side-cart-empty p {
    font-size: 16px;
    margin: 0;
}

/* Items del carrito - MÁS COMPACTOS */
.side-cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.side-cart-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #FFFCF9;
    border-radius: 8px;
    border: 1px solid #EDE1CF;
    position: relative;
    min-height: 90px;
}

.side-cart-item-image-link {
    flex-shrink: 0;
}

.side-cart-item-image-link img,
.side-cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
}

.side-cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.side-cart-item-info {
    flex: 1;
}

.side-cart-item-name {
    font-weight: 600;
    color: #2C2C2C;
    font-size: 13px;
    line-height: 1.3;
    margin: 0 0 3px 0;
}

.side-cart-item-name a {
    color: #2C2C2C;
    text-decoration: none;
}

.side-cart-item-name a:hover {
    color: #B89573;
}

.side-cart-item-brand {
    font-size: 11px;
    color: #B89573;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.side-cart-item-meta {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.side-cart-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.side-cart-item-price {
    font-weight: 600;
    color: #B89573;
    font-size: 14px;
}

.side-cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #EDE1CF;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0;
}

.quantity-btn:hover {
    background: #B89573;
    color: white;
    border-color: #B89573;
}

.quantity-btn i {
    font-size: 10px;
}

.quantity-value {
    font-weight: 600;
    font-size: 13px;
    min-width: 20px;
    text-align: center;
}

.side-cart-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #F44336;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    padding: 0;
}

.side-cart-item-remove:hover {
    background: #D32F2F;
}

.side-cart-item-remove i {
    font-size: 9px;
}

/* Footer del carrito */
.side-cart-footer {
    border-top: 2px solid #EDE1CF;
    padding: 18px 20px;
    background: #FFFCF9;
}

.side-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 16px;
}

.subtotal-label {
    font-weight: 600;
    color: #2C2C2C;
}

.subtotal-amount {
    font-weight: 700;
    color: #B89573;
    font-size: 20px;
}

.side-cart-shipping {
    font-size: 11px;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
}

.side-cart-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-btn {
    padding: 13px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: block;
    text-align: center;
}

.cart-btn-primary {
    background: #B89573;
    color: white;
}

.cart-btn-primary:hover {
    background: #A68562;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 149, 115, 0.3);
}

.cart-btn-secondary {
    background: white;
    color: #2C2C2C;
    border: 2px solid #EDE1CF;
}

.cart-btn-secondary:hover {
    background: #FFFCF9;
    border-color: #B89573;
}

/* Animación de agregar al carrito */
@keyframes cartShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.cart-icon.shake {
    animation: cartShake 0.5s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .side-cart {
        width: 100%;
        right: -100%;
    }
    
    .side-cart.active {
        right: 0;
    }
}

/* Loading state */
.side-cart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    border: 3px solid #EDE1CF;
    border-top: 3px solid #B89573;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Notificación de producto agregado */
.cart-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.cart-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.cart-notification i {
    margin-right: 10px;
}