/* Global visual rhythm, navigation state and viewport-aware public layout. */

:root {
    --site-navbar-height: 64px;
}

/* The fixed navbar offset must match its real rendered height. The JS updates this variable. */
body {
    padding-top: var(--site-navbar-height) !important;
}

/* ---------- Navbar active state ---------- */
.navbar .nav-link {
    position: relative;
    transition: color .18s ease, background-color .18s ease;
}

/* The demo link used to be permanently orange. Keep it neutral unless active. */
.navbar .nav-link[href="/demo-sitio-web/"]:not(.site-nav-active) {
    color: rgba(255,255,255,.8) !important;
}

.navbar .nav-link.site-nav-active {
    color: var(--color-main) !important;
    font-weight: 700;
}

.navbar .nav-link.site-nav-active::after {
    content: "";
    position: absolute;
    left: .5rem;
    right: .5rem;
    bottom: .15rem;
    height: 2px;
    border-radius: 999px;
    background: var(--color-main);
    transform-origin: center;
}

/* ---------- WhatsApp Business ---------- */
.site-whatsapp {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    min-height: 52px;
    padding: .72rem 1rem;
    border-radius: 999px;
    color: #fff;
    background: #25d366;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .24);
    font-size: .92rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.site-whatsapp svg {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    fill: currentColor;
}

.site-whatsapp:hover {
    color: #fff;
    background: #1fbd5a;
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
}

.site-whatsapp:focus-visible {
    outline: 3px solid rgba(37, 211, 102, .34);
    outline-offset: 3px;
}

/* ---------- Viewport rhythm ---------- */
/* Hero fills the usable first screen exactly, without the old white strip. */
.home-premium .home-hero {
    min-height: calc(100svh - var(--site-navbar-height));
}

.home-premium .home-hero-copy {
    padding-top: clamp(2.8rem, 6vh, 4.4rem);
    padding-bottom: clamp(2.8rem, 6vh, 4.4rem);
}

/* Slightly smaller display type so the complete hero breathes inside one screen. */
.home-premium .home-display {
    font-size: clamp(2.55rem, 4.55vw, 4.65rem);
    line-height: 1.01;
}

.home-premium .home-section-title {
    font-size: clamp(1.9rem, 3vw, 3rem);
}

/* Main content blocks aim to occupy one viewport. min-height avoids clipping dense sections. */
.home-premium .home-section {
    min-height: calc(100svh - var(--site-navbar-height));
    display: flex;
    align-items: center;
    padding-top: clamp(3.5rem, 7vh, 5.25rem);
    padding-bottom: clamp(3.5rem, 7vh, 5.25rem);
}

.home-premium .home-section > .home-container {
    width: min(1180px, calc(100% - 2rem));
}

/* Service landing hero uses the same full-screen first impression. */
.service-landing-hero {
    min-height: calc(100svh - var(--site-navbar-height));
    display: flex;
    align-items: center;
}

/* Contact hero also aligns to the available viewport instead of leaving a top gap. */
.contact-hero {
    min-height: calc(100svh - var(--site-navbar-height));
    display: flex;
    align-items: center;
}

/* ---------- Public-site section rhythm ---------- */
.home-premium .home-section-soft {
    background: #f7f8fa;
    border-top: 1px solid #eef0f2;
    border-bottom: 1px solid #eef0f2;
}

/* Sections that explain a process get a barely tinted canvas, while cards remain white. */
.home-premium .home-section:has(.home-conversion-wrap) {
    background: #fbfbfc;
    border-top: 1px solid #f0f1f3;
    border-bottom: 1px solid #f0f1f3;
}

/* Dark feature shells feel intentional when separated from surrounding white. */
.home-premium .home-section:has(.home-growth-shell) {
    background: #f8f9fa;
    border-top: 1px solid #eef0f2;
    border-bottom: 1px solid #eef0f2;
}

/* Keep dark sections restrained: solid charcoal with only a tiny tonal shift. */
.home-premium .home-section-dark {
    background: linear-gradient(135deg, #151719 0%, #1a1d20 100%);
}

.home-premium .home-growth-shell {
    background: linear-gradient(135deg, #15181b 0%, #191c20 100%);
}

/* Service landing pages already alternate sections; make the separation clearer but subtle. */
.service-section-soft {
    background: #f7f8fa;
    border-top: 1px solid #eef0f2;
    border-bottom: 1px solid #eef0f2;
}

.service-section-dark {
    background: linear-gradient(135deg, #171717 0%, #1c1d1f 100%);
}

/* Contact page: clear alternating surfaces without gradients on light areas. */
.contact-main {
    background: #f7f8fa;
    border-bottom: 1px solid #eceef1;
}

.contact-after {
    background: #fff;
}

/* Contact methods: replace text placeholders with actual icons. */
.contact-premium .contact-email-link::before {
    content: "" !important;
    background-color: rgba(255,107,0,.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6b00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
}

.contact-premium .contact-whatsapp-link::before {
    content: "" !important;
    background-color: rgba(37,211,102,.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2325d366' d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.198-.347.223-.644.074-.297-.149-1.255-.462-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479s1.065 2.876 1.213 3.074c.149.198 2.095 3.2 5.076 4.487.709.306 1.262.489 1.693.626.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.29.173-1.414-.074-.123-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.981.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.89-9.884 2.64.001 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.99c-.003 5.45-4.437 9.884-9.887 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.14 1.588 5.945L.056 24l6.3-1.654a11.882 11.882 0 0 0 5.69 1.448h.005c6.555 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 21px 21px;
    font-size: 0 !important;
}

/* Avoid visual gaps where two discreet surfaces meet. */
.home-premium .home-proof-bar,
.service-landing-proof {
    box-shadow: none;
}

@media (max-width: 991.98px) {
    .navbar .nav-link.site-nav-active::after {
        display: none;
    }

    .navbar .nav-link.site-nav-active {
        margin-top: .15rem;
        margin-bottom: .15rem;
        padding-left: .85rem;
        border-radius: 9px;
        background: rgba(255,107,0,.09);
        box-shadow: inset 3px 0 0 var(--color-main);
    }

    /* On tablets, content density matters more than forcing a full viewport per section. */
    .home-premium .home-section {
        min-height: auto;
        padding-top: 4.5rem;
        padding-bottom: 4.5rem;
    }

    .home-premium .home-display {
        font-size: clamp(2.5rem, 8vw, 4rem);
    }
}

@media (max-width: 575.98px) {
    .home-premium .home-hero,
    .service-landing-hero,
    .contact-hero {
        min-height: calc(100svh - var(--site-navbar-height));
    }

    .home-premium .home-hero-copy {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .site-whatsapp {
        right: 16px;
        bottom: 16px;
        width: 54px;
        height: 54px;
        min-height: 54px;
        padding: 0;
        justify-content: center;
    }

    .site-whatsapp span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .navbar .nav-link,
    .site-whatsapp {
        transition: none;
    }
}
