:root {
    --color-principal: #1E3D59;
    --color-secundario: #25D366;
    --color-acento: #FFC857;
    --color-fondo: #F5F5F5;
    --color-texto: #333333;
    --altura-header: 72px;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--color-texto);
    background-color: var(--color-fondo);
}

/* CABECERA */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--altura-header);
    background: var(--color-principal);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;
}

header .logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

header nav a {
    color: white;
    margin: 0 10px;
    text-decoration: none;
    font-weight: 600;
}

header nav a:hover {
    color: var(--color-acento);
}

/* Ajuste de desplazamiento para anclas */
section {
    scroll-margin-top: calc(var(--altura-header) + 16px);
}

/* HERO con degradado animado */
.hero {
    min-height: 60vh; /* más estrecho */
    padding-top: var(--altura-header);
    background: linear-gradient(-45deg,
        var(--color-principal),
        var(--color-secundario),
        var(--color-acento),
        var(--color-principal)
    );
    background-size: 400% 400%;
    animation: gradientBG 12s ease infinite;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 0 20px;
}

.hero h1, .hero p {
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Título con efecto de escritura */
.typing {
    font-family: 'Poppins', sans-serif;
    font-size: 2.6rem;
    white-space: nowrap;
    overflow: hidden;
    border-right: 3px solid white;
    width: 0;
    animation: typing 3s steps(35, end) forwards, blink 0.7s step-end infinite;
    max-width: 90vw;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Subtítulo con fade-in */
.fade-subtitle {
    margin-top: 12px;
    opacity: 0;
    animation: fadeIn 2s ease forwards;
    animation-delay: 3.2s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Botón CTA con retardo */
.fade-btn {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease forwards;
    animation-delay: 4.5s;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.btn-cta {
    background: var(--color-secundario);
    color: white;
    padding: 12px 26px;
    border-radius: 28px;
    text-decoration: none;
    font-weight: 700;
    margin-top: 22px;
    transition: background 0.25s ease, transform 0.15s ease;
    display: inline-block;
}

.btn-cta:hover {
    background: #1ebe5d;
    transform: translateY(-1px);
}

/* SECCIONES GENERALES centradas */
main > section:not(.hero) {
    padding: 80px 20px;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

main > section h2 {
    font-family: 'Poppins', sans-serif;
    color: var(--color-principal);
    margin-bottom: 12px;
}

/* GALERÍA */
.galeria {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.galeria img {
    width: 280px;
    border-radius: 8px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: #ddd;
    object-fit: cover;
}

.galeria img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

/* BOTÓN WHATSAPP */
.btn-whatsapp {
    display: inline-block;
    background: var(--color-secundario);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    transition: background 0.25s ease, transform 0.15s ease;
}

.btn-whatsapp:hover {
    background: #1ebe5d;
    transform: translateY(-1px);
}

/* PIE DE PÁGINA */
footer {
    background: var(--color-principal);
    color: white;
    text-align: center;
    padding: 1rem;
}

footer p {
    margin: 4px 0;
    font-size: 0.9rem;
}

footer p:last-child {
    font-size: 0.85rem;
    color: #ccc;
}

/* ANIMACIONES ON-SCROLL */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ACCESIBILIDAD */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .typing { font-size: 2.2rem; }
}

@media (max-width: 768px) {
    header {
        padding: 0 1rem;
        height: 64px;
    }
    :root { --altura-header: 64px; }

    header .logo { font-size: 1rem; }
    header nav a { margin: 0 6px; font-weight: 600; }

    main > section:not(.hero) {
        padding: 60px 16px;
    }

    .galeria img {
        width: 100%;
        max-width: 360px;
    }
}

@media (max-width: 420px) {
    .typing {
        font-size: 1.7rem;
        white-space: normal;
        border-right: none;
        width: 100%;
    }
}