/* CENTRO MEDICO UCE V2 */
/* Final visual and responsive layer */

:root {
    --navy-deep: #081638;
    --green-dark: #326c46;
    --green: #7eb280;
    --wide: 1680px;
    --uce-header-height: 132px;
    --uce-dock-height: 76px;
}

html {
    scroll-padding-top: calc(var(--uce-header-height) + 18px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-size: 16px;
    line-height: 1.65;
}

#main-content {
    min-width: 0;
    overflow-wrap: break-word;
}

#main-content iframe {
    max-width: 100%;
}

.wide-container {
    width: min(94%,1680px);
}

.container {
    width: min(92%,1480px);
}

h1,h2,h3,h4 {
    overflow-wrap: break-word;
}

h1 {
    text-wrap: balance;
}

.section-heading {
    margin-bottom: clamp(24px,3vw,40px);
}

.section-heading p {
    line-height: 1.75;
}

/* Accessible controls */

a,button,input,select,textarea {
    -webkit-tap-highlight-color: transparent;
}

input,select,textarea {
    max-width: 100%;
    min-width: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #7eb280;
    outline-offset: 3px;
}

.btn {
    min-height: 48px;
    font-weight: 700;
}

.btn-light,
footer .btn-light {
    color: #081638 !important;
    background: #fff;
}

.btn-light:hover,
footer .btn-light:hover {
    color: #081638 !important;
    background: #cce2ce;
}

/* Main navigation */

.site-header {
    box-shadow: 0 4px 24px #08163808;
}

.site-topbar {
    background: #081638;
}

.navigation-shell {
    gap: clamp(12px,2vw,26px);
}

.site-brand {
    flex-shrink: 0;
}

.site-nav {
    min-width: 0;
}

.site-actions {
    flex-shrink: 0;
}

.nav-link {
    position: relative;
}

.nav-link.active,
.nav-link[aria-current="page"],
.nav-group.is-current > .nav-trigger {
    color: #326c46;
}

.nav-search,
.mobile-toggle {
    transition: background .2s,color .2s;
}

.nav-search:hover,
.mobile-toggle:hover {
    background: #e9f3e9;
    color: #326c46;
}

.nav-group.is-open .mega-menu {
    max-height: calc(100dvh - var(--uce-header-height) - 20px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mega-links > a > span:nth-child(2) {
    min-width: 0;
}

.mega-links strong {
    line-height: 1.35;
}

/* Home */

.cinema-copy h1,
body .cinema-copy h1 {
    color: white;
}

.cinema-copy h1 span {
    color: #b4dbb7;
}

.cinema-content > *,
.doctor-search > *,
.doctor-search-form > *,
.about-grid > *,
.specialty-grid > *,
.education-grid > *,
.access-grid > * {
    min-width: 0;
}

.doctor-search {
    box-shadow: 0 18px 55px #08163818;
}

.search-field input,
.search-field select {
    min-height: 32px;
}

.access-tile {
    gap: 25px;
}

body .access-navy h3,
body .access-navy p,
body .specialty-intro h2 {
    color: white;
}

body .service-caption h3 {
    color: white;
}

.service-caption > div {
    min-width: 0;
}

.service-caption h3 {
    overflow-wrap: anywhere;
}

/* Medical and institutional components */

.md-card,
.hm-doctor-card,
.ins-card,
.ct-channel,
.ct-hours-card,
.ct-department {
    min-width: 0;
}

.hm-doctor-card,
.md-card {
    overflow-wrap: anywhere;
}

.ins-card-image {
    min-width: 0;
}

.ins-card-image img {
    max-width: 100%;
    object-fit: contain;
}

/* Footer */

.main-footer {
    background: #081638;
}

body .main-footer h2,
body .main-footer h3 {
    color: white;
}

.footer-logo {
    padding: 0;
    width: 145px;
}

.footer-columns > * {
    min-width: 0;
}

.footer-links a {
    line-height: 1.5;
}

.footer-bottom {
    overflow-wrap: anywhere;
}

.main-footer {
    padding-bottom: max(120px,calc(var(--uce-dock-height) + 30px));
}

/* Floating quick access */

.patient-dock {
    bottom: calc(18px + env(safe-area-inset-bottom,0px));
}

.patient-dock:not(.is-visible) {
    visibility: hidden;
}

.patient-dock.is-visible {
    visibility: visible;
}

.uce-whatsapp {
    bottom: calc(25px + env(safe-area-inset-bottom,0px));
}

/* Smaller desktop and laptop */

@media (min-width:1051px) and (max-width:1250px) {
    .navigation-shell {
        gap: 12px;
    }

    .site-nav {
        gap: 12px;
    }

    .site-brand img {
        width: 110px;
    }

    .site-actions {
        gap: 8px;
    }

    .nav-link {
        font-size: .78rem;
    }

    .emergency-button {
        padding-inline: 12px;
        font-size: .78rem;
    }
}

/* Tablet */

@media (max-width:1050px) {
    .site-nav {
        max-height: calc(100dvh - var(--uce-header-height) - 12px);
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    .nav-group.is-open .mega-menu {
        max-height: none;
        overflow: visible;
    }

    .nav-link {
        white-space: normal;
        min-height: 48px;
    }

    .mega-links > a {
        padding: 12px 8px;
    }

    .footer-columns {
        gap: 30px;
    }

    .uce-whatsapp {
        width: 56px;
        height: 56px;
        min-height: 56px;
        padding: 0;
        justify-content: center;
        right: 16px;
        bottom: calc(var(--uce-dock-height) + 26px + env(safe-area-inset-bottom,0px));
    }

    .uce-wa-copy {
        display: none;
    }

    .uce-wa-icon {
        background: transparent;
    }
}

/* Phones */

@media (max-width:650px) {
    :root {
        --uce-header-height: 106px;
    }

    body {
        font-size: 15px;
    }

    .wide-container,
    .container {
        width: 92%;
    }

    .section {
        padding-block: 46px;
    }

    .section-heading {
        margin-bottom: 24px;
    }

    .section-heading p {
        font-size: .98rem;
    }

    h2 {
        font-size: clamp(1.9rem,7vw,2.7rem);
    }

    .navigation-shell {
        min-height: 70px;
        gap: 6px;
    }

    .topbar-inner {
        min-height: 32px;
    }

    .site-brand img {
        width: 88px;
        height: 58px;
    }

    .site-actions {
        gap: 6px;
    }

    /* Restore global search on mobile */
    .nav-search {
        display: grid;
        width: 44px;
        height: 44px;
    }

    .mobile-toggle {
        width: 44px;
        height: 44px;
    }

    .emergency-button {
        padding-inline: 10px;
        min-height: 44px;
        font-size: .72rem;
        gap: 5px;
    }

    .site-nav {
        padding: 12px;
    }

    .mega-links .icon-box {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .mega-links > a {
        gap: 10px;
    }

    .mega-links small {
        font-size: .78rem;
    }

    .cinema-shell {
        margin-top: 10px;
    }

    .cinema-hero {
        min-height: 590px;
        border-radius: 20px;
    }

    .cinema-content {
        padding: 28px 22px 85px;
    }

    .cinema-copy h1 {
        font-size: clamp(2.4rem,9vw,3.5rem);
        letter-spacing: -.045em;
    }

    .cinema-copy p {
        font-size: 1rem;
    }

    .cinema-label {
        max-width: 100%;
        line-height: 1.5;
    }

    .cinema-actions {
        align-items: flex-start;
    }

    .emergency-glass {
        padding: 13px;
        gap: 10px;
    }

    .doctor-search {
        width: 94%;
        padding: 18px;
    }

    .search-field input,
    .search-field select,
    input[type="search"],
    input[type="text"],
    input[type="email"] {
        font-size: 16px;
    }

    .access-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .access-tile {
        padding: 16px;
        min-height: 205px;
        gap: 20px;
    }

    .access-tile p {
        font-size: .85rem;
    }

    .about-sticker {
        max-width: 93%;
        gap: 8px;
    }

    .education-copy {
        padding: 28px;
    }

    .footer-cta {
        padding-block: 40px;
    }

    .footer-columns {
        padding-block: 40px;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 30px 16px;
    }

    .footer-brand {
        grid-column: 1/-1;
    }

    .footer-links h3 {
        line-height: 1.4;
    }

    .footer-links a {
        font-size: .88rem;
    }

    .patient-dock {
        display: grid;
        grid-template-columns: repeat(4,minmax(0,1fr)) 36px;
        width: min(95%,450px);
        padding: 6px;
        gap: 3px;
        bottom: calc(10px + env(safe-area-inset-bottom,0px));
    }

    .patient-dock a,
    .patient-dock button {
        min-width: 0;
        min-height: 49px;
        padding: 7px 2px;
        font-size: clamp(9px,2.5vw,12px);
        gap: 4px;
    }

    .patient-dock a svg,
    .patient-dock button svg {
        width: 19px;
        height: 19px;
    }

    .patient-dock span {
        white-space: nowrap;
    }

    .uce-whatsapp {
        right: 14px;
        width: 54px;
        height: 54px;
        min-height: 54px;
    }

    .slide-dots button.slide-pause {
        width: 44px;
        height: 44px;
    }
}

@media (max-width:375px) {
    .site-brand img {
        width: 76px;
    }

    .site-actions {
        gap: 4px;
    }

    .emergency-button {
        padding-inline: 8px;
        font-size: .67rem;
    }

    .emergency-button svg {
        width: 14px;
    }

    .cinema-content {
        padding-inline: 18px;
    }

    .access-tile {
        padding: 13px;
    }

    .access-tile h3 {
        font-size: 1rem;
    }

    .access-top {
        gap: 5px;
    }
}

/* Respect reduced motion preferences */

@media (prefers-reduced-motion: reduce) {
    .access-tile:hover,
    .uce-whatsapp:hover,
    .service-tile:hover img {
        transform: none;
    }
}