/* Contenedor del carrito */
.cart-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Estilos responsivos para la tabla */
@media screen and (max-width: 768px) {
    /* Convertir tabla en bloques para móvil */
    .cart-table,
    .cart-table thead,
    .cart-table tbody,
    .cart-table tr,
    .cart-table td {
        display: block;
    }
    
    /* Ocultar encabezados en móvil */
    .cart-table thead {
        display: none;
    }
    
    /* Estilo de cada fila como tarjeta */
    .cart-table tr {
        margin-bottom: 1.5rem;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 1rem;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* Estilo de celdas en móvil */
    .cart-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.8rem 0;
        border-bottom: 1px solid #eee;
        text-align: right;
    }
    
    .cart-table td:last-child {
        border-bottom: none;
    }
    
    /* Agregar etiquetas antes del contenido */
    .cart-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        margin-right: 1rem;
    }
    
    /* Ajustar formularios en móvil */
    .cart-table td form {
        display: flex;
        gap: 0.5rem;
        width: 100%;
        justify-content: flex-end;
    }
    
    /* Input de cantidad en móvil */
    .cart-table input[type="number"] {
        width: 70px;
        padding: 0.5rem;
    }
    
    /* Botón actualizar en móvil */
    .cart-table td button[type="submit"]:not(.btn-remove) {
        padding: 0.5rem 1rem;
        background: #28a745;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }
    
    /* Fila del total en móvil */
    .cart-table tfoot tr {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f8f9fa;
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .cart-table tfoot td {
        border: none;
        padding: 0;
    }
    
    .cart-table tfoot td::before {
        display: none;
    }
}

/* Tablets y pantallas medianas */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .cart-table {
        font-size: 0.9rem;
    }
    
    .cart-table th,
    .cart-table td {
        padding: 0.6rem;
    }
    
    .cart-table input[type="number"] {
        width: 50px;
    }
}

/* Estilos base */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.cart-table th,
.cart-table td {
    padding: 0.8rem;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.cart-table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* Input de cantidad */
.cart-table input[type="number"] {
    width: 60px;
    padding: 0.3rem;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Botón eliminar */
.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn-remove:hover {
    background: #c82333;
}

/* Acciones del carrito */
.cart-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Botones */
.btn-continue,
.btn-checkout {
    padding: 0.7rem 1.2rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
}

/* Seguir comprando */
.btn-continue {
    background: #eee;
    color: #333;
}

.btn-continue:hover {
    background: #ddd;
}

/* Proceder al pago */
.btn-checkout {
    background: #28a745;
    color: white;
}

.btn-checkout:hover {
    background: #218838;
}

/* Ajustes responsivos para acciones */
@media screen and (max-width: 480px) {
    .cart-actions {
        flex-direction: column;
    }
    
    .btn-continue,
    .btn-checkout {
        width: 100%;
    }
    
    .cart-container h1 {
        font-size: 1.5rem;
    }
}