/*--------------------------------------------------------------
# ALZIS 2027 · Mejoras de animación y rendimiento
# Se carga DESPUÉS de code_shop.css: mantiene el diseño y solo
# suaviza animaciones, mejora la fluidez y corrige detalles.
--------------------------------------------------------------*/

:root {
    --alz-ease: cubic-bezier(.22, .61, .36, 1);
    --alz-ease-out: cubic-bezier(.16, 1, .3, 1);
    --alz-green: #0b8a6a;
}

/* Rendimiento: el fondo fijo no carga una imagen inexistente (antes daba 404) */
.bg {
    background-image: none;
}

/* Imágenes: sin saltos de maquetación */
img {
    height: auto;
}
.header .logo img {
    width: auto;
    height: auto;
}

/* Contenido fuera de pantalla: el navegador no lo pinta hasta que hace falta */
.footer {
    content-visibility: auto;
    contain-intrinsic-size: auto 420px;
}

/*--------------------------------------------------------------
# Entrada de página
--------------------------------------------------------------*/
@keyframes alzFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
main {
    animation: alzFadeIn .6s var(--alz-ease) both;
}

/*--------------------------------------------------------------
# Cabecera: transición suave al hacer scroll (clase .scrolled desde JS)
--------------------------------------------------------------*/
.header {
    transition: padding .45s var(--alz-ease), box-shadow .45s var(--alz-ease), background-color .45s var(--alz-ease);
    background: #fff;
    will-change: padding;
}
.header.scrolled {
    padding-top: 10px;
    padding-bottom: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
}
.header .logo img {
    transition: max-height .45s var(--alz-ease);
}
.header.scrolled .logo img {
    max-height: 34px;
}

/* Menú: subrayado animado en escritorio */
@media (min-width: 1280px) {
    .navbar > ul > li > a.text_nav_A {
        position: relative;
    }
    .navbar > ul > li > a.text_nav_A::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -6px;
        height: 2px;
        background: var(--alz-green);
        transform: scaleX(0);
        transform-origin: left center;
        transition: transform .35s var(--alz-ease);
    }
    .navbar > ul > li > a.text_nav_A:hover::after,
    .navbar > ul > li > a.text_nav_A:focus-visible::after {
        transform: scaleX(1);
    }
    .navbar .dropdown ul {
        transition: opacity .25s var(--alz-ease), transform .25s var(--alz-ease), visibility .25s;
        transform: translateY(8px);
    }
    .navbar .dropdown:hover > ul {
        transform: translateY(0);
    }
}

/*--------------------------------------------------------------
# Portada: logo de bienvenida y carrusel
--------------------------------------------------------------*/
@keyframes alzHeroIn {
    from { opacity: 0; transform: translate3d(0, -30px, 0) scale(.98); }
    to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
.alz-hero-logo {
    /* antes: margin-top animado con JS (provocaba recálculos). Ahora GPU */
    margin-top: 250px !important;
    opacity: 0;
    animation: alzHeroIn 1.1s var(--alz-ease-out) .35s both;
}
.alz-hero-logo .text_carousel {
    animation: alzFadeIn 1s var(--alz-ease) .9s both;
}

/* Efecto "Ken Burns" suave en la imagen activa del carrusel */
.alz-kenburns .carousel-item img {
    transform: scale(1);
    transform-origin: center center;
    will-change: transform;
}
.alz-kenburns .carousel-item.active img {
    animation: alzKenBurns 9s ease-out both;
}
@keyframes alzKenBurns {
    from { transform: scale(1.06); }
    to { transform: scale(1); }
}
.carousel-fade .carousel-item {
    transition-duration: 1.1s;
    transition-timing-function: var(--alz-ease);
}

/*--------------------------------------------------------------
# Efectos "aparecer" (mismos nombres de clase que la web original,
# ahora gestionados con IntersectionObserver y aceleración GPU)
--------------------------------------------------------------*/
.effect_0, .effect_1, .effect_2, .effect_3 {
    transition: opacity 1.1s var(--alz-ease-out), transform 1.1s var(--alz-ease-out);
    will-change: opacity, transform;
}
.effect_0 { transform: translate3d(-60px, 0, 0); }
.effect_1 { transform: translate3d(0, 60px, 0); }
.effect_2 { transform: translate3d(60px, 0, 0); }
.effect_3 { transform: translate3d(0, -60px, 0); }
.effect_0.aparecer, .effect_1.aparecer, .effect_2.aparecer, .effect_3.aparecer {
    transform: translate3d(0, 0, 0);
    will-change: auto;
}

/* Aparición escalonada de tarjetas (se activa solo si hay JS) */
.js .alz-reveal {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    transition: opacity .8s var(--alz-ease-out), transform .8s var(--alz-ease-out);
    transition-delay: var(--alz-d, 0ms);
}
.js .alz-reveal.is-visible {
    opacity: 1;
    transform: none;
}

/*--------------------------------------------------------------
# Micro-interacciones
--------------------------------------------------------------*/
.recent-blog-posts .post-item,
.negocios .card-item,
.contacto .info-item,
.noticias .post-item {
    transition: transform .45s var(--alz-ease), box-shadow .45s var(--alz-ease);
}
.recent-blog-posts .post-item:hover,
.negocios .card-item:hover,
.contacto .info-item:hover,
.noticias .posts-list .post-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .10);
}
.recent-blog-posts .post-item .post-img img,
.noticias .post-item .post-img img {
    transition: transform .8s var(--alz-ease);
}
.recent-blog-posts .post-item:hover .post-img img,
.noticias .post-item:hover .post-img img {
    transform: scale(1.05);
}
.negocios .card-item .card-bg {
    transition: transform .8s var(--alz-ease), opacity .6s var(--alz-ease);
}
.negocios .card-item:hover .card-bg {
    transform: scale(1.03);
}

.a_href_alzis,
.button_alzis button,
.php_mail button {
    transition: transform .25s var(--alz-ease), box-shadow .25s var(--alz-ease), background-color .25s, color .25s;
}
.a_href_alzis:hover,
.button_alzis button:hover,
.php_mail button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(11, 138, 106, .25);
}
.a_href_alzis:active,
.button_alzis button:active,
.php_mail button:active {
    transform: translateY(0);
}

.alz-social,
.footer .social-links a {
    transition: transform .3s var(--alz-ease), color .3s;
}
.alz-social:hover,
.footer .social-links a:hover {
    transform: translateY(-3px) scale(1.08);
}

/* Fondos en carga diferida: aparecen con fundido */
.alz-lazy-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #eef2f1;
}
.js .alz-lazy-bg:not(.is-loaded) {
    opacity: .001;
}
.alz-lazy-bg.is-loaded {
    opacity: 1;
    transition: opacity .7s var(--alz-ease);
}

/*--------------------------------------------------------------
# Botón volver arriba (sin jQuery: animación CSS)
--------------------------------------------------------------*/
.ir-arriba {
    display: block !important;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, 20px, 0);
    transition: opacity .35s var(--alz-ease), transform .35s var(--alz-ease), visibility .35s, background-color .3s;
    border-radius: 4px;
}
.ir-arriba.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.ir-arriba:hover {
    background: var(--alz-green);
}

/*--------------------------------------------------------------
# Aviso de cookies
--------------------------------------------------------------*/
.cookies_user {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: black;
    padding: 15px;
    text-align: center;
    z-index: 999;
    transform: translate3d(0, 100%, 0);
    transition: transform .6s var(--alz-ease-out), opacity .6s;
}
.cookies_user.is-visible {
    transform: none;
}
.cookies_user.is-hidden {
    transform: translate3d(0, 100%, 0);
    opacity: 0;
}

/*--------------------------------------------------------------
# Vídeo de YouTube bajo demanda (ahorra ~1 MB en la portada)
--------------------------------------------------------------*/
.alz-yt {
    position: relative;
    display: block;
    width: 100%;
    min-height: 315px;
    aspect-ratio: 16 / 9;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: #000 center / cover no-repeat;
    overflow: hidden;
}
.alz-yt::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .35));
    transition: opacity .3s;
}
.alz-yt:hover::before { opacity: .6; }
.alz-yt__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 72px;
    height: 50px;
    margin: -25px 0 0 -36px;
    border-radius: 14px;
    background: #e00;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
    transition: transform .3s var(--alz-ease), background-color .3s;
}
.alz-yt__play::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -11px 0 0 -7px;
    border-style: solid;
    border-width: 11px 0 11px 19px;
    border-color: transparent transparent transparent #fff;
}
.alz-yt:hover .alz-yt__play { transform: scale(1.1); }
.alz-yt iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/*--------------------------------------------------------------
# Noticias: buscador y compartir
--------------------------------------------------------------*/
.alz-news-search {
    display: flex;
    max-width: 420px;
    margin: 0 auto;
    border: 1px solid rgba(82, 86, 94, .25);
    border-radius: 999px;
    overflow: hidden;
    transition: box-shadow .3s, border-color .3s;
}
.alz-news-search:focus-within {
    border-color: var(--alz-green);
    box-shadow: 0 0 0 4px rgba(11, 138, 106, .12);
}
.alz-news-search input {
    flex: 1;
    border: 0;
    padding: 10px 18px;
    outline: 0;
    min-width: 0;
}
.alz-news-search button {
    border: 0;
    background: var(--alz-green);
    color: #fff;
    padding: 0 18px;
}
.noticias-details .content img {
    max-width: 100%;
    height: auto;
}
.noticias-details .content iframe {
    max-width: 100%;
}
.alz-share {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 600;
}
.alz-share a {
    font-size: 20px;
    transition: transform .25s var(--alz-ease);
}
.alz-share a:hover { transform: translateY(-2px); }

/* Formularios: estados de validación más suaves */
.php_mail .form-control {
    transition: border-color .3s, box-shadow .3s;
}
.php_mail .form-control:focus {
    border-color: var(--alz-green);
    box-shadow: 0 0 0 4px rgba(11, 138, 106, .12);
}
.alz-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Páginas simples (404 / mantenimiento) */
.alz-simple {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #f4f7f6;
    font-family: "Open Sans", system-ui, sans-serif;
    color: #364d59;
    text-align: center;
    padding: 24px;
}
.alz-simple__box h1 {
    font-size: 5rem;
    font-weight: 800;
    color: var(--alz-green);
    margin: 24px 0 8px;
}
.alz-simple__btn {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 26px;
    background: var(--alz-green);
    color: #fff;
    border-radius: 999px;
    text-decoration: none;
}
.alz-simple__btn:hover { color: #fff; opacity: .9; }

/* Accesibilidad: foco visible con teclado */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--alz-green);
    outline-offset: 3px;
}

/*--------------------------------------------------------------
# Usuarios que prefieren menos movimiento
--------------------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .alz-hero-logo { opacity: 1; }
    .effect_0, .effect_1, .effect_2, .effect_3, .js .alz-reveal { opacity: 1 !important; transform: none !important; }
}

/*--------------------------------------------------------------
# Aviso modal propio (formularios) — mismo aspecto que el anterior
--------------------------------------------------------------*/
.alz-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0);
    transition: background .25s ease;
}
.alz-modal.is-open { background: rgba(0, 0, 0, .4); }
.alz-modal__box {
    width: 32em;
    max-width: 100%;
    background: #fff;
    border-radius: 5px;
    padding: 1.25em 1.25em 1.6em;
    text-align: center;
    font-family: inherit;
    color: #545454;
    transform: scale(.7);
    opacity: 0;
    transition: transform .3s cubic-bezier(.18, 1.25, .4, 1), opacity .2s;
    outline: 0;
}
.alz-modal.is-open .alz-modal__box { transform: none; opacity: 1; }
.alz-modal__icon {
    position: relative;
    width: 5em;
    height: 5em;
    margin: 1.25em auto 1.6em;
    border: .25em solid;
    border-radius: 50%;
}
.alz-modal__icon--ok { border-color: rgba(165, 220, 134, .3); }
.alz-modal__icon--ok::after {
    content: "";
    position: absolute;
    left: 1.45em;
    top: .55em;
    width: 1.35em;
    height: 2.6em;
    border: solid #a5dc86;
    border-width: 0 .3em .3em 0;
    transform: rotate(45deg) scale(0);
    animation: alzCheck .45s .15s cubic-bezier(.18, 1.25, .4, 1) forwards;
}
.alz-modal__icon--error { border-color: #f27474; }
.alz-modal__icon--error::before,
.alz-modal__icon--error::after {
    content: "";
    position: absolute;
    top: 2.1em;
    left: 1.05em;
    width: 2.4em;
    height: .3em;
    border-radius: .125em;
    background: #f27474;
    transform: rotate(45deg);
}
.alz-modal__icon--error::after { transform: rotate(-45deg); }
@keyframes alzCheck { to { transform: rotate(45deg) scale(1); } }
.alz-modal__title { margin: 0 0 .4em; font-size: 1.875em; font-weight: 600; color: #595959; }
.alz-modal__text { margin: 0 0 1.25em; font-size: 1.125em; }
.alz-modal__btn {
    border: 0;
    border-radius: .25em;
    background: #0b8a6a;
    color: #fff;
    font-size: 1em;
    padding: .625em 1.6em;
    box-shadow: 0 0 0 0 rgba(11, 138, 106, .4);
    transition: box-shadow .2s, filter .2s;
}
.alz-modal__btn:hover { filter: brightness(1.08); }
.alz-modal__btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(11, 138, 106, .45); }
