/* ==========================================================================
   CRISTCAM — Layout compartido: header y footer.
   Se carga DESPUÉS del CSS de cada página.
   ========================================================================== */

/* El header es fijo: el contenido parte debajo de él en todas las páginas.
   (!important neutraliza los márgenes antiguos de cada página) */
body {
    margin-top: 0 !important;
    padding-top: var(--header-h);
}

body.index-page {
    padding-top: 0;
}

body.menu-open {
    overflow: hidden;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform 0.2s;
}

.skip-link:focus {
    transform: none;
}

/* ==========================================================================
   Header
   Barra blanca arriba; al hacer scroll se transforma en una cápsula flotante.
   El logo siempre va a color. El fondo con desenfoque vive en ::before para
   que el menú móvil (position: fixed) no quede atrapado dentro del header.
   ========================================================================== */

.site-header {
    --hdr-bg: rgba(255, 255, 255, 0.92);
    --hdr-border: rgba(14, 16, 20, 0.07);
    --hdr-fg: var(--fg);
    --hdr-muted: var(--muted);
    --hdr-hover: rgba(14, 16, 20, 0.05);
    --hdr-active-bg: var(--primary-50);
    --hdr-active-fg: var(--primary-dark);
    --hdr-chip: var(--primary-50);
    --hdr-panel: #fff;
    --hdr-line: var(--line);

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-h);
    transition: top 0.5s var(--ease), left 0.5s var(--ease), right 0.5s var(--ease), height 0.5s var(--ease);
}

.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-bottom: 1px solid var(--hdr-border);
    background: var(--hdr-bg);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    transition: border-radius 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.4s, background-color 0.4s;
}

/* Header flotante al hacer scroll: se despega y se vuelve una cápsula */
.site-header.is-scrolled:not(.is-open) {
    top: 12px;
    left: max(12px, calc((100% - 1200px) / 2));
    right: max(12px, calc((100% - 1200px) / 2));
    height: 64px;
}

.site-header.is-scrolled:not(.is-open)::before {
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    box-shadow: 0 18px 40px -16px rgba(14, 16, 20, 0.28), 0 2px 6px rgba(14, 16, 20, 0.04);
}

.site-header.is-scrolled:not(.is-open) .site-header__inner {
    width: 100%;
    padding: 0 10px 0 24px;
}

.site-header.is-scrolled:not(.is-open) .site-header__logo img {
    height: 34px;
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 100%;
}

.site-header__logo {
    flex-shrink: 0;
    display: flex;
}

.site-header__logo img {
    width: auto;
    height: 40px;
    transition: height 0.5s var(--ease);
}

/* Navegación */
.site-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.site-nav__list {
    display: flex;
    gap: 4px;
    list-style: none;
}

.site-nav__list a {
    position: relative;
    display: block;
    padding: 9px 16px;
    border-radius: 999px;
    color: var(--hdr-fg);
    font: 500 15px/1 var(--font-body);
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.site-nav__list a:hover {
    background: var(--hdr-hover);
}

.site-nav__list a.active {
    color: var(--hdr-active-fg);
    background: var(--hdr-active-bg);
}

.site-nav__footer {
    display: none;
}

/* Acciones */
.site-header__actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.site-header__phone {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--hdr-fg);
    font: 600 14px/1.2 var(--font-body);
    text-decoration: none;
    transition: color 0.2s;
}

.site-header__phone small {
    display: block;
    color: var(--hdr-muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.site-header__phone-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--hdr-chip);
    color: var(--primary);
    font-size: 14px;
}

.site-header__phone:hover {
    color: var(--primary);
}

.site-header__toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    border: 1px solid var(--hdr-line);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.site-header__toggle span {
    position: absolute;
    left: 13px;
    right: 13px;
    height: 2px;
    border-radius: 2px;
    background: var(--hdr-fg);
    transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}

.site-header__toggle span:first-child {
    top: 17px;
}

.site-header__toggle span:last-child {
    top: 24px;
}

.site-header__toggle[aria-expanded="true"] span:first-child {
    top: 21px;
    transform: rotate(45deg);
}

.site-header__toggle[aria-expanded="true"] span:last-child {
    top: 21px;
    transform: rotate(-45deg);
}

@media (max-width: 1200px) {
    .site-header__phone {
        display: none;
    }
}

/* Menú móvil */
@media (max-width: 992px) {
    .site-header__inner {
        justify-content: space-between;
    }

    .site-header__logo img {
        height: 34px;
    }

    .site-header__toggle {
        display: block;
    }

    .site-header.is-open::before {
        background: var(--hdr-panel);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .site-nav {
        position: fixed;
        inset: var(--header-h) 0 0;
        flex-direction: column;
        justify-content: space-between;
        padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
        background: var(--hdr-panel);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-12px);
        transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
        overflow-y: auto;
    }

    .site-header.is-open .site-nav {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .site-nav__list {
        flex-direction: column;
        gap: 0;
    }

    .site-nav__list li {
        border-bottom: 1px solid var(--hdr-line);
    }

    .site-nav__list a {
        padding: 18px 4px;
        border-radius: 0;
        font: 700 clamp(1.7rem, 7vw, 2.2rem)/1.1 var(--font-display);
        letter-spacing: -0.035em;
    }

    .site-nav__list a:hover,
    .site-nav__list a.active {
        background: none;
    }

    .site-nav__list a.active {
        color: var(--primary);
    }

    .site-nav__footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-top: 32px;
    }

    .site-nav__contact {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        height: 52px;
        border: 1px solid var(--hdr-line);
        border-radius: 999px;
        color: var(--hdr-fg);
        font-weight: 600;
        text-decoration: none;
    }

    .site-nav__contact .fa-whatsapp {
        color: #25d366;
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .site-header__cta {
        display: none;
    }
}

/* ==========================================================================
   Footer
   Franja de brochure · columnas (marca, empresa, servicios, contacto,
   horario) · barra inferior. Fondo claro y logo a color.
   ========================================================================== */

.site-footer {
    padding: clamp(40px, 5vw, 56px) 0 0;
    border-top: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 15px;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: var(--primary);
}

/* Franja de brochure */
.site-footer__brochure {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 440px);
    align-items: center;
    gap: 16px 32px;
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.site-footer__brochure-text {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-footer__brochure-icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 6px;
    background: var(--primary-50);
    color: var(--primary);
    font-size: 18px;
}

.site-footer__brochure h2 {
    color: var(--ink);
    font: 700 1.1rem/1.3 var(--font-display);
    letter-spacing: -0.015em;
}

.site-footer__brochure p {
    margin-top: 2px;
    font-size: 14px;
}

.site-footer__form {
    display: flex;
    gap: 8px;
}

.site-footer__form input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #d6d9df;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: 400 15px var(--font-body);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.site-footer__form input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(242, 116, 5, 0.15);
}

.site-footer__form .ui-btn {
    height: 46px;
    padding: 0 18px;
    font-size: 14.5px;
}

.site-footer__success {
    display: none;
    grid-column: 1 / -1;
    color: #146c3b;
    font-size: 14px;
}

/* Columnas */
.site-footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 1fr 1.2fr 1fr;
    gap: 40px 32px;
    padding: clamp(40px, 5vw, 56px) 0;
}

.site-footer__logo img {
    width: auto;
    height: 38px;
}

.site-footer__brand p {
    max-width: 300px;
    margin: 18px 0 20px;
    font-size: 14.5px;
    line-height: 1.7;
}

.site-footer__social {
    display: flex;
    gap: 8px;
}

.site-footer__social a {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--fg);
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.site-footer__social a:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.site-footer__heading {
    margin-bottom: 16px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
}

.site-footer__col ul {
    display: grid;
    gap: 10px;
    list-style: none;
    font-size: 14.5px;
}

.site-footer__contact li {
    display: flex;
    gap: 10px;
    line-height: 1.5;
    word-break: break-word;
}

.site-footer__contact i {
    width: 14px;
    margin-top: 4px;
    color: var(--primary);
    font-size: 12px;
}

.site-footer__hours > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.site-footer__hours > div:first-child {
    padding-top: 0;
}

.site-footer__hours dd {
    color: var(--ink);
    font-weight: 600;
    white-space: nowrap;
}

/* Barra inferior */
.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding: 20px 0 calc(20px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    font-size: 13.5px;
}

@media (max-width: 1100px) {
    .site-footer__grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .site-footer__brand {
        grid-column: 1 / -1;
    }

    .site-footer__brand p {
        max-width: 520px;
    }
}

@media (max-width: 760px) {
    .site-footer__brochure {
        grid-template-columns: 1fr;
    }

    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px 24px;
    }
}

@media (max-width: 420px) {
    .site-footer__form {
        flex-direction: column;
    }

    .site-footer__form input {
        flex: none;
    }
}
