body
{
    margin: 0;
    background-color: #e7ebf3;
    font-family: 'Noto Sans', sans-serif;
}
main
{
    display: flex;
    flex-direction: row;
}
.barra_inicio
{
    background-color: #16366d;
}
.barimage img
{
    transition: 0.5s;
    margin-left: 25px;
    margin-top: 10px;
    width: 200px;
    height: 80px;
}
.barimage img:hover
{
    transition: 0.5s;
    filter: drop-shadow(0 0 5px rgb(250, 250, 250));
}
.productcontainer
{
    background-color: white;
    border-radius: 12px;
    margin: 10px;
    width: 50em;
    min-height: 400px;
}
.product
{
    display: flex;
    padding: 20px;
    border-bottom: 1px solid #e7ebf3;
}
.product:last-child {
    border-bottom: none;
}
#termo
{
  width: 200px;
  height: 200px;
}
.divisor
{
    background-color: rgb(217, 218, 228);
    height: 11em;
    width: 1.5px;
    margin-top: 12px;
    border-radius: 1em;
}
.productcaracteristic
{
    text-align: center;
    margin-left: 8em;
    flex: 1;
}
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.quantity-btn {
    background: #16366d;
    color: white;
    border: none;
    border-radius: 5px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background 0.3s;
}

.quantity-btn:hover {
    background: #0b1c38;
}

.quantity-value {
    font-size: 1.2em;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    margin-left: 10px;
    transition: background 0.3s;
}

.remove-btn:hover {
    background: #c82333;
}

.checkout
{
    height: 25em;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-right: 10px;
    display: flex;
    flex-direction: column;
    width: 35em;
    background-color: white;
    border-radius: 12px;
}
.cart
{
    margin-left: 4em;
}
.cantidad
{
    text-align: center;
}
.divcheck
{
    background-color: rgb(217, 218, 228);
    height: 1.5px;
    width: 30em;
    margin-left: 2em;
    border-radius: 1em;
}
.total
{
    text-align: center;
}
.pay,
.continue
{
    margin-top: 0.5em;
}
.continue
{
    margin-left: 8em;
    height: 3.5em;
    width: 24em;
    background-color: #486597;
    border: none;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 10px;
    color: white;
}
.continue:hover
{
    transition: 0.3s;
    transform: scale(1.1);
}
.back
{
    text-decoration: none;
}
.pay
{
    margin-left: 8em;
    height: 3.5em;
    width: 24em;
    background-color: #486597;
    border: none;
    color: white;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 10px;
}
.pay:hover
{
    transition: 0.3s;
    transform: scale(1.1);
}

/* ========================================================================= */
/* MEDIA QUERIES - RESPONSIVE */
/* ========================================================================= */

@media screen and (max-width: 768px) 
{
    /* --- ESTRUCTURA BÁSICA --- */
    html, body {
        overflow-x: hidden; 
        width: 100%;
    }
    
    /* --- ENCABEZADO (barra_inicio) --- */
    .barra_inicio {
        display: flex;
        justify-content: center;
    }

    .barimage img {
        margin-left: auto;
        margin-right: auto;
        width: 150px;
        height: 60px;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    /* --- CONTENIDO PRINCIPAL (main) --- */
    main {
        flex-direction: column; 
        align-items: center;
        padding: 5px;
        width: 100%;
    }

    .productcontainer,
    .checkout {
        width: 95%;
        flex-grow: 0;
        flex-shrink: 0;
        margin: 10px auto;
    }
    
    .productcontainer {
        min-height: 300px;
    }
    
    .checkout {
        height: auto;
        padding-bottom: 20px;
        order: -1;
    }
    
    /* --- PRODUCTOS INDIVIDUALES (.product) --- */
    .product {
        flex-direction: column;
        align-items: center;
        padding: 15px 10px;
        border-bottom: 1px solid #e7ebf3;
    }
    
    .product:last-child {
        border-bottom: none;
    }
    
    #termo {
        width: 150px;
        height: 150px;
        margin-bottom: 10px;
    }
    
    .divisor {
        display: none;
    }
    
    .productcaracteristic {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
    
    /* --- CONTROLES DE CANTIDAD EN MÓVIL --- */
    .quantity-controls {
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 12px;
    }
    
    .quantity-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2em;
    }
    
    .quantity-value {
        font-size: 1.3em;
        min-width: 40px;
    }
    
    .remove-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
        padding: 10px;
        font-size: 1em;
    }
    
    /* --- CHECKOUT Y BOTONES --- */
    .cart {
        margin-left: 0;
        text-align: center;
    }
    
    .divcheck {
        width: 90%;
        margin-left: 5%;
    }

    .pay {
        margin-left: auto;
        margin-right: auto;
        display: block;
        width: 90%;
        max-width: 300px;
        height: 3em;
        margin-top: 15px; /* Más espacio arriba */
    }
    
    /* --- QUITAR BOTÓN "SEGUIR COMPRANDO" EN MÓVIL --- */
    .back,
    .continue {
        display: none !important;
    }
    
    /* --- MEJORAS ESPECÍFICAS PARA EL MENSAJE DE CARRITO VACÍO --- */
    .carrito-vacio-container {
        padding: 20px 15px !important;
    }
    
    .carrito-vacio-content {
        max-width: 100% !important;
    }
}

/* Estilos para tablets (768px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    main {
        flex-direction: column;
        align-items: center;
    }
    
    .productcontainer,
    .checkout {
        width: 90%;
        margin: 15px auto;
    }
    
    .productcontainer {
        width: 100%;
        max-width: 600px;
    }
    
    .checkout {
        width: 100%;
        max-width: 600px;
    }
    
    .pay,
    .continue {
        margin-left: auto;
        margin-right: auto;
        width: 80%;
    }
}