/*  ============================
    🛒 ESTILOS DEL CARRITO
    ============================ */

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
}

header,
nav.main-nav {
    background-color: #000000;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

nav.main-nav a {
    color: #fff;
    text-decoration: none;
    margin: 0 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav.main-nav a:hover {
    color: #ffca28;
}

/* ====== Contenedor general del carrito ====== */
.container {
    max-width: 1200px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    /* margin: 3rem auto; */
    margin: 4rem;
}

/* ====== Layout de dos columnas ====== */
.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* ====== Columna de productos ====== */
.cart-products {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ====== Mensaje de carrito vacío ====== */
#cartContainer p {
    text-align: center;
    font-size: 1rem;
    color: #666;
    /* margin: 3rem 0; */
    font-weight: 500;
}

/* ====== Columna del resumen ====== */
.cart-summary {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.summary-card {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.summary-card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.3rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: #666;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 1.5rem;
}

hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 1rem 0;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #545b62;
}

/* ====== Título ====== */
.container h1 {
    text-align: center;
    color: #222;
    font-size: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.container h1 .material-symbols-outlined {
    font-size: 2.5rem;
    color: #007bff;
}

/* ====== Área del carrito ====== */
#cartArea {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ====== Cada producto en el carrito ====== */
.cart-item {
    display: flex;
    align-items: center;
    background-color: #fafafa;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
    margin-bottom: 2%;
}

.cart-item:hover {
    transform: scale(1.02);
}

/* Imagen del producto */
.cart-item img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    margin-right: 15px;
    object-fit: contain;
    flex-shrink: 0;
    background-color: #ffffff;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
}

/* Información del producto */
.cart-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-info h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.cart-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

/* Controles del carrito */
.cart-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.cart-controls button {
    border: none;
    background-color: #ffca28;
    color: #222;
    font-weight: bold;
    border-radius: 6px;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 32px;
    height: 32px;
}

.cart-controls button:hover {
    background-color: #ffd95e;
}

.cart-controls .qty {
    font-weight: bold;
    padding: 0.3rem 0.5rem;
    background-color: #f0f0f0;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
}

/* ====== Pie del carrito ====== */
#cartFooter {
    margin-top: 2rem;
    text-align: center;
    border-top: 2px solid #eee;
    padding-top: 1rem;
}

#cartFooter h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

#clearCart {
    background-color: #e53935;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#clearCart:hover {
    background-color: #ff5252;
}