/* Galería y tarjetas del catálogo médico */

.productos {
    align-items: start;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.tarjeta {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.galeria-producto {
    padding: 12px;
    background: #f4f7f8;
}

.galeria-producto .imagen-producto {
    display: grid;
    width: 100%;
    min-height: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    place-items: center;
    border-radius: 4px;
    background: white;
}

.galeria-producto .foto-producto {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.miniaturas {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}

.miniatura {
    width: 100%;
    padding: 2px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 2px solid transparent;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.miniatura:hover,
.miniatura.activa {
    border-color: var(--verde);
}

.miniatura img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.datos-producto {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.datos-producto p {
    margin-top: 0;
}

.sku {
    color: #71818a;
    font-size: 0.78rem;
    white-space: nowrap;
}

.descripcion-producto {
    min-height: 66px;
    color: #526671;
    line-height: 1.45;
}

.precio-consultar {
    color: var(--azul);
}

.por-confirmar {
    color: #9a6a11;
    font-weight: bold;
}

.variantes {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #dce4e7;
}

.variantes p {
    margin: 7px 0 0;
    color: #526671;
}

.acciones-producto {
    margin-top: 20px;
}

.boton-ficha {
    display: block;
    padding: 12px 15px;
    border: 1px solid var(--azul);
    border-radius: 5px;
    color: var(--azul);
    font-weight: bold;
    text-align: center;
    text-decoration: none;
}

.boton-ficha:hover {
    background: var(--azul);
    color: white;
}

@media (max-width: 520px) {
    .productos {
        grid-template-columns: 1fr;
    }

    .miniaturas {
        grid-template-columns: repeat(6, minmax(38px, 1fr));
        overflow-x: auto;
    }

    .descripcion-producto {
        min-height: 0;
    }
}

/* Categorías médicas */

.categorias-medicas {
    grid-template-columns: repeat(4, 1fr);
}

.categorias-medicas .categoria-visual {
    min-height: 240px;
}
.categorias-medicas .categoria-visual span {
    box-sizing: border-box;
    width: 100%;
    padding-inline: 10px;
    font-size: clamp(1.15rem, 2.2vw, 1.7rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .categorias-medicas {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .categorias-medicas {
        grid-template-columns: 1fr;
    }
}
/* Mantener tamaño uniforme aunque el filtro muestre pocos productos */

.productos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .productos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .productos {
        grid-template-columns: 1fr;
    }
}

/* Encabezado profesional */

.barra {
    min-height: 88px;
    padding: 12px max(5%, calc((100% - 1200px) / 2));
    border-top: 4px solid var(--azul);
}

.marca-logo {
    width: 72px;
    height: 64px;
}

.marca strong {
    color: var(--azul-oscuro);
    font-size: 1.3rem;
}

.menu a {
    position: relative;
    font-weight: 600;
}

.menu > a:not(.menu-contacto)::after {
    position: absolute;
    right: 0;
    bottom: -7px;
    left: 0;
    height: 2px;
    background: var(--verde);
    content: "";
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.menu > a:not(.menu-contacto):hover::after {
    transform: scaleX(1);
}

.menu .menu-contacto {
    padding: 12px 18px;
    border-radius: 5px;
    background: var(--verde);
    color: #17330b;
    font-weight: bold;
}

.menu .menu-contacto:hover {
    background: #8ad835;
    color: #17330b;
}

@media (max-width: 800px) {
    .menu .menu-contacto {
        width: 100%;
        text-align: center;
    }
}
/* Portada principal */

.hero {
    min-height: 620px;
    padding: 80px max(6%, calc((100% - 1200px) / 2));
    background:
        linear-gradient(
            90deg,
            rgb(5 32 46 / 88%) 0%,
            rgb(5 32 46 / 68%) 48%,
            rgb(5 32 46 / 18%) 100%
        ),
        url("../img/portada.jpg") center / cover no-repeat;
}

.hero-contenido h1 {
    max-width: 760px;
    margin-bottom: 22px;
    font-size: clamp(2.8rem, 6vw, 5rem);
}

.hero-descripcion {
    max-width: 680px;
    margin-bottom: 28px;
    font-size: 1.2rem;
    line-height: 1.65;
}

.hero-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-acciones .boton-principal,
.boton-secundario {
    margin-top: 0;
    padding: 16px 24px;
}

.boton-secundario {
    display: inline-block;
    border: 2px solid white;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    text-decoration: none;
}

.boton-secundario:hover {
    background: white;
    color: var(--azul-oscuro);
}

.hero-beneficios {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 35px;
}

.hero-beneficios span {
    padding: 9px 13px;
    border: 1px solid rgb(255 255 255 / 40%);
    border-radius: 30px;
    background: rgb(255 255 255 / 12%);
    color: white;
    font-size: 0.9rem;
    backdrop-filter: blur(4px);
}

.hero-beneficios span::before {
    margin-right: 7px;
    color: var(--verde);
    content: "✓";
    font-weight: bold;
}

@media (max-width: 620px) {
    .hero {
        min-height: 570px;
        padding-top: 65px;
        padding-bottom: 65px;
        background-position: 58% center;
    }

    .hero-contenido h1 {
        font-size: 2.6rem;
    }

    .hero-acciones {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-acciones a {
        text-align: center;
    }

    .hero-beneficios {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Tipografía más suave y moderna */

body {
    font-family:
        "Segoe UI",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
}

h1,
h2,
h3,
.marca strong,
.boton-principal,
.boton-secundario,
.menu-contacto {
    letter-spacing: -0.02em;
}

p {
    line-height: 1.6;
}
/* Sucursales y contacto */

.contacto-profesional {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 35px 55px;
    padding: 70px max(6%, calc((100% - 1200px) / 2));
    background:
        linear-gradient(135deg, #082f45, #0b506d);
}

.contacto-introduccion {
    max-width: 520px;
}

.contacto-introduccion h2 {
    margin: 8px 0 18px;
}

.contacto-introduccion p:last-child {
    color: #d7e4e9;
}

.sucursales {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.sucursal {
    padding: 24px;
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: 8px;
    background: rgb(255 255 255 / 9%);
}

.sucursal span {
    color: var(--verde);
    font-size: 0.82rem;
    font-weight: bold;
    text-transform: uppercase;
}

.sucursal h3 {
    margin: 8px 0;
    font-size: 1.25rem;
}

.sucursal p {
    margin-bottom: 0;
    color: #d7e4e9;
}

.contacto-boton {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 0;
}

@media (max-width: 800px) {
    .contacto-profesional {
        grid-template-columns: 1fr;
    }

    .contacto-boton {
        grid-column: auto;
    }
}

@media (max-width: 520px) {
    .sucursales {
        grid-template-columns: 1fr;
    }

    .contacto-boton {
        width: 100%;
        text-align: center;
    }
}
/* Botón flotante de contacto */

.whatsapp-flotante {
    display: flex;
    width: auto;
    height: 56px;
    padding: 0 18px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 30px;
    background: #25d366;
    color: #083a1c;
    font-weight: 700;
    white-space: nowrap;
}

.whatsapp-icono {
    font-size: 1.45rem;
    line-height: 1;
}

.whatsapp-texto {
    font-size: 0.95rem;
}

.whatsapp-flotante:hover {
    background: #3be477;
    transform: translateY(-2px);
}

@media (max-width: 520px) {
    .whatsapp-flotante {
        width: 56px;
        padding: 0;
    }

    .whatsapp-texto {
        display: none;
    }
}
/* Aviso exclusivo del modo de vista previa */

.aviso-vista-previa {
    position: relative;
    z-index: 50;
    padding: 11px 20px;
    border-bottom: 2px solid #9a6a11;
    background: #ffd766;
    color: #3f3100;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
}
/* MEJORA-ALVIL-CHAT-20260806 */
.whatsapp-flotante {
    overflow: visible;
}

.whatsapp-mensaje {
    position: absolute;
    right: calc(100% + 14px);
    bottom: 0;
    display: flex;
    width: 220px;
    flex-direction: column;
    gap: 2px;
    padding: 11px 14px;
    border: 1px solid rgba(15, 62, 92, 0.14);
    border-radius: 14px;
    background: #ffffff;
    color: #14324a;
    box-shadow: 0 10px 28px rgba(15, 62, 92, 0.2);
    line-height: 1.25;
    pointer-events: none;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.whatsapp-mensaje::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: 18px;
    width: 13px;
    height: 13px;
    border-top: 1px solid rgba(15, 62, 92, 0.12);
    border-right: 1px solid rgba(15, 62, 92, 0.12);
    background: #ffffff;
    transform: rotate(45deg);
}

.whatsapp-mensaje strong {
    color: #0f5132;
    font-size: 0.92rem;
}

.whatsapp-mensaje small {
    color: #526878;
    font-size: 0.78rem;
}

.whatsapp-flotante:hover .whatsapp-mensaje,
.whatsapp-flotante:focus-visible .whatsapp-mensaje {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(15, 62, 92, 0.25);
}

@media (max-width: 640px) {
    .whatsapp-mensaje {
        right: calc(100% + 9px);
        width: 176px;
        padding: 9px 11px;
    }

    .whatsapp-mensaje strong {
        font-size: 0.82rem;
    }

    .whatsapp-mensaje small {
        font-size: 0.7rem;
    }
}
/* MEJORA-ALVIL-CATEGORIAS-20260806 */
.grupo-categoria {
    grid-column: 1 / -1;
    width: 100%;
    margin: 8px 0 30px;
}

.encabezado-categoria {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dcebf2;
}

.encabezado-categoria h3 {
    margin: 0;
    color: #123e5a;
    font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.contador-categoria {
    flex: 0 0 auto;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e8f5ef;
    color: #17613c;
    font-size: 0.8rem;
    font-weight: 700;
}

.productos-categoria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 24px;
}

@media (max-width: 640px) {
    .grupo-categoria {
        margin-bottom: 24px;
    }

    .encabezado-categoria {
        align-items: flex-start;
        gap: 10px;
    }

    .productos-categoria {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}


/* WHATSAPP-CIRCULAR-20260807 */
.whatsapp-flotante {
    display: flex;
    width: 64px;
    height: 64px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #25d366;
    color: #ffffff;
}

.whatsapp-icono {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    font-size: 2rem;
    line-height: 1;
}

.whatsapp-texto {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Catálogo enfocado: la portada permanece intacta hasta elegir categoría */
body.modo-catalogo #inicio,
body.modo-catalogo #categorias,
body.modo-catalogo .linea-mochilas-destacada,
body.modo-catalogo #contacto {
    display: none;
}

body.modo-catalogo #catalogo {
    min-height: calc(100vh - 88px);
    padding-top: 38px;
    border-top: 0;
}

.boton-volver-inicio {
    margin-bottom: 22px;
    padding: 10px 15px;
    border: 1px solid var(--azul);
    border-radius: 5px;
    background: white;
    color: var(--azul);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.boton-volver-inicio:hover,
.boton-volver-inicio:focus-visible {
    background: var(--azul);
    color: white;
}

/* Menú profesional basado en las categorías disponibles */
.menu-profesional {
    position: relative;
}

.menu-profesional summary {
    color: var(--azul);
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.menu-profesional summary::-webkit-details-marker {
    display: none;
}

.menu-profesional summary::after {
    margin-left: 6px;
    content: "▾";
    font-size: 0.8em;
}

.menu-profesional[open] summary::after {
    content: "▴";
}

.menu-profesional-panel {
    position: fixed;
    top: 88px;
    left: 50%;
    z-index: 35;
    display: grid;
    width: min(900px, 92vw);
    max-height: calc(100vh - 110px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    padding: 26px;
    overflow-y: auto;
    border: 1px solid #dce4e7;
    border-radius: 0 0 10px 10px;
    background: white;
    box-shadow: 0 18px 45px rgb(9 44 63 / 20%);
    transform: translateX(-50%);
}

.menu-profesional:not([open]) .menu-profesional-panel {
    display: none;
}

.menu-profesional-panel h3 {
    margin: 0 0 12px;
    color: var(--azul-oscuro);
    font-size: 0.98rem;
}

.menu-profesional-panel button {
    display: block;
    width: 100%;
    padding: 7px 0;
    border: 0;
    background: transparent;
    color: #405966;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.menu-profesional-panel button:hover,
.menu-profesional-panel button:focus-visible {
    color: var(--azul);
    text-decoration: underline;
}

.menu .menu-mochilas {
    color: #007cad;
    font-weight: 700;
}

/* Acceso independiente a la futura línea de mochilas */
.linea-mochilas-destacada {
    display: grid;
    width: min(1200px, 90%);
    grid-template-columns: 78px minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    margin: 0 auto 75px;
    padding: 28px 0;
    border-top: 1px solid #d9e7ec;
    border-bottom: 1px solid #d9e7ec;
    background: transparent;
    color: #051620;
}

.linea-mochilas-logo {
    width: 78px;
    height: 78px;
    border-radius: 50%;
}

.linea-mochilas-destacada p {
    margin: 0 0 6px;
    color: #007cad;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.linea-mochilas-destacada h2 {
    margin: 0 0 7px;
    color: #051620;
    font-size: clamp(1.55rem, 2.5vw, 2.1rem);
}

.linea-mochilas-destacada span {
    display: block;
    max-width: 680px;
    color: #607580;
    line-height: 1.55;
}

.linea-mochilas-destacada a {
    justify-self: end;
    padding: 11px 17px;
    border: 1px solid #051620;
    border-radius: 999px;
    background: transparent;
    color: #051620;
    font-weight: 800;
    text-decoration: none;
}

.linea-mochilas-destacada a:hover,
.linea-mochilas-destacada a:focus-visible {
    background: #051620;
    color: white;
}

@media (max-width: 1000px) {
    .menu-profesional-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .menu-profesional {
        width: 100%;
    }

    .menu-profesional summary {
        text-align: center;
    }

    .menu-profesional-panel {
        position: static;
        width: 100%;
        max-height: 52vh;
        margin-top: 14px;
        grid-template-columns: 1fr;
        padding: 18px;
        border-radius: 8px;
        box-shadow: inset 0 0 0 1px #dce4e7;
        transform: none;
    }

    .linea-mochilas-destacada {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 18px;
        padding: 24px 0;
    }

    .linea-mochilas-logo {
        width: 64px;
        height: 64px;
    }

    .linea-mochilas-destacada a {
        width: auto;
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 520px) {
    .linea-mochilas-destacada {
        width: 90%;
        margin-bottom: 55px;
        padding: 22px 0;
    }

    .linea-mochilas-destacada a {
        width: 100%;
        justify-self: stretch;
        text-align: center;
    }
}
