/* ============================================================
   CRECEMOS — Header personalizado
   ============================================================ */

:root {
    --cr-header-h: 124px;
}

/* Offset global por el header fijo */
body { padding-top: var(--cr-header-h); }

/* Hero full-bleed — arranca desde el tope, detrás del header */
.cr-hero { margin-top: calc(-1 * var(--cr-header-h)); }

/* Ocultar header de Elementor */
[data-id="5e07be7"] { display: none !important; }

/* ── Estructura ──────────────────────────────────────────── */
.cr-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.58);
    transition: background-color 0.3s ease-in-out;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
}

.cr-header.header-scrolled { background-color: #000; }

/* Grid: logo | nav (centrado) | actions */
.cr-header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    height: var(--cr-header-h);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 56px;
}

/* Logo */
.cr-header__logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    justify-self: start;
    height: 100%;
}

.cr-header__logo {
    height: 52px;
    width: auto;
    display: block;
}

/* Nav — centrado en su columna; items full-height para hover correcto */
.cr-header__nav {
    justify-self: center;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.cr-nav__list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 36px;
    height: 100%;
    align-items: center;
}

/* Items full-height: hover area grande + dropdown se abre al pie del header */
.cr-nav__list > li {
    margin: 0;
    padding: 0;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Submenús: ocultos por defecto, visibles al hover */
.cr-nav__list .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: #111;
    border-top: 2px solid #E30723;
    padding: 8px 0;
    list-style: none;
    margin: 0;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.cr-nav__list > li:hover > .sub-menu { display: block; }

.cr-nav__list .sub-menu > li {
    height: auto;
    display: block;
    padding: 0;
}

.cr-nav__list .sub-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 13px;
    white-space: nowrap;
    letter-spacing: 0.03em;
}

.cr-nav__list .sub-menu a:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
}

.cr-nav__list a {
    font-family: var(--cr-font-titulo);
    font-size: 14px;
    font-weight: 200;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    letter-spacing: 0.04em;
    white-space: nowrap;
    transition: color 0.18s;
}

.cr-nav__list a:hover,
.cr-nav__list .current-menu-item > a,
.cr-nav__list .current-page-ancestor > a { color: #fff; }

/* Actions: CTA + Social */
.cr-header__actions {
    display: flex;
    align-items: center;
    gap: 22px;
    justify-self: end;
}

.cr-header__cta {
    display: inline-block;
    padding: 10px 28px;
    border: 1px solid #E30723;
    color: rgba(255, 255, 255, 0.9) !important;
    font-family: var(--cr-font-titulo);
    font-size: 14px;
    font-weight: 200;
    letter-spacing: 0.06em;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.18s;
}

.cr-header__cta:hover { background: #E30723; color: #fff !important; }

/* Social */
.cr-header__social {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cr-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    line-height: 0;
    transition: color 0.18s, transform 0.18s;
}

.cr-social-link svg {
    width: 22px;
    height: 22px;
}

.cr-social-link:hover { color: #fff; transform: translateY(-1px); }

/* Hamburger */
.cr-header__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.cr-header__toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform 0.25s, opacity 0.25s;
    transform-origin: center;
}

.cr-header__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cr-header__toggle.is-open span:nth-child(2) { opacity: 0; }
.cr-header__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.cr-header__mobile {
    display: none;
    flex-direction: column;
    background: #000;
    padding: 24px 32px 36px;
    border-top: 1px solid rgba(255,255,255,0.1);
    overflow-y: auto;
    max-height: calc(100dvh - var(--cr-header-h));
}

.cr-header__mobile.is-open { display: flex; }

.cr-mobile-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Top-level items: flex row so chevron se pega a la derecha */
.cr-mobile-nav__list > li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cr-mobile-nav__list > li > a { flex: 1; }

/* Sub-items: sin borde propio */
.cr-mobile-nav__list .sub-menu li { border-bottom: none; }

/* Sub-menú oculto por defecto; JS añade .is-open */
.cr-mobile-nav__list .sub-menu {
    display: none;
    width: 100%;
    padding: 4px 0 10px;
    list-style: none;
    margin: 0;
}
.cr-mobile-nav__list .sub-menu.is-open { display: block; }

.cr-mobile-nav__list a {
    display: block;
    padding: 15px 0;
    font-family: var(--cr-font-titulo);
    font-size: 17px;
    font-weight: 200;
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: color 0.18s;
}

.cr-mobile-nav__list a:hover { color: #fff; }

/* Sub-menú links: indentados y algo más pequeños */
.cr-mobile-nav__list .sub-menu a {
    font-size: 14px;
    padding: 10px 0 10px 16px;
    color: rgba(255,255,255,0.62);
}
.cr-mobile-nav__list .sub-menu a:hover { color: #fff; }

/* Chevron toggle */
.cr-mobile-submenu-toggle {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.45);
    padding: 14px 4px;
    display: flex;
    align-items: center;
    transition: color 0.18s, transform 0.25s;
}
.cr-mobile-submenu-toggle.is-open {
    transform: rotate(180deg);
    color: rgba(255,255,255,0.9);
}

.cr-header__social--mobile {
    margin-top: 24px;
    gap: 20px;
}

.cr-header__social--mobile .cr-social-link { color: rgba(255,255,255,0.7); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
    .cr-header__inner { padding: 0 32px; }
    .cr-nav__list { gap: 24px; }
    .cr-header__actions { gap: 16px; }
}

/* Tablet / laptop pequeño — ocultar nav, mostrar hamburger */
@media (max-width: 860px) {
    :root { --cr-header-h: 78px; }

    .cr-header__inner {
        display: flex;
        padding: 0 24px;
    }

    .cr-header__logo { height: 38px; }

    .cr-header__nav,
    .cr-header__actions { display: none; }

    .cr-header__toggle { display: flex; }
}

@media (max-width: 480px) {
    :root { --cr-header-h: 68px; }

    .cr-header__logo { height: 32px; }

    .cr-header__mobile { padding: 20px 20px 28px; }
    .cr-mobile-nav__list a { font-size: 16px; padding: 13px 0; }
}
