/**
Theme Name: Astra Child
Author: Brainstorm Force
Author URI: http://wpastra.com/about/
Description: Astra Child Theme for Anestesia Mérida with Modern 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 Mérida)
   ========================================================================== */

:root {
    --am-header-h: 82px;
    --am-teal: #009ca6;
    --am-teal-dark: #008088;
    --am-navy: #0a2540;
    --am-navy-dark: #07192c;
    --am-text: #334155;
    --am-text-dark: #0f172a;
    --am-border: #e2e8f0;
    --am-bg-card: #f8fafc;
}

/* 1. Header Container Base */
.cr-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--am-header-h);
    background: #ffffff;
    border-bottom: 1px solid var(--am-border);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cr-header.is-scrolled {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.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. Logo */
.cr-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.cr-logo-img {
    height: 56px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* 3. Navegación Central 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(--am-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(--am-teal);
    background: rgba(0, 156, 166, 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(--am-teal);
}

/* 4. Dropdowns Generales */
.cr-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #ffffff;
    border: 1px solid var(--am-border);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(10, 37, 64, 0.12);
    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--standard {
    min-width: 290px;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(10, 37, 64, 0.14);
}

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

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

.cr-dropdown__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.cr-dropdown__icon-box {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cr-dropdown__icon-box svg,
.cr-mobile-nav__icon-box svg {
    stroke: #ffffff !important;
    width: 20px;
    height: 20px;
}

.cr-dropdown__link:hover .cr-dropdown__icon-box {
    transform: scale(1.1) rotate(3deg);
}

.cr-dropdown__item-arrow {
    color: #94a3b8;
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.2s ease;
    margin-left: auto;
}

.cr-dropdown__link:hover .cr-dropdown__item-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Icon Box Palettes Vibrantes con Gradiente y Sombras */
.cr-dropdown__icon-box--teal,
.cr-mobile-nav__icon-box--teal {
    background: linear-gradient(135deg, #00c0ce 0%, #008899 100%);
    box-shadow: 0 4px 12px rgba(0, 192, 206, 0.38);
}
.cr-dropdown__link:hover .cr-dropdown__icon-box--teal {
    box-shadow: 0 6px 18px rgba(0, 192, 206, 0.55);
}
.cr-dropdown__item:has(.cr-dropdown__icon-box--teal) .cr-dropdown__link:hover {
    background: rgba(0, 192, 206, 0.09);
    color: #007380;
}
.cr-dropdown__item:has(.cr-dropdown__icon-box--teal) .cr-dropdown__link:hover .cr-dropdown__item-arrow {
    color: #008899;
}

.cr-dropdown__icon-box--amber,
.cr-mobile-nav__icon-box--amber {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.38);
}
.cr-dropdown__link:hover .cr-dropdown__icon-box--amber {
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.55);
}
.cr-dropdown__item:has(.cr-dropdown__icon-box--amber) .cr-dropdown__link:hover {
    background: rgba(245, 158, 11, 0.09);
    color: #b45309;
}
.cr-dropdown__item:has(.cr-dropdown__icon-box--amber) .cr-dropdown__link:hover .cr-dropdown__item-arrow {
    color: #d97706;
}

.cr-dropdown__icon-box--green,
.cr-mobile-nav__icon-box--green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.38);
}
.cr-dropdown__link:hover .cr-dropdown__icon-box--green {
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.55);
}
.cr-dropdown__item:has(.cr-dropdown__icon-box--green) .cr-dropdown__link:hover {
    background: rgba(16, 185, 129, 0.09);
    color: #047857;
}
.cr-dropdown__item:has(.cr-dropdown__icon-box--green) .cr-dropdown__link:hover .cr-dropdown__item-arrow {
    color: #059669;
}

.cr-dropdown__icon-box--blue,
.cr-mobile-nav__icon-box--blue {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.38);
}

.cr-dropdown__icon-box--purple,
.cr-mobile-nav__icon-box--purple {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.38);
}

.cr-dropdown__icon-img {
    width: 20px;
    height: 20px;
    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(0, 156, 166, 0.12);
    color: #009ca6;
    border: 1px solid rgba(0, 156, 166, 0.25);
}

.cr-badge--gold {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

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

/* 6. Acciones Derecha (CTA & Hamburguesa Móvil) */
.cr-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cr-btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: linear-gradient(135deg, #009ca6 0%, #0a2540 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 12px rgba(0, 156, 166, 0.28);
    transition: all 0.25s ease;
}

.cr-btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 156, 166, 0.42);
    color: #ffffff !important;
}

.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(--am-border);
    border-radius: 8px;
    cursor: pointer;
}

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

/* 7. 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, 37, 64, 0.55);
    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.15);
}

.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(--am-border);
}

.cr-mobile-drawer__logo {
    height: 44px;
    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;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--am-text-dark);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.cr-mobile-nav__link:hover {
    background: #f0fdfa;
    color: var(--am-teal);
}

/* 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(--am-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: #f8fafc;
    color: var(--am-teal);
}

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

.cr-mobile-drawer__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--am-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

/* 9. 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;
}
