/*
 * Menú móvil (03-12-2026)
 * Panel propio que sustituye al desplegable móvil de Divi por debajo de 981px.
 * Lo construye js/mobile-menu.js a partir de los enlaces del menú principal y
 * del secundario, así que cualquier cambio hecho en Apariencia > Menús se
 * refleja solo. Todo va bajo .vdr-mm para no tocar el menú de escritorio.
 */

.vdr-mm {
    --mm-gold: #b89149;
    --mm-gold-d: #9a7838;
    --mm-dark: #3f3f3f;
    --mm-ink: #4a4a4a;
    --mm-muted: #6f6f6f;
    --mm-line: #e7e4de;
    --mm-soft: #f6f5f2;
    --mm-pad: 22px;
    --mm-ease: cubic-bezier(.22, .61, .36, 1);

    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100050;
    font-family: "Sora", "Segoe UI", sans-serif;
    color: var(--mm-ink);
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
}

.vdr-mm[hidden] {
    display: none;
}

.vdr-mm *,
.vdr-mm *::before,
.vdr-mm *::after {
    box-sizing: border-box;
}

.vdr-mm ul,
.vdr-mm li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vdr-mm p {
    margin: 0;
    padding: 0;
}

.vdr-mm a {
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* Neutraliza el estilo global de los botones del tema (píldora, mayúsculas, sombra). */
.vdr-mm button:hover {
    box-shadow: none;
    transform: none;
}

.vdr-mm button {
    font: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    transform: none;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.vdr-mm a:focus-visible,
.vdr-mm button:focus-visible {
    outline: 2px solid var(--mm-gold);
    outline-offset: 2px;
}

/* ---------- Fondo y panel ---------- */

.vdr-mm__backdrop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(32, 30, 26, .5);
    opacity: 0;
    transition: opacity .3s ease;
}

.vdr-mm__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    opacity: 0;
    transform: translate3d(28px, 0, 0);
    transition: transform .32s var(--mm-ease), opacity .24s ease;
    will-change: transform, opacity;
}

.vdr-mm.is-open .vdr-mm__backdrop {
    opacity: 1;
}

.vdr-mm.is-open .vdr-mm__panel {
    opacity: 1;
    transform: none;
}

/* ---------- Cabecera del panel ---------- */

.vdr-mm__top {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding: 10px 12px 10px var(--mm-pad);
    border-bottom: 1px solid var(--mm-line);
}

.vdr-mm__logo {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.vdr-mm__logo img {
    display: block;
    width: auto;
    height: auto;
    max-height: 46px;
    max-width: 190px;
}

.vdr-mm .vdr-mm__close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: var(--mm-dark);
    transition: background .2s ease, color .2s ease;
}

.vdr-mm .vdr-mm__close:hover,
.vdr-mm .vdr-mm__close:active {
    background: var(--mm-soft);
    color: var(--mm-gold-d);
}

.vdr-mm__close svg {
    width: 22px;
    height: 22px;
}

/* ---------- Zona con scroll ---------- */

.vdr-mm__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 6px var(--mm-pad) 28px;
}

.vdr-mm__eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0 6px !important;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--mm-gold-d);
}

.vdr-mm__eyebrow::before {
    content: "";
    flex: 0 0 auto;
    width: 24px;
    height: 2px;
    background: var(--mm-gold);
}

/* ---------- Acordeón de tratamientos ---------- */

.vdr-mm__group {
    border-bottom: 1px solid var(--mm-line);
}

.vdr-mm .vdr-mm__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 56px;
    padding: 12px 0;
    text-align: left;
    font-family: "Fraunces", Georgia, serif;
    font-size: 19px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: .005em;
    color: var(--mm-dark);
    transition: color .2s ease;
}

.vdr-mm .vdr-mm__toggle[aria-expanded="true"],
.vdr-mm .vdr-mm__group.is-current > .vdr-mm__toggle {
    color: var(--mm-gold-d);
}

.vdr-mm__chev {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--mm-line);
    border-radius: 50%;
    color: var(--mm-muted);
    transition: transform .3s var(--mm-ease), background .2s ease, border-color .2s ease, color .2s ease;
}

.vdr-mm__chev svg {
    width: 14px;
    height: 14px;
}

.vdr-mm__toggle[aria-expanded="true"] .vdr-mm__chev {
    transform: rotate(180deg);
    background: var(--mm-gold);
    border-color: var(--mm-gold);
    color: #fff;
}

.vdr-mm__sub {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows .32s var(--mm-ease), visibility 0s linear .32s;
}

.vdr-mm__sub.is-open {
    grid-template-rows: 1fr;
    visibility: visible;
    transition: grid-template-rows .32s var(--mm-ease), visibility 0s;
}

.vdr-mm__sub > ul {
    min-height: 0;
    overflow: hidden;
}

.vdr-mm__sub li:last-child {
    padding-bottom: 14px;
}

.vdr-mm__sub a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 9px 8px 9px 22px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.35;
    color: var(--mm-ink);
    transition: color .2s ease;
}

.vdr-mm__sub a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 10px;
    height: 1px;
    background: var(--mm-gold);
}

.vdr-mm__sub a:hover,
.vdr-mm__sub a:active,
.vdr-mm__sub a[aria-current="page"] {
    color: var(--mm-gold-d);
}

.vdr-mm__sub a[aria-current="page"] {
    font-weight: 600;
}

.vdr-mm__sub a.vdr-mm__all {
    font-weight: 600;
    color: var(--mm-dark);
}

/* ---------- Enlaces de la clínica ---------- */

.vdr-mm__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
}

.vdr-mm__links li {
    border-bottom: 1px solid var(--mm-line);
}

.vdr-mm__links a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--mm-dark);
    transition: color .2s ease;
}

.vdr-mm__links a:hover,
.vdr-mm__links a:active,
.vdr-mm__links a[aria-current="page"] {
    color: var(--mm-gold-d);
}

.vdr-mm__links a[aria-current="page"] {
    font-weight: 600;
}

.vdr-mm__addr {
    margin-top: 22px !important;
    font-size: 13px;
    line-height: 1.6;
    color: var(--mm-muted);
}

/* ---------- Pie fijo: cita y contacto ---------- */

.vdr-mm__foot {
    flex: 0 0 auto;
    padding: 14px var(--mm-pad) 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    background: var(--mm-soft);
    border-top: 1px solid var(--mm-line);
}

.vdr-mm a.vdr-mm__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 20px;
    border-radius: 999px;
    background: var(--mm-gold);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    transition: background .2s ease;
}

.vdr-mm a.vdr-mm__cta:hover,
.vdr-mm a.vdr-mm__cta:active {
    background: var(--mm-gold-d);
    color: #fff;
}

.vdr-mm__cta i {
    flex: 0 0 auto;
    font-size: 17px;
    line-height: 1;
}

.vdr-mm__contact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.vdr-mm__contact a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 8px 10px;
    border: 1px solid #d9d4ca;
    border-radius: 999px;
    background: #fff;
    color: var(--mm-dark);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color .2s ease, color .2s ease;
}

.vdr-mm__contact a:hover,
.vdr-mm__contact a:active {
    border-color: var(--mm-gold);
    color: var(--mm-gold-d);
}

.vdr-mm__contact i {
    flex: 0 0 auto;
    font-size: 15px;
    line-height: 1;
    color: var(--mm-gold-d);
}

.vdr-mm__contact i.fa-whatsapp {
    font-size: 18px;
}

/* ---------- Integración con la cabecera de Divi ---------- */

/* Con el panel listo, el desplegable original de Divi no se muestra nunca. */
html.vdr-mm-ready #main-header #mobile_menu,
html.vdr-mm-ready #main-header .et_mobile_menu {
    display: none !important;
}

html.vdr-mm-ready #et_mobile_nav_menu .mobile_menu_bar {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

html.vdr-mm-ready #et_mobile_nav_menu .mobile_menu_bar::before {
    color: #3f3f3f;
}

html.vdr-mm-ready #et_mobile_nav_menu .mobile_menu_bar:focus {
    outline: none;
}

html.vdr-mm-ready #et_mobile_nav_menu .mobile_menu_bar:focus-visible::before {
    outline: 2px solid #b89149;
    outline-offset: 3px;
    border-radius: 6px;
}

/* Bloqueo del scroll de la página mientras el panel está abierto. */
html.vdr-mm-open,
html.vdr-mm-open body {
    overflow: hidden !important;
}

/* Barra de administración de WordPress (solo usuarios con sesión). */
body.admin-bar .vdr-mm {
    top: 46px;
}

/* Pantallas muy estrechas. */
@media (max-width: 359px) {
    .vdr-mm {
        --mm-pad: 16px;
    }

    .vdr-mm .vdr-mm__toggle {
        font-size: 18px;
    }

    .vdr-mm__contact a {
        font-size: 13px;
    }
}

/* Tablet: panel lateral en lugar de pantalla completa. */
@media (min-width: 600px) {
    .vdr-mm__panel {
        width: 420px;
        box-shadow: -18px 0 48px rgba(32, 30, 26, .18);
    }
}

@media (min-width: 783px) {
    body.admin-bar .vdr-mm {
        top: 32px;
    }
}

/* Escritorio: el panel no existe. */
@media (min-width: 981px) {
    .vdr-mm {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vdr-mm__backdrop,
    .vdr-mm__panel,
    .vdr-mm__sub,
    .vdr-mm__sub.is-open,
    .vdr-mm__chev,
    .vdr-mm *,
    .vdr-mm *::before {
        transition: none !important;
    }

    .vdr-mm__panel {
        transform: none;
    }
}
