/* ============================================================
   CATÁLOGO PÚBLICO — Salud Visual Centro Óptico
   Paleta: Azul #1E90FF | Negro #1A1A1A | Blanco #FFFFFF
   ============================================================ */

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

:root {
    --azul:    #1E90FF;
    --azul-dk: #1270CC;
    --negro:   #1A1A1A;
    --blanco:  #FFFFFF;
    --gris:    #F5F6FA;
    --borde:   #E8E8E8;
    --texto:   #444;
    --wa:      #25D366;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #E3F2FD;
    color: var(--negro);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; }

/* ── HEADER ──────────────────────────────────────────────── */
.site-header {
    background: var(--blanco);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--borde);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
}

.site-logo img {
    height: 75px;
    width: auto;
    display: block;
}

.site-search { flex: 1; max-width: 520px; }

.search-form {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
}

.search-form input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    font-size: 14px;
    outline: none;
    color: var(--negro);
}

.search-form button {
    background: var(--azul);
    color: var(--blanco);
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s;
}

.search-form button:hover { background: var(--azul-dk); }

.header-acciones {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-favoritos {
    position: relative;
    display: flex;
    color: var(--negro);
    transition: color .2s;
}

.header-favoritos:hover { color: var(--azul); }
.header-favoritos svg { width: 24px; height: 24px; }

.contador-favoritos {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--azul);
    color: var(--blanco);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 999px;
    min-width: 16px;
    text-align: center;
}

.header-admin-link {
    color: var(--azul-dk);
    font-size: 12px;
    font-weight: 600;
    transition: color .2s;
    white-space: nowrap;
}

.header-admin-link:hover { color: var(--azul); }

/* ── NAV CATEGORÍAS ──────────────────────────────────────── */
.site-nav {
    background: var(--azul);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 20px;
}

.nav-inner::-webkit-scrollbar { display: none; }

.nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    color: var(--blanco);
    font-size: 13.5px;
    font-weight: 600;
    padding: 11px 20px;
    cursor: pointer;
}

.nav-toggle svg { width: 18px; height: 18px; flex-shrink: 0; }

.site-nav a {
    color: rgba(255,255,255,.85);
    padding: 11px 16px;
    font-size: 15px;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color .15s, border-color .15s;
    display: block;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--blanco);
    border-bottom-color: var(--blanco);
}

/* ── CONTENIDO PRINCIPAL ─────────────────────────────────── */
main { flex: 1; }

.catalogo {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 20px;
}

.catalogo-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 10px;
}

.catalogo-top h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--negro);
}

.total-productos {
    font-size: 13px;
    color: #888;
}

/* ── GRID DE PRODUCTOS ───────────────────────────────────── */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
}

.sin-resultados {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.sin-resultados .icon { font-size: 48px; margin-bottom: 12px; }
.sin-resultados p { font-size: 15px; }

/* ── TARJETA DE PRODUCTO ─────────────────────────────────── */
.producto-card {
    position: relative;
    background: var(--blanco);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--borde);
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}

.btn-favorito {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.9);
    border: none;
    border-radius: 999px;
    color: var(--negro);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    transition: color .15s, transform .15s;
}

.btn-favorito:hover { transform: scale(1.08); }
.btn-favorito svg { width: 18px; height: 18px; }

.btn-favorito.activo {
    color: #E0245E;
}

.btn-favorito.activo svg {
    fill: #E0245E;
}

.btn-favorito-lg {
    position: static;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    background: var(--gris);
}

.btn-favorito-lg svg { width: 24px; height: 24px; }

.producto-card:hover {
    box-shadow: 0 8px 28px rgba(30,144,255,.18);
    transform: translateY(-3px);
}

.card-img-wrap {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #EEF4FF;
    position: relative;
}

.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.producto-card:hover .card-img-wrap img {
    transform: scale(1.04);
}

.card-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #BFD3FF;
    gap: 8px;
}

.card-no-img svg { width: 56px; height: 56px; }
.card-no-img span { font-size: 11px; letter-spacing: .5px; }

.card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.card-cat {
    font-size: 11px;
    font-weight: 700;
    color: var(--azul);
    text-transform: uppercase;
    letter-spacing: .6px;
}

.card-nombre {
    font-size: 14px;
    font-weight: 600;
    color: var(--negro);
    line-height: 1.35;
    flex: 1;
}

.btn-wa {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--wa);
    color: var(--blanco);
    border-radius: 7px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    transition: background .2s;
}

.btn-wa:hover { background: #1EBE59; color: var(--blanco); }

.btn-wa svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ── BOTÓN VER MÁS ───────────────────────────────────────── */
.btn-ver {
    display: block;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    color: var(--azul);
    border-top: 1px solid var(--borde);
    transition: background .15s;
}

.btn-ver:hover { background: #EEF4FF; }

/* ── PAGINACIÓN ──────────────────────────────────────────── */
.paginacion {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.paginacion a,
.paginacion span {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    border: 1px solid var(--borde);
    background: var(--blanco);
    color: var(--negro);
}

.paginacion a:hover { border-color: var(--azul); color: var(--azul); }
.paginacion span.actual { background: var(--azul); color: var(--blanco); border-color: var(--azul); }

/* ── PÁGINA DE PRODUCTO ──────────────────────────────────── */
.producto-detalle {
    max-width: 1000px;
    margin: 32px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: start;
}

.galeria-principal {
    border-radius: 12px;
    overflow: hidden;
    background: #EEF4FF;
    aspect-ratio: 1;
}

.galeria-principal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.galeria-thumbnails {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.galeria-thumbnails img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .2s;
}

.galeria-thumbnails img.activo,
.galeria-thumbnails img:hover { border-color: var(--azul); }

.prod-info { display: flex; flex-direction: column; gap: 14px; }

.prod-categoria {
    font-size: 12px;
    font-weight: 700;
    color: var(--azul);
    text-transform: uppercase;
    letter-spacing: .6px;
}

.prod-nombre {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.prod-descripcion {
    font-size: 14.5px;
    color: var(--texto);
    line-height: 1.7;
    white-space: pre-line;
}

.prod-disponible {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #D4EDDA;
    color: #155724;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.btn-wa-lg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--wa);
    color: var(--blanco);
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    transition: background .2s;
}

.btn-wa-lg:hover { background: #1EBE59; color: var(--blanco); }
.btn-wa-lg svg { width: 22px; height: 22px; }

.btn-volver {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--azul);
    font-size: 14px;
    margin-bottom: 20px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.breadcrumb {
    max-width: 1000px;
    margin: 24px auto 0;
    padding: 0 20px;
    font-size: 13px;
    color: #888;
    display: flex;
    gap: 6px;
    align-items: center;
}

.breadcrumb a { color: var(--azul); }

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
    position: relative;
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 20px;
}

.hero-track {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 16 / 6;
    background: #EEF4FF;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .5s ease;
}

.hero-slide.activo { opacity: 1; }

.hero-slide a,
.hero-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-flecha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 999px;
    background: rgba(255,255,255,.85);
    color: var(--negro);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    transition: background .15s, transform .15s;
}

.hero-flecha:hover { background: var(--blanco); transform: translateY(-50%) scale(1.08); }
.hero-flecha svg { width: 20px; height: 20px; }
.hero-flecha-izq { left: 30px; }
.hero-flecha-der { right: 30px; }

.hero-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.hero-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    border: none;
    background: var(--borde);
    cursor: pointer;
    padding: 0;
}

.hero-dot.activo { background: var(--azul); }

/* ── SECCIONES DE LA HOME ────────────────────────────────── */
.home-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 20px 0;
}

.home-titulo {
    font-size: 20px;
    font-weight: 700;
    color: var(--negro);
    margin-bottom: 18px;
}

.categorias-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.categorias-header .home-titulo { margin-bottom: 18px; }

.btn-cta-examen {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--wa), #1DA851);
    color: var(--blanco);
    border-radius: 999px;
    padding: 10px 20px;
    margin-bottom: 18px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
    text-align: right;
    box-shadow: 0 3px 10px rgba(37,211,102,.35);
    transition: transform .15s, box-shadow .15s;
}

.btn-cta-examen:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(37,211,102,.45);
}

.btn-cta-examen svg { width: 24px; height: 24px; flex-shrink: 0; }

@media (max-width: 680px) {
    .btn-cta-examen {
        width: 100%;
        justify-content: center;
        text-align: center;
        order: 2;
    }
}

/* ── VIDEOS ────────────────────────────────────────────────── */
.videos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.video-card {
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: 12px;
    overflow: hidden;
}
.video-embed {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}
.video-embed iframe,
.video-embed video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.video-info {
    padding: 14px 16px;
}
.video-titulo {
    font-size: 15px;
    font-weight: 700;
    color: var(--negro);
    margin-bottom: 6px;
}
.video-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}
@media (max-width: 680px) {
    .videos-grid { grid-template-columns: 1fr; }
}

.ver-todo-link {
    color: var(--azul);
    font-size: 13.5px;
    font-weight: 600;
}

.ver-todo-link:hover { color: var(--azul-dk); }

/* ── CATEGORÍAS (home) ───────────────────────────────────── */
.categorias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.categoria-card {
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    transition: box-shadow .2s, transform .2s;
}

.categoria-card:hover {
    box-shadow: 0 8px 28px rgba(30,144,255,.18);
    transform: translateY(-3px);
}

.categoria-img {
    aspect-ratio: 4 / 3;
    background: #EEF4FF;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #BFD3FF;
}

.categoria-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.categoria-img svg { width: 40px; height: 40px; }

.categoria-card span {
    display: block;
    padding: 12px 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--negro);
}

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer {
    background: var(--blanco);
    color: var(--texto);
    padding: 40px 20px 20px;
    margin-top: 48px;
    font-size: 13px;
    border-top: 1px solid var(--borde);
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 28px;
}

.footer-col-marca img {
    height: 64px;
    display: block;
    margin-bottom: 10px;
}

.footer-col h4 {
    font-size: 13px;
    color: var(--negro);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 12px;
}

.footer-col a {
    display: block;
    color: var(--texto);
    padding: 5px 0;
    transition: color .15s;
}

.footer-col a:hover { color: var(--azul); }

.footer-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--wa) !important;
    margin-top: 8px;
    font-weight: 600;
    font-size: 14px;
}

.footer-pagos {
    max-width: 1200px;
    margin: 28px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--borde);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-pagos > span:first-child {
    font-size: 12px;
    font-weight: 600;
    color: var(--texto);
    margin-right: 4px;
}

.pago-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: 6px;
    padding: 4px 8px;
    height: 30px;
}

.pago-badge img { height: 100%; width: auto; object-fit: contain; }

.footer-copy {
    max-width: 1200px;
    margin: 24px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--borde);
    text-align: center;
    color: #888;
}

.footer-credito {
    display: inline-block;
    margin-top: 6px;
    font-size: 11.5px;
    color: #aaa;
}

.footer-credito:hover { color: var(--azul); }

/* ── PÁGINAS INSTITUCIONALES (ayuda, términos, etc.) ─────── */
.pagina-info {
    max-width: 760px;
    margin: 0 auto;
    padding: 36px 20px 60px;
}

.pagina-info h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 18px;
}

.pagina-info h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--negro);
    margin: 26px 0 8px;
}

.pagina-info p {
    font-size: 14.5px;
    color: var(--texto);
    line-height: 1.7;
}

.pagina-info-cta {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--borde);
}

.pagina-info-cta a { color: var(--azul); font-weight: 600; }

/* ── FAQ (ayuda.php) ─────────────────────────────────────── */
.faq-lista { margin-top: 10px; }

.faq-item {
    border-bottom: 1px solid var(--borde);
}

.faq-pregunta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: none;
    border: none;
    text-align: left;
    padding: 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--negro);
    cursor: pointer;
}

.faq-icono {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--azul);
    transition: transform .2s;
}

.faq-item.abierto .faq-icono { transform: rotate(45deg); }

.faq-respuesta {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}

.faq-item.abierto .faq-respuesta { max-height: 400px; }

.faq-respuesta p {
    padding-bottom: 16px;
    font-size: 14px;
    color: var(--texto);
    line-height: 1.6;
}

/* ── TIENDAS (atencion.php) ──────────────────────────────── */
.tiendas-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.tienda-card {
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: 12px;
    padding: 20px;
}

.tienda-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--negro);
}

.tienda-card p {
    font-size: 13.5px;
    color: var(--texto);
    margin-bottom: 6px;
    line-height: 1.5;
}

.tienda-card .btn-wa {
    margin-top: 12px;
    display: inline-flex;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 680px) {
    .header-inner { gap: 10px; flex-wrap: wrap; }
    .site-logo img { height: 57px; }
    .site-search { order: 3; flex: 1 1 100%; max-width: 100%; }
    .header-acciones { order: 2; margin-left: auto; }
    .productos-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .producto-detalle { grid-template-columns: 1fr; gap: 24px; }
    .prod-nombre { font-size: 22px; }

    .nav-toggle { display: flex; }

    .nav-inner {
        display: none;
        flex-direction: column;
        overflow: visible;
        padding: 0;
    }

    .nav-inner.open { display: flex; }

    .site-nav a {
        padding: 12px 20px;
        border-top: 1px solid rgba(255,255,255,.15);
    }

    .hero { padding: 0; }
    .hero-track { aspect-ratio: 2.4 / 1; border-radius: 0; }
    .hero-flecha { width: 32px; height: 32px; }
    .hero-flecha svg { width: 17px; height: 17px; }
    .hero-flecha-izq { left: 12px; }
    .hero-flecha-der { right: 12px; }
    .home-section { padding-top: 28px; }
    .categorias-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .categoria-card span { font-size: 12px; padding: 8px 6px; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .footer-col-marca { grid-column: 1 / -1; }

    .pagina-info h1 { font-size: 22px; }
}

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