/**
 * Estilos para el carrito de compras
 */

/* Icono del carrito en la barra de navegación */
.carrito-icono {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 18px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.carrito-icono:hover {
    transform: scale(1.1);
}

.carrito-icono svg {
    width: 26px;
    height: 26px;
    fill: white;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.carrito-contador {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    color: white;
    font-size: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 2px solid white;
    transition: all 0.3s ease;
}

/* Modal del carrito */
.carrito-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    overflow: auto;
}

.carrito-modal.visible {
    display: block;
}

.carrito-contenido {
    background-color: white;
    margin: 50px auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.carrito-cerrar {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #777;
}

.carrito-cerrar:hover {
    color: #333;
}

.carrito-titulo {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}

/* Tabla de productos */
.carrito-tabla {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-radius: 12px;
    overflow: hidden;
}

.carrito-tabla th {
    text-align: left;
    padding: 15px;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    color: #495057;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
    border-bottom: 2px solid #3498db;
}

.carrito-tabla td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    transition: background-color 0.3s ease;
}

.carrito-tabla tr:hover td {
    background-color: rgba(52, 152, 219, 0.05);
}

.carrito-tabla tr:last-child td {
    border-bottom: none;
}

.carrito-producto-imagen {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 5px;
    background-color: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.carrito-producto-imagen:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.carrito-producto-nombre {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
    transition: color 0.3s ease;
}

.carrito-producto-nombre:hover {
    color: #3498db;
}

.carrito-cantidad {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.carrito-cantidad-btn {
    width: 30px;
    height: 30px;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border: 1px solid #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    font-weight: bold;
    color: #495057;
    transition: all 0.3s ease;
}

.carrito-cantidad-btn:hover {
    background: linear-gradient(145deg, #e9ecef, #f8f9fa);
    color: #3498db;
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.carrito-cantidad-input {
    width: 45px;
    height: 30px;
    text-align: center;
    margin: 0 8px;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    font-weight: 600;
    color: #495057;
    background-color: white;
}

.carrito-eliminar {
    color: #e74c3c;
    cursor: pointer;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 5px;
    background-color: rgba(231, 76, 60, 0.1);
    transition: all 0.3s ease;
    display: inline-block;
}

.carrito-eliminar:hover {
    background-color: rgba(231, 76, 60, 0.2);
    color: #c0392b;
    transform: translateY(-2px);
}

/* Resumen y acciones */
.carrito-resumen {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 20px;
    border-top: 2px solid #3498db;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.carrito-total {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.05);
    background: rgba(52, 152, 219, 0.1);
    padding: 10px 20px;
    border-radius: 50px;
    border-left: 4px solid #3498db;
}

.carrito-acciones {
    display: flex;
    gap: 15px;
}

.carrito-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.carrito-btn-vaciar {
    background: linear-gradient(145deg, #f5f5f5, #e0e0e0);
    color: #555;
    border: 1px solid #ddd;
}

.carrito-btn-vaciar:hover {
    background: linear-gradient(145deg, #e0e0e0, #f5f5f5);
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.carrito-btn-pedir {
    background: linear-gradient(145deg, #25D366, #1da851);
    color: white;
    padding-left: 30px;
    padding-right: 30px;
}

.carrito-btn-pedir:hover {
    background: linear-gradient(145deg, #1da851, #25D366);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.3);
}

/* Carrito vacío */
.carrito-vacio {
    text-align: center;
    padding: 50px 30px;
    color: #7f8c8d;
    font-size: 20px;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin: 30px 0;
    border: 1px dashed #bdc3c7;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.carrito-vacio:before {
    content: '🛒';
    font-size: 50px;
    margin-bottom: 10px;
    display: block;
    opacity: 0.5;
}

.carrito-vacio svg {
    width: 60px;
    height: 60px;
    fill: #ddd;
    margin-bottom: 15px;
}

/* Botón de agregar al carrito */
.agregar-carrito-btn {
    display: inline-block;
    background: linear-gradient(145deg, #25D366, #1da851);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.2);
}

.agregar-carrito-btn:hover {
    background: linear-gradient(145deg, #1da851, #25D366);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.3);
}

/* Notificaciones */
.notificacion {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    z-index: 1002;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
}

.notificacion:before {
    font-size: 18px;
}

.notificacion.visible {
    transform: translateY(0);
    opacity: 1;
}

.notificacion.error {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    border-left: 5px solid #c0392b;
}

.notificacion.error:before {
    content: '✕';
}

.notificacion:not(.error) {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
    border-left: 5px solid #27ae60;
}

.notificacion:not(.error):before {
    content: '✓';
}

/* Responsive */
@media (max-width: 992px) {
    .carrito-contenido {
        padding: 15px;
    }
    
    .carrito-tabla {
        border-radius: 10px;
    }
    
    .carrito-tabla th,
    .carrito-tabla td {
        padding: 12px 10px;
    }
    
    .carrito-producto-imagen {
        width: 60px;
        height: 60px;
    }
    
    .carrito-producto-nombre {
        font-size: 15px;
    }
    
    .carrito-total {
        font-size: 20px;
        padding: 8px 15px;
    }
    
    .carrito-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .carrito-contenido {
        width: 95%;
        margin: 30px auto;
        padding: 10px;
    }
    
    .carrito-tabla th:nth-child(3),
    .carrito-tabla td:nth-child(3) {
        display: none;
    }
    
    .carrito-tabla th {
        font-size: 13px;
        padding: 10px 8px;
    }
    
    .carrito-tabla td {
        padding: 10px 8px;
    }

    .carrito-resumen {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        padding: 15px;
    }

    .carrito-acciones {
        width: 100%;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .carrito-btn {
        width: 100%;
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .carrito-vacio {
        padding: 30px 20px;
    }
    
    .carrito-vacio:before {
        font-size: 40px;
    }
}

@media (max-width: 576px) {
    .carrito-tabla {
        font-size: 14px;
    }
    
    .carrito-producto-imagen {
        width: 50px;
        height: 50px;
    }
    
    .carrito-producto-nombre {
        font-size: 14px;
    }
    
    .carrito-cantidad {
        flex-direction: column;
        gap: 5px;
    }
    
    .carrito-cantidad-btn {
        width: 25px;
        height: 25px;
    }
    
    .carrito-cantidad-input {
        width: 40px;
        height: 25px;
        margin: 5px 0;
    }
    
    .carrito-eliminar {
        padding: 5px 8px;
        font-size: 13px;
    }
    
    .carrito-total {
        font-size: 18px;
        padding: 8px 12px;
    }
    
    .carrito-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .notificacion {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 12px 15px;
        text-align: center;
        justify-content: center;
    }
}