/* Global base + header. Loaded on every page.
   La fuente Montserrat se carga vía <link> en el <head> (header.php).
   Tema: clínica dental — claro, menta/teal, fresco. */

:root {
    /* Paleta principal (tema claro menta/teal) */
    --bg:#e9f6f3;              /* fondo menta muy claro */
    --bg-soft:#f4fbf9;
    --surface:#ffffff;        /* tarjetas / superficies */
    --primary:#0fb5a4;        /* teal principal (acento, botones) */
    --primary-dark:#0c9c8d;   /* teal hover */
    --mint:#bfe9de;           /* menta clara para detalles */
    --ink:#123330;            /* texto principal (verde petróleo oscuro) */
    --ink-soft:#5d736e;       /* texto secundario */

    /* Alias de compatibilidad (nombres usados por el resto del sitio) */
    --bg-dark:#0e2a27;
    --blue-cobalt:var(--primary);
    --blue-hover:var(--primary-dark);
    --text-white:var(--ink);      /* ahora "texto principal" sobre claro */
    --text-gray:var(--ink-soft);
    --fg:var(--ink);
    --accent:#0ea295;
    --accent-soft:#0a857a;        /* acento de texto con buen contraste */
    --silver:#cdd3da;
    --silver-bright:#ffffff;
    --navy:#0e2a27;
    --navy-deep:#0a201d;
    --royal:#0fb5a4;
    --royal-line:#37cdbd;
    --rule:rgba(15,181,164,.35);
}
* { box-sizing: border-box; }
body {
    margin:0;
    min-height:100vh;
    display:flex;
    flex-direction:column;
    font-family: 'Montserrat', system-ui, sans-serif;
    background:
        radial-gradient(1200px 600px at 50% -10%, #ffffff 0%, rgba(255,255,255,0) 60%),
        linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%) fixed;
    color:var(--fg);
    line-height:1.6;
}
a { color:var(--accent); }
main { flex:1 0 auto; width:100%; max-width:1000px; margin:0 auto; padding:2.5rem 2rem; }

/* ---------- Header ---------- */
.site-header {
    background-color: var(--surface);
    border-bottom: 1px solid rgba(15, 181, 164, 0.18);
    padding: 12px 0;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 6px 22px rgba(18, 60, 56, 0.08);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo (wordmark provisional hasta tener el logo real) */
.header-logo a {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    text-decoration: none;
}
.header-logo__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 6px 16px rgba(15, 181, 164, 0.35);
}
.header-logo__mark svg { width: 26px; height: 26px; display: block; }
.header-logo__text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    font-family: 'Montserrat', sans-serif;
}
.header-logo__text strong {
    color: var(--ink);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: .01em;
}
.header-logo__text span {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* Menú de navegación */
.header-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 28px;
}
.header-nav .nav-link {
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}
.header-nav .nav-link:hover,
.header-nav .nav-link.active {
    color: var(--primary-dark);
}

/* Botón de reserva (CTA) */
.btn-book {
    background-color: var(--primary);
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 12px 24px;
    border-radius: 999px;
    box-shadow: 0 4px 15px rgba(15, 181, 164, 0.4);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    display: inline-block;
    /* Pulso de atención cada 5s para que el paciente note el botón. */
    animation: btn-book-pulse 5s ease-in-out infinite;
}
.btn-book:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 6px 20px rgba(15, 181, 164, 0.55);
    transform: translateY(-1px);
}
.btn-book:active { transform: translateY(1px); }
.btn-book:hover,
.btn-book:focus-visible { animation: none; }

@keyframes btn-book-pulse {
    0%   { box-shadow: 0 4px 15px rgba(15, 181, 164, 0.4), 0 0 0 0 rgba(15, 181, 164, 0.55); }
    8%   { box-shadow: 0 6px 20px rgba(15, 181, 164, 0.55), 0 0 0 6px rgba(15, 181, 164, 0.25); }
    18%  { box-shadow: 0 4px 15px rgba(15, 181, 164, 0.4), 0 0 0 16px rgba(15, 181, 164, 0); }
    100% { box-shadow: 0 4px 15px rgba(15, 181, 164, 0.4), 0 0 0 0 rgba(15, 181, 164, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .btn-book { animation: none; }
}

/* ---------- Menú hamburguesa (oculto en escritorio) ---------- */
.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    cursor: pointer;
}
.nav-burger span {
    display: block;
    width: 26px;
    height: 3px;
    border-radius: 3px;
    background: var(--ink);
    transition: transform .25s ease, opacity .25s ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .header-container { flex-wrap: wrap; }
    .nav-burger { display: flex; margin-left: auto; }
    .header-nav,
    .header-cta {
        flex-basis: 100%;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height .3s ease, opacity .3s ease, padding .3s ease;
    }
    .header-nav ul { flex-direction: column; align-items: center; gap: 18px; }
    .header-cta { text-align: center; }
    .nav-toggle:checked ~ .header-nav { max-height: 360px; opacity: 1; padding-top: 18px; }
    .nav-toggle:checked ~ .header-cta { max-height: 120px; opacity: 1; padding-top: 16px; }
    .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
    .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ---------- Submenú desplegable (dropdown) ---------- */
.header-nav .nav-item { position: relative; }
.header-nav .nav-caret {
    display: inline-block;
    margin-left: .35rem;
    font-size: .7em;
    vertical-align: middle;
    transition: transform .25s ease;
}
.header-nav .has-submenu:hover .nav-caret,
.header-nav .has-submenu:focus-within .nav-caret { transform: rotate(180deg); }

.header-nav .submenu {
    display: block;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 190px;
    margin: 0;
    padding: .4rem;
    list-style: none;
    background: var(--surface);
    border: 1px solid rgba(15, 181, 164, 0.2);
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(18, 60, 56, 0.14);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    z-index: 1100;
}
/* Puente invisible para que no se cierre al bajar el mouse hacia el panel. */
.header-nav .submenu::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}
.header-nav .has-submenu:hover .submenu,
.header-nav .has-submenu:focus-within .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.header-nav .submenu li { width: 100%; }
.header-nav .submenu-link {
    display: block;
    padding: .55rem .8rem;
    border-radius: 8px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}
.header-nav span.submenu-link { cursor: default; }
.header-nav .submenu-link:hover { background: var(--mint); color: var(--primary-dark); }

/* En móvil el submenú se muestra estático, indentado bajo "Services". */
@media (max-width: 768px) {
    .header-nav .nav-caret { display: none; }
    .header-nav .submenu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        min-width: 0;
        margin: .35rem 0 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
    }
    .header-nav .submenu::before { display: none; }
    .header-nav .submenu-link { color: var(--ink-soft); text-align: center; }
}
