* {
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f4f4f9;
    color: #333;
}

/* =========================================
   ENCABEZADO Y LOGO
========================================= */
header {
    background-color: #009ee3; /* Color MercadoPago */
    color: white;
    padding: 1.5rem 1rem 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.contenedor-logo {
    display: inline-block;
}

.contenedor-logo svg {
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
    max-width: 100%; /* Evita que el logo desborde en pantallas muy pequeñas */
    height: auto;
}

/* =========================================
   CONTENEDOR PRINCIPAL (MÓVIL POR DEFECTO)
========================================= */
.contenedor-principal {
    display: flex;
    flex-direction: column; /* Apila productos y carrito verticalmente en móviles */
    max-width: 1000px;
    margin: 1.5rem auto;
    gap: 2rem;
    padding: 0 1rem;
}

/* =========================================
   PRODUCTOS
========================================= */
.productos {
    display: grid;
    /* En celulares muestra 2 columnas adaptables */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

h2 {
    grid-column: 1 / -1;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    text-align: center;
}

.card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.card p {
    font-weight: bold;
    color: #009ee3;
    font-size: 1.1rem;
}
/* Estilo para las imágenes de los productos */
.imagen-producto {
    width: 100%;
    height: 140px; /* Altura fija para que todas las tarjetas midan igual */
    object-fit: contain; /* Evita que la imagen se deforme o se corte */
    margin-bottom: 1rem;
    border-radius: 4px;
}

/* Botones optimizados para pulgares (táctiles) */
.card button {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 0.8rem 1rem;
    margin-top: 1rem;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    font-size: 1rem;
}

.card button:active {
    transform: scale(0.98);
}

/* =========================================
   CARRITO DE COMPRAS
========================================= */
.carrito {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#items-carrito {
    list-style: none;
    margin: 1rem 0;
}

#items-carrito li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.7rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.btn-quitar {
    background-color: #ff4c4c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px; /* Más grande para que sea fácil de tocar */
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
}

.total-container {
    font-size: 1.3rem;
    margin: 1rem 0 1.5rem;
    text-align: center;
    color: #333;
    background-color: #f9f9f9;
    padding: 1rem;
    border-radius: 6px;
}

#btn-comprar {
    background-color: #009ee3;
    color: white;
    border: none;
    padding: 1.2rem; /* Botón de compra amplio */
    width: 100%;
    font-size: 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

#btn-comprar:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* =========================================
   SECCIÓN DE PAGO (MERCADOPAGO)
========================================= */
.oculto {
    display: none;
}

#seccion-pago {
    margin-top: 1.5rem;
    padding: 1.5rem 1rem;
    background-color: #e6f7ff;
    border-left: 4px solid #009ee3;
    border-radius: 4px;
    text-align: center;
}

.btn-mercadopago {
    display: block;
    background-color: #009ee3;
    color: white;
    text-align: center;
    text-decoration: none;
    padding: 1.2rem;
    margin-top: 1rem;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.1rem;
}

/* =========================================
   ADAPTACIÓN PARA COMPUTADORAS (ESCRITORIO)
========================================= */
@media (min-width: 768px) {
    .contenedor-principal {
        flex-direction: row; /* Coloca productos y carrito lado a lado */
        align-items: flex-start;
    }

    .productos {
        flex: 2;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .carrito {
        flex: 1;
        position: sticky;
        top: 2rem; /* El carrito se queda fijo al hacer scroll en PC */
    }
}

/* Botón de pago MODO */
.btn-modo {
    display: block;
    background-color: #00b27a; /* Color verde estilo MODO */
    color: white;
    text-align: center;
    text-decoration: none;
    padding: 1.2rem;
    margin-top: 1rem;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.1rem;
}