:root {
    --azul: #102c59;
    --azul-oscuro: #0a1e3e;
    --verde: #168447;
    --amarillo: #ffc928;
    --texto: #202938;
    --gris: #687385;
    --fondo: #f5f7fb;
    --borde: #e4e9f1;
    --rojo-oferta: #c62828;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 85px;
}

body {
    margin: 0;
    color: var(--texto);
    background: var(--fondo);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.contenedor {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.barra-superior {
    padding: 7px 0;
    color: white;
    background: var(--azul-oscuro);
    font-size: 11px;
}

.barra-superior .contenedor {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.encabezado {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--borde);
    background: white;
}

.encabezado-interior {
    min-height: 66px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.marca {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.marca-icono {
    width: 40px;
    height: 40px;
    display: grid;
    flex-shrink: 0;
    place-items: center;
    border-radius: 10px;
    color: white;
    background: var(--azul);
    font-size: 21px;
}

.marca strong {
    display: block;
    color: var(--azul);
    font-size: 18px;
    overflow-wrap: anywhere;
}

.marca small {
    display: block;
    color: var(--gris);
    font-size: 10px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 12px;
    font-weight: 800;
}

.nav a:hover {
    color: var(--verde);
}

.boton-nav {
    padding: 10px 13px;
    border-radius: 8px;
    color: var(--azul-oscuro);
    background: var(--amarillo);
}

.hero {
    padding: 27px 0 22px;
    color: white;
    background:
        radial-gradient(
            circle at 90% 15%,
            rgba(255,201,40,.15),
            transparent 30%
        ),
        linear-gradient(120deg, var(--azul-oscuro), #194579);
}

.hero-interior {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
}

.hero-contenido {
    max-width: 680px;
}

.etiqueta-hero {
    display: inline-block;
    padding: 5px 9px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 30px;
    color: #ffdf73;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.hero h1 {
    margin: 12px 0 8px;
    font-size: clamp(27px, 4vw, 39px);
    line-height: 1.12;
    letter-spacing: -.7px;
}

.hero h1 span {
    color: var(--amarillo);
}

.hero p {
    max-width: 590px;
    margin: 0;
    color: rgba(255,255,255,.84);
    font-size: 13px;
    line-height: 1.7;
}

.boton-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--azul-oscuro);
    background: var(--amarillo);
    font-size: 12px;
    font-weight: 800;
}

.hero-icono {
    flex-shrink: 0;
    font-size: 65px;
}

.seccion {
    padding: 27px 0 10px;
}

.seccion-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 15px;
    margin-bottom: 16px;
}

.seccion-cabecera small {
    color: var(--verde);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.seccion-cabecera h2 {
    margin: 4px 0;
    color: var(--azul);
    font-size: clamp(22px, 3vw, 28px);
    line-height: 1.2;
}

.seccion-cabecera p {
    margin: 0;
    color: var(--gris);
    font-size: 12px;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.producto-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--borde);
    border-radius: 12px;
    background: white;
    transition: border-color .2s, box-shadow .2s;
}

.producto-card:hover {
    box-shadow: 0 5px 18px rgba(16,44,89,.07);
}

.producto-card.seleccionado {
    border: 2px solid var(--verde);
}

.producto-card.producto-en-oferta {
    border-color: #f0c6c6;
}

.producto-card.producto-en-oferta:hover {
    box-shadow: 0 5px 18px rgba(198,40,40,.09);
}

.etiqueta-oferta {
    position: absolute;
    top: 9px;
    left: 9px;
    z-index: 2;
    padding: 6px 9px;
    border-radius: 6px;
    color: white;
    background: var(--rojo-oferta);
    font-size: 10px;
    font-weight: 900;
    box-shadow: 0 2px 7px rgba(0,0,0,.15);
}

.producto-imagen {
    height: 125px;
    overflow: hidden;
    background: #f0f3f8;
}

.producto-imagen img {
    width: 100%;
    height: 100%;
    display: block;
    padding: 9px;
    object-fit: contain;
}

.sin-imagen {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #8290a5;
    font-size: 34px;
}

.producto-contenido {
    padding: 12px;
}

.categoria {
    display: block;
    margin-bottom: 4px;
    color: #53719c;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.producto-contenido h3 {
    min-height: 36px;
    margin: 0 0 5px;
    color: var(--azul);
    font-size: 13px;
    line-height: 1.4;
}

.descripcion {
    margin: 0 0 9px;
    color: var(--gris);
    font-size: 10px;
    line-height: 1.5;
}

.precios {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.precio-caja {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px;
    border-radius: 7px;
}

.precio-caja span {
    color: var(--gris);
    font-size: 9px;
}

.precio-caja strong {
    margin: 2px 0;
    font-size: 16px;
    overflow-wrap: anywhere;
}

.precio-caja small {
    color: var(--gris);
    font-size: 9px;
}

.minorista {
    background: #f1f4f9;
}

.minorista strong {
    color: var(--azul);
}

.mayorista {
    border: 1px solid #d5ebdd;
    background: #effaf3;
}

.mayorista strong {
    color: var(--verde);
}

.precio-anterior {
    display: block;
    margin: 3px 0;
    color: #7a8493;
    font-size: 12px;
    line-height: 1.3;
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

.precio-caja .precio-promocional {
    display: block;
    margin: 2px 0;
    color: var(--rojo-oferta);
    font-size: clamp(15px, 1.6vw, 20px);
    font-weight: 900;
    line-height: 1.2;
}

.mayorista .precio-promocional {
    color: #116c39;
}

.precio-caja .texto-ahorro {
    color: var(--rojo-oferta);
    font-weight: 800;
}

.seleccionar-producto {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    padding: 6px 0;
    color: var(--azul);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.seleccionar-producto input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--verde);
    cursor: pointer;
}

.cantidad-contenedor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 7px;
    border-top: 1px solid var(--borde);
    color: var(--gris);
    font-size: 11px;
}

.cantidad-control {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--borde);
    border-radius: 7px;
}

.cantidad-control button {
    width: 29px;
    height: 30px;
    border: 0;
    color: var(--azul);
    background: #f3f6fa;
    font-size: 17px;
}

.cantidad-control input {
    width: 36px;
    height: 30px;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--azul);
    background: white;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    appearance: textfield;
    -moz-appearance: textfield;
}

.cantidad-control input::-webkit-inner-spin-button,
.cantidad-control input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.subtotal-producto {
    min-height: 25px;
    margin-top: 7px;
    color: var(--gris);
    font-size: 10px;
    line-height: 1.5;
}

.producto-card.seleccionado .subtotal-producto {
    color: var(--verde);
    font-weight: 800;
}

.sin-productos {
    padding: 18px;
    border: 1px dashed #cbd5e3;
    border-radius: 10px;
    color: var(--gris);
    background: white;
    text-align: center;
    font-size: 12px;
}

/* MI PEDIDO */

.pedido-seccion {
    padding: 30px 0;
    margin-top: 22px;
    background: #edf2f8;
}

.pedido-panel {
    padding: 20px;
    border: 1px solid var(--borde);
    border-radius: 13px;
    background: white;
}

.pedido-panel h2 {
    margin: 0 0 4px;
    color: var(--azul);
    font-size: 23px;
}

.pedido-intro {
    margin: 0 0 15px;
    color: var(--gris);
    font-size: 12px;
}

.pedido-vacio {
    padding: 13px;
    border-radius: 8px;
    color: var(--gris);
    background: #f5f7fb;
    font-size: 12px;
}

.pedido-lista {
    display: grid;
    gap: 7px;
    margin: 12px 0;
}

.pedido-linea {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--borde);
    font-size: 12px;
}

.pedido-linea span:first-child {
    overflow-wrap: anywhere;
}

.pedido-linea strong {
    white-space: nowrap;
}

.pedido-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 2px solid var(--borde);
}

.pedido-total span {
    color: var(--azul);
    font-weight: 800;
}

.pedido-total strong {
    color: var(--azul);
    font-size: 25px;
}

/* SELECTOR DE LOCALIDAD */

.localidad-pedido {
    margin: 17px 0 0;
    padding: 15px;
    border: 1px solid #d7e1ef;
    border-radius: 10px;
    background: #f7f9fc;
}

.localidad-pedido label {
    display: block;
    margin-bottom: 7px;
    color: var(--azul);
    font-size: 13px;
    font-weight: 900;
}

.localidad-pedido select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cbd5e3;
    border-radius: 8px;
    outline: none;
    color: var(--azul);
    background: white;
    font-size: 14px;
}

.localidad-pedido select:focus {
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(22,132,71,.10);
}

.estado-localidad {
    display: block;
    margin-top: 8px;
    color: var(--gris);
    font-size: 11px;
    line-height: 1.5;
}

.estado-localidad.correcto {
    color: var(--verde);
    font-weight: 800;
}

.estado-localidad.error {
    color: #b42318;
    font-weight: 800;
}

.botones-tipo-pedido {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.boton-tipo-pedido {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 76px;
    padding: 13px;
    border: 0;
    border-radius: 9px;
    color: white;
    background: var(--verde);
    font-size: 13px;
    font-weight: 900;
    text-align: center;
    transition: filter .2s, transform .2s;
}

.boton-tipo-pedido:hover {
    filter: brightness(.94);
    transform: translateY(-1px);
}

.boton-tipo-pedido:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.boton-tipo-pedido.retiro {
    border: 2px solid #e4a900;
    color: var(--azul-oscuro);
    background: var(--amarillo);
}

.boton-tipo-pedido .promocion-retiro {
    display: block;
    font-size: 11px;
    font-weight: 900;
}

.aviso {
    margin: 10px 0 0;
    color: var(--gris);
    font-size: 10px;
    line-height: 1.6;
}

footer {
    padding: 16px 0;
    color: rgba(255,255,255,.85);
    background: var(--azul-oscuro);
    font-size: 11px;
}

.footer-interior {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

footer strong {
    color: white;
}

/* DISEÑO RESPONSIVE */

@media (max-width: 900px) {
    .productos-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .contenedor {
        width: calc(100% - 22px);
    }

    .barra-superior .contenedor {
        justify-content: center;
        text-align: center;
    }

    .barra-superior .contenedor span {
        display: none;
    }

    .encabezado-interior {
        min-height: 61px;
        gap: 7px;
    }

    .marca {
        gap: 7px;
    }

    .marca-icono {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }

    .marca strong {
        font-size: 14px;
    }

    .marca small {
        font-size: 9px;
    }

    .nav {
        gap: 7px;
    }

    .nav a:not(.boton-nav) {
        display: none;
    }

    .boton-nav {
        padding: 9px;
        font-size: 10px;
    }

    .hero {
        padding: 22px 0;
    }

    .hero-interior {
        gap: 10px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 11px;
    }

    .hero-icono {
        font-size: 39px;
    }

    .boton-hero {
        margin-top: 11px;
        padding: 9px 11px;
        font-size: 10px;
    }

    .seccion {
        padding-top: 22px;
    }

    .seccion-cabecera {
        margin-bottom: 12px;
    }

    .seccion-cabecera h2 {
        font-size: 22px;
    }

    .seccion-cabecera p {
        font-size: 11px;
    }

    .productos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .producto-imagen {
        height: 105px;
    }

    .producto-contenido {
        padding: 9px;
    }

    .producto-contenido h3 {
        min-height: 34px;
        font-size: 12px;
    }

    .descripcion {
        font-size: 9px;
    }

    .precios {
        gap: 5px;
    }

    .precio-caja {
        padding: 6px;
    }

    .precio-caja span,
    .precio-caja small {
        font-size: 8px;
    }

    .precio-caja strong {
        font-size: 13px;
    }

    .precio-caja .precio-promocional {
        font-size: 15px;
    }

    .precio-anterior {
        font-size: 10px;
    }

    .etiqueta-oferta {
        top: 6px;
        left: 6px;
        padding: 5px 7px;
        font-size: 9px;
    }

    .seleccionar-producto {
        gap: 5px;
        font-size: 10px;
    }

    .cantidad-contenedor {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .cantidad-control {
        align-self: stretch;
        justify-content: space-between;
    }

    .cantidad-control input {
        flex: 1;
        min-width: 20px;
    }

    .cantidad-control button {
        flex-shrink: 0;
    }

    .subtotal-producto {
        font-size: 9px;
    }

    .pedido-seccion {
        padding: 22px 0;
        margin-top: 17px;
    }

    .pedido-panel {
        padding: 14px;
    }

    .pedido-panel h2 {
        font-size: 21px;
    }

    .pedido-total strong {
        font-size: 22px;
    }

    .botones-tipo-pedido {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .boton-tipo-pedido {
        min-height: 65px;
    }

    .localidad-pedido {
        padding: 12px;
    }
}

@media (max-width: 350px) {
    .hero-icono {
        display: none;
    }

    .productos-grid {
        grid-template-columns: 1fr;
    }

    .producto-imagen {
        height: 155px;
    }

    .producto-contenido {
        padding: 12px;
    }

    .producto-contenido h3 {
        min-height: 0;
    }

    .cantidad-contenedor {
        align-items: center;
        flex-direction: row;
    }
}