/**
Theme Name: Astra Child
Author: Brainstorm Force
Author URI: http://wpastra.com/about/
Description: Astra Child Theme for Anestesia Multimodal with Transparent Dynamic Navigation
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astra-child
Template: astra
*/

/* ==========================================================================
   CABECERA MODERNA DINÁMICA 2.0 (Anestesia Multimodal)
   ========================================================================== */

:root {
    --amm-header-h: 82px;
    --amm-orange: #e87830;
    --amm-orange-light: #f09050;
    --amm-orange-dark: #c46020;
    --amm-navy-dark: #0a0a0a;
    --amm-text: #334155;
    --amm-text-dark: #0f172a;
    --amm-border: #e2e8f0;
    --amm-bg-card: #f8fafc;
}

/* 1. Header Container Base (Sticky por defecto en páginas internas y al scroll) */
.cr-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--amm-header-h);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--amm-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cr-header__container {
    max-width: 1240px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

/* 2. Modo Transparente (Home sobre Video Hero) */
.cr-header--transparent:not(.is-scrolled) {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.8) 0%, rgba(10, 10, 10, 0.35) 60%, rgba(10, 10, 10, 0) 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

/* Intercambio de Logos Fluido */
.cr-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.cr-logo-img {
    height: 58px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: opacity 0.25s ease;
}

/* En reposo transparente: logo blanco activo */
.cr-header--transparent:not(.is-scrolled) .cr-logo-img--light {
    display: block !important;
}
.cr-header--transparent:not(.is-scrolled) .cr-logo-img--dark {
    display: none !important;
}

/* En modo sticky / sólido / páginas internas: logo a color activo */
.cr-logo-img--light {
    display: none !important;
}
.cr-logo-img--dark {
    display: block !important;
}

/* 3. Navegación Desktop */
.cr-header__nav {
    display: flex;
    align-items: center;
    flex-grow: 1;
    justify-content: center;
}

.cr-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cr-nav__item {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cr-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--amm-text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cr-nav__link:hover,
.cr-nav__item:hover > .cr-nav__link {
    color: var(--amm-orange);
    background: rgba(232, 120, 48, 0.08);
}

.cr-nav__arrow {
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.cr-nav__item:hover > .cr-nav__link .cr-nav__arrow {
    transform: rotate(180deg);
    color: var(--amm-orange);
}

/* Estilos de Enlaces en Modo Transparente sobre Video */
.cr-header--transparent:not(.is-scrolled) .cr-nav__link {
    color: #ffffff !important;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.cr-header--transparent:not(.is-scrolled) .cr-nav__link:hover,
.cr-header--transparent:not(.is-scrolled) .cr-nav__item:hover > .cr-nav__link {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

.cr-header--transparent:not(.is-scrolled) .cr-nav__arrow {
    color: #ffffff !important;
}

/* 4. Dropdowns Generales */
.cr-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #ffffff;
    border: 1px solid var(--amm-border);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10000;
}

.cr-dropdown::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.cr-nav__item:hover > .cr-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.cr-dropdown--courses {
    min-width: 320px;
    padding: 10px;
}

.cr-dropdown__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cr-dropdown__item {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cr-dropdown__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--amm-text-dark) !important;
    text-decoration: none;
    text-shadow: none !important;
    transition: all 0.18s ease;
}

.cr-dropdown__link:hover {
    background: #fff7ed;
    color: var(--amm-orange) !important;
    transform: translateX(3px);
}

.cr-dropdown__icon-box {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(232, 120, 48, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.cr-dropdown__link:hover .cr-dropdown__icon-box {
    background: rgba(232, 120, 48, 0.18);
    transform: scale(1.06);
}

.cr-dropdown__icon-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.cr-dropdown__name {
    flex-grow: 1;
}

/* 5. Badges */
.cr-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.cr-badge--green {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.cr-badge--hot {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.cr-badge--cyan {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
    border: 1px solid rgba(14, 165, 233, 0.25);
}

.cr-badge--orange {
    background: rgba(232, 120, 48, 0.12);
    color: var(--amm-orange);
    border: 1px solid rgba(232, 120, 48, 0.25);
}

.cr-badge--purple {
    background: rgba(147, 51, 234, 0.12);
    color: #7c3aed;
    border: 1px solid rgba(147, 51, 234, 0.25);
}

/* 6. Acciones Derecha (Botón CTA) */
.cr-header__actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.cr-btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #e87830 0%, #c46020 100%);
    color: #ffffff !important;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(232, 120, 48, 0.38);
    transition: all 0.25s ease;
}

.cr-btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 120, 48, 0.52);
    color: #ffffff !important;
}

/* 7. Botón Hamburguesa Móvil */
.cr-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid var(--amm-border);
    border-radius: 8px;
    cursor: pointer;
}

.cr-mobile-toggle__bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--amm-navy-dark);
    border-radius: 2px;
    transition: all 0.25s ease;
}

/* Hamburguesa en Modo Transparente */
.cr-header--transparent:not(.is-scrolled) .cr-mobile-toggle {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.cr-header--transparent:not(.is-scrolled) .cr-mobile-toggle__bar {
    background: #ffffff;
}

/* 8. Drawer Móvil Off-Canvas */
.cr-mobile-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    visibility: hidden;
    transition: visibility 0.3s ease;
}

.cr-mobile-drawer.is-open {
    visibility: visible;
}

.cr-mobile-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.65);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cr-mobile-drawer.is-open .cr-mobile-drawer__overlay {
    opacity: 1;
}

.cr-mobile-drawer__content {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 320px;
    max-width: 85vw;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);
}

.cr-mobile-drawer.is-open .cr-mobile-drawer__content {
    transform: translateX(0);
}

.cr-mobile-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--amm-border);
}

.cr-mobile-drawer__logo {
    height: 46px;
    width: auto;
}

.cr-mobile-drawer__close {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    display: flex;
}

.cr-mobile-drawer__body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.cr-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cr-mobile-nav__link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--amm-text-dark);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.cr-mobile-nav__link:hover {
    background: #fff7ed;
    color: var(--amm-orange);
}

/* Acordeón Móvil */
.cr-mobile-nav__accordion-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: transparent;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--amm-text-dark);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}

.cr-mobile-nav__accordion-btn svg {
    transition: transform 0.25s ease;
    opacity: 0.7;
}

.cr-mobile-nav__accordion.is-open .cr-mobile-nav__accordion-btn svg {
    transform: rotate(180deg);
}

.cr-mobile-nav__accordion-panel {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 8px 16px;
}

.cr-mobile-nav__accordion.is-open .cr-mobile-nav__accordion-panel {
    display: flex;
}

.cr-mobile-nav__sub-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    font-size: 14px;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
}

.cr-mobile-nav__sub-link:hover {
    background: #fff7ed;
    color: var(--amm-orange);
}

.cr-mobile-nav__icon-box {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(232, 120, 48, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cr-mobile-nav__icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.cr-mobile-nav__title {
    flex-grow: 1;
}

.cr-mobile-drawer__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--amm-border);
}

.cr-btn-cta--mobile {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
}

/* 9. Responsive Breakpoint */
@media (max-width: 991px) {
    .cr-header__nav {
        display: none;
    }
    .cr-mobile-toggle {
        display: flex;
    }
}

/* 10. Eliminación de Separación entre Cabecera y Hero / Contenido (Astra Flush Gap Reset) */
.site-content,
#content.site-content,
.site-content > .ast-container,
#primary,
.site-main,
.entry-content,
.rm-sc {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.rm-sc > .rm-section:first-child,
.rm-section--full:first-child {
    margin-top: 0 !important;
}
