/* ============================================
   CARRITO DE COMPRA
   ============================================ */

/* Botón del carrito en el header */
.carrito-header {
    position: relative;
    display: inline-block;
}

.carrito-icono {
    font-size: 1.5rem;
    text-decoration: none;
    color: white;
    position: relative;
}

.carrito-contador {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Carrito lateral */
.carrito-lateral {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    z-index: 9999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.carrito-lateral.activo {
    right: 0;
}

.carrito-lateral-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    background: #2c3e50;
    color: white;
}

.carrito-lateral-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.carrito-cerrar {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.carrito-lateral-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.carrito-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.carrito-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.carrito-item-info {
    flex: 1;
}

.carrito-item-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.carrito-item-info .precio {
    color: #e74c3c;
    font-weight: bold;
}

.carrito-item-cantidad {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.carrito-item-cantidad input {
    width: 50px;
    padding: 0.2rem;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.carrito-item-eliminar {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2rem;
}

.carrito-lateral-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.carrito-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.carrito-vacio {
    text-align: center;
    padding: 2rem;
    color: #999;
}

/* Página del carrito completo */
.carrito-pagina {
    max-width: 900px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.carrito-tabla {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.carrito-tabla th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid #2c3e50;
    color: #2c3e50;
}

.carrito-tabla td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.carrito-tabla img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.carrito-resumen {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.carrito-resumen-linea {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.carrito-resumen-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: bold;
    border-top: 2px solid #2c3e50;
    padding-top: 1rem;
    margin-top: 1rem;
}

/* Botones */
.btn-carrito {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-carrito:hover {
    background: #2980b9;
}

.btn-carrito-verde {
    background: #27ae60;
}

.btn-carrito-verde:hover {
    background: #219150;
}

.btn-carrito-rojo {
    background: #e74c3c;
}

.btn-carrito-rojo:hover {
    background: #c0392b;
}

.btn-carrito-secundario {
    background: #95a5a6;
}

.btn-carrito-secundario:hover {
    background: #7f8c8d;
}

/* Responsive */
@media (max-width: 768px) {
    .carrito-lateral {
        width: 100%;
        right: -100%;
    }
    
    .carrito-tabla {
        font-size: 0.9rem;
    }
    
    .carrito-tabla th,
    .carrito-tabla td {
        padding: 0.5rem;
    }
    
    .carrito-tabla img {
        width: 50px;
        height: 50px;
    }
}
