/* ==========================================
   CARRITO DE COMPRAS - ESTILOS INDEPENDIENTES
   ========================================== */

/* Botón del carrito en navbar */
.navbar-cart {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: #2c2c2c;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.navbar-cart:hover {
    background-color: rgba(44, 44, 44, 0.1);
    transform: translateY(-1px);
}

.navbar-cart svg {
    transition: transform 0.2s ease;
}

.navbar-cart:hover svg {
    transform: scale(1.1);
}

/* Contador del carrito */
.cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: 18px;
    animation: cartBounce 0.3s ease-out;
}

.cart-count.hidden {
    display: none;
}

@keyframes cartBounce {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Overlay del carrito */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

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

/* Panel deslizante del carrito */
.cart-slide {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100vh;
    background: #ffffff;
    z-index: 9999;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    font-family: 'Cormorant Garamond', serif;
}

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

/* Header del carrito */
.cart-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e8e8e8;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.cart-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c2c2c;
    margin: 0;
    font-family: 'Cormorant Garamond', serif;
}

.cart-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
}

.cart-close:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

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

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 24px;
    text-align: center;
    color: #666;
}

.cart-empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.cart-empty h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #2c2c2c;
    font-family: 'Cormorant Garamond', serif;
}

.cart-empty p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Items del carrito */
.cart-items {
    padding: 0;
}

.cart-item {
    display: flex;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.cart-item:hover {
    background-color: #fafafa;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 16px;
    background: #f8f8f8;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #2c2c2c;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.cart-item-brand {
    font-size: 12px;
    color: #666;
    margin: 0 0 8px 0;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    background: #f8f8f8;
    border-radius: 6px;
    padding: 2px;
}

.quantity-btn {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #e8e8e8;
    color: #2c2c2c;
}

.quantity-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quantity-display {
    min-width: 32px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #2c2c2c;
    padding: 0 4px;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #2c2c2c;
    margin-left: 16px;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.cart-item-remove:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* Footer del carrito */
.cart-footer {
    border-top: 1px solid #e8e8e8;
    padding: 20px 24px;
    background: #fafafa;
    flex-shrink: 0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #2c2c2c;
}

.cart-total-label {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
}

.cart-total-amount {
    font-size: 18px;
    color: #e74c3c;
}

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

.cart-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', serif;
}

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

.cart-btn-primary:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

.cart-btn-secondary {
    background: transparent;
    color: #2c2c2c;
    border: 1px solid #e8e8e8;
}

.cart-btn-secondary:hover {
    background: #f8f8f8;
    border-color: #d0d0d0;
}

/* Animación de agregado al carrito */
@keyframes addToCart {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cart-item-added {
    animation: addToCart 0.3s ease-out;
}

/* Responsive */
@media (max-width: 480px) {
    .cart-slide {
        width: 100vw;
        right: -100vw;
    }
    
    .cart-header {
        padding: 16px 20px;
    }
    
    .cart-item {
        padding: 16px 20px;
    }
    
    .cart-footer {
        padding: 16px 20px;
    }
}

/* Scroll personalizado */
.cart-content::-webkit-scrollbar {
    width: 4px;
}

.cart-content::-webkit-scrollbar-track {
    background: transparent;
}

.cart-content::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 2px;
}

.cart-content::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}
