/* =========================================================
   mejoras.css - Mejoras visuales (skeleton loading, animaciones
   de scroll, transiciones modernas). Archivo autocontenido,
   no reemplaza estilo.css/custom.css.
   ========================================================= */

/* ---- Fade-in general de la pagina al cargar ---- */
body {
    opacity: 0;
    animation: pageFadeIn 0.6s ease forwards;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---- Skeleton / shimmer loading para <img> ---- */
img.img-loading {
    background: linear-gradient(100deg, #e9e9e9 30%, #f5f5f5 50%, #e9e9e9 70%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.3s ease-in-out infinite;
    min-height: 40px;
}

@keyframes skeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

img.img-loaded {
    animation: imgFadeIn 0.5s ease;
}

@keyframes imgFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---- Reveal de secciones al hacer scroll ---- */
.reveal-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.reveal-up.is-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.reveal-up.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-up.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-up.reveal-delay-3 { transition-delay: 0.24s; }

/* Respeta a quien pidio menos movimiento */
@media (prefers-reduced-motion: reduce) {
    body { animation: none; opacity: 1; }
    .reveal-up { opacity: 1; transform: none; transition: none; }
    img.img-loading { animation: none; }
}

/* ---- Hover moderno para thumbnails de galeria ---- */
#galeria .item img,
.container_plantas img {
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
}

#galeria .item:hover img {
    transform: scale(1.06);
    filter: brightness(1.03);
}

#galeria .item {
    overflow: hidden;
    display: block;
}

/* ---- Hover moderno para botones ---- */
.btn-cotizar,
.btn-ver-proyecto,
.btn-maps,
.btn-cotizar-submenu,
.btn-planta,
.btn-planta2 {
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.btn-cotizar:hover,
.btn-ver-proyecto:hover,
.btn-maps:hover,
.btn-cotizar-submenu:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

/* ---- Subrayado animado en links del menu ---- */
.navbar-nav > li > a {
    position: relative;
}

.navbar-nav > li > a::after {
    content: "";
    position: absolute;
    left: 15px;
    right: 15px;
    bottom: 8px;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.navbar-nav > li > a:hover::after {
    transform: scaleX(1);
}

/* ---- Boton volver arriba ---- */
#btn-back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #e14b4b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 999;
    cursor: pointer;
    text-decoration: none;
}

#btn-back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#btn-back-to-top:hover {
    background: #c53a3a;
    transform: translateY(-3px);
}

@media (max-width: 767px) {
    #btn-back-to-top {
        right: 16px;
        bottom: 16px;
        width: 42px;
        height: 42px;
    }
}
