/* ============================================
   BEETOS - CSS DEL CARRITO MEJORADO
   cart-styles.css
   
   Agregar al final de styles.css
   ============================================ */

/* ============================================
   NOTIFICACIONES TOAST
   ============================================ */

.cart-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
}

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

.cart-notification.success {
    border-left: 4px solid #28a745;
}

.cart-notification.error {
    border-left: 4px solid #dc3545;
}

.cart-notification.info {
    border-left: 4px solid #17a2b8;
}

.cart-notification i {
    font-size: 20px;
}

.cart-notification.success i {
    color: #28a745;
}

.cart-notification.error i {
    color: #dc3545;
}

.cart-notification.info i {
    color: #17a2b8;
}

.cart-notification span {
    font-size: 14px;
    color: var(--text);
}

/* ============================================
   CARRITO VACÍO
   ============================================ */

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.cart-empty i {
    display: block;
    margin-bottom: 20px;
}

.cart-empty p {
    font-size: 16px;
    margin-bottom: 20px;
}

.cart-empty .btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    background: var(--secondary);
    color: var(--primary);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
}

.cart-empty .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* ============================================
   ITEMS DEL CARRITO (Mejorado)
   ============================================ */

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #eee;
    align-items: center;
    transition: background 0.2s;
}

.cart-item:hover {
    background: #f9f9f9;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info {
    min-width: 0; /* Fix para texto largo */
}

.cart-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 5px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-brand {
    font-size: 12px;
    color: var(--text-light);
    margin: 0 0 8px 0;
}

.cart-item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary);
}

/* ============================================
   CONTROLES DE CANTIDAD
   ============================================ */

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 4px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--primary);
    transition: all 0.2s;
}

.qty-btn:hover {
    background: var(--secondary);
    color: var(--primary);
    transform: scale(1.1);
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    -moz-appearance: textfield;
}

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

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

/* ============================================
   BOTÓN ELIMINAR
   ============================================ */

.remove-item {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item:hover {
    background: #fee;
    color: #dc3545;
}

/* ============================================
   RESUMEN DEL CARRITO
   ============================================ */

.cart-summary {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.summary-line.total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid var(--primary);
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

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

.summary-line.total span:last-child {
    color: var(--secondary);
    font-size: 20px;
}

/* ============================================
   FOOTER DEL CARRITO
   ============================================ */

.cart-footer {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-footer .btn-secondary,
.cart-footer .btn-primary {
    width: 100%;
    padding: 14px;
    text-align: center;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.cart-footer .btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.cart-footer .btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.cart-footer .btn-primary {
    background: var(--secondary);
    color: var(--primary);
}

.cart-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

/* ============================================
   BOTÓN AGREGAR AL CARRITO
   ============================================ */

.add-to-cart-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--secondary);
    color: var(--primary);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

.add-to-cart-btn i {
    font-size: 16px;
}

/* ============================================
   CONTADOR DEL CARRITO
   ============================================ */

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .cart-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .cart-item {
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto;
        gap: 10px;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
        grid-row: span 2;
    }
    
    .cart-item-info {
        grid-column: 2;
    }
    
    .cart-item-quantity {
        grid-column: 2;
        justify-self: start;
    }
    
    .remove-item {
        position: absolute;
        top: 10px;
        right: 10px;
    }
}

/* ============================================
   ANIMACIONES
   ============================================ */

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

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

.cart-item {
    animation: fadeIn 0.3s ease;
}
