/* Módulo: hero (cabecera visual + buscador en markup de productos)
   Parciales asociados:
   - resources/views/catalogo/partials/header.blade.php (.py-header, .py-hero, slider, logo, título)
   - resources/views/catalogo/partials/productos.blade.php (.py-buscador-wrap, .pf-buscador-unificado)
   Responsabilidad:
   - hero estilo app, carrusel de banners (config empresa) en todos los anchos
   - tipografía responsive (.py-title, .py-subtitle)
   - ajuste header h1 (catálogo usa h1.py-title dentro de <header>)
*/
.py-buscador-wrap {
    margin: 0 0 12px;
}

.py-buscador {
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 12px 16px;
    min-height: 48px;
    font-size: 0.96rem;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.py-buscador:focus {
    outline: none;
    border-color: var(--rojo);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.12);
}

/* Buscador unificado móvil: input + filtro categorías en una línea */
.pf-buscador-unificado__inner {
    display: block;
}

.pf-buscador-unificado__field {
    position: relative;
}

.pf-buscador-unificado__lupa {
    display: none;
}

@media (max-width: 768px) {
    .pf-buscador-unificado {
        position: sticky;
        top: calc(8px + env(safe-area-inset-top));
        z-index: 1002;
        margin-bottom: 10px;
        padding-top: 2px;
    }

    .pf-buscador-unificado__inner {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .pf-buscador-unificado__field {
        flex: 1;
        min-width: 0;
    }

    .pf-buscador-unificado__lupa {
        display: flex;
        align-items: center;
        position: absolute;
        inset-block: 0;
        left: 14px;
        color: #94a3b8;
        pointer-events: none;
    }

    .pf-buscador-unificado__lupa svg {
        width: 18px;
        height: 18px;
    }

    .pf-buscador-unificado__input {
        width: 100%;
        padding: 12px 14px 12px 42px;
        min-height: 48px;
        border-radius: 16px;
        border: 1px solid #f1f5f9;
        background: #f8fafc;
        font-size: 0.9rem;
        font-weight: 500;
        color: #1e293b;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    }

    .pf-buscador-unificado__input::placeholder {
        color: #94a3b8;
        font-weight: 400;
    }

    .pf-buscador-unificado__input:focus {
        background: #fff;
        border-color: var(--rojo);
        box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.12);
    }
}

.py-header {
    position: relative;
    z-index: 20;
    padding: 26px 16px 2px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.py-hero {
    position: relative;
    width: 100%;
    min-height: 220px;
    height: auto;
    overflow: hidden;
    isolation: isolate;
    max-width: 1050px;
    margin: 0 auto 0;
    padding: 26px 18px 34px;
    border-radius: 26px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--fondo, #f7f7f7);
    box-shadow: 0 14px 34px rgba(0,0,0,.15);
}

/* El fondo del hero lo pinta el carrusel (.py-hero-slide), no una imagen fija */
.py-hero::after {
    content: none;
}

.py-hero::before {
    content: "";
    position: absolute;
    inset: -120px;
    z-index: 1;
    background:
        radial-gradient(circle at 15% 25%, rgba(255,255,255,.08), transparent 45%),
        radial-gradient(circle at 85% 20%, rgba(255,255,255,.06), transparent 50%),
        radial-gradient(circle at 40% 95%, rgba(0,0,0,.12), transparent 55%);
    opacity: .5;
    pointer-events: none;
}

/* Contenido por encima del slider móvil (z-index 0) */
.py-hero > *:not(.py-hero-slider-mobile) {
    position: relative;
    z-index: 3;
}

.py-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.py-logo {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    padding: 16px;
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 22px rgba(0,0,0,.15);
}

.py-logo-fallback {
    width: 180px;
    height: 180px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.10);
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 22px rgba(0,0,0,.15);
}

.py-logo-fallback i {
    font-size: 72px;
    color: rgba(255,255,255,.9);
}

.py-title {
    margin: 0 0 10px;
    color: #fff;
    font-weight: 800;
    letter-spacing: .6px;
    font-size: 34px;
    line-height: 1.12;
    text-transform: uppercase;
    text-shadow: 0 2px 12px rgba(0,0,0,.18);
}

.py-subtitle {
    box-sizing: border-box;
    max-width: 820px;
    margin: 2px auto 18px;
    padding: 12px 14px;
    width: calc(100% - 32px);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 13.5px;
    line-height: 1.4;
    color: #555;
    font-weight: 500;
    text-align: center;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.06),
        0 1px 3px rgba(0, 0, 0, 0.04);
}

.py-hero.py-compact {
    padding: 14px 16px 14px;
    border-radius: 18px;
}

.py-hero.py-compact .py-logo,
.py-hero.py-compact .py-logo-fallback {
    width: 120px;
    height: 120px;
    padding: 14px;
}

.py-hero.py-compact .py-title {
    font-size: 22px;
    margin-bottom: 6px;
}

/* Carrusel de banners (config empresa) en todos los anchos: móvil, tablet y desktop/PWA */
.py-hero-slider-mobile {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    overflow: hidden;
}

.py-hero-slider-track {
    display: flex;
    width: calc(var(--hero-slides, 3) * 100%);
    height: 100%;
    transform: translateX(0);
    transition: transform 1.15s ease-in-out;
    will-change: transform;
}

.py-hero-slide {
    flex: 0 0 calc(100% / var(--hero-slides, 3));
    width: calc(100% / var(--hero-slides, 3));
    height: 100%;
    box-sizing: border-box;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: var(--fondo, #f7f7f7);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.2rem;
    }

    .py-header {
        padding: 16px 16px 2px;
    }

    .py-hero {
        position: relative;
        height: 270px;
        min-height: 270px;
        max-height: 270px;
        border-radius: 16px;
        margin: 12px 12px 2px 12px;
        width: calc(100% - 24px);
        box-sizing: border-box;
        overflow: hidden;
        padding: 10px 12px;
        justify-content: center;
    }

    .py-subtitle {
        margin-top: 2px;
        margin-bottom: 14px;
    }

    .py-hero.py-compact {
        height: 220px;
        min-height: 220px;
        max-height: 220px;
    }
}

@media (max-width: 576px) {
    .py-header {
        padding: 14px 12px 2px;
    }

    .py-hero {
        padding: 8px 10px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .py-title { font-size: 26px; }
    .py-logo, .py-logo-fallback { width: 150px; height: 150px; }
    .py-subtitle {
        font-size: 13px;
        padding: 11px 12px;
        margin-top: 0;
        margin-bottom: 14px;
        width: calc(100% - 24px);
        border-radius: 11px;
    }
}

@media (min-width: 992px) {
    .py-header { padding: 26px 16px 2px; }
    .py-hero { max-width: 980px; }
}
