/* Shared phone and tablet refinements for the complete website. */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-width: 0;
    overflow-x: hidden;
}

img,
video {
    max-width: 100%;
}

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

.mobile-menu-toggle {
    display: none;
}

.book-label-short {
    display: none;
}

@media (max-width: 900px) {
    .topbar,
    .navbar {
        top: 0;
    }

    .topbar .book-btn,
    .topbar .book,
    .topbar .home-btn,
    .navbar .book-btn {
        min-height: 44px;
        line-height: 1.2;
    }

    /* Homepage */
    .navbar-container {
        position: relative;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 42px auto !important;
        gap: 0.45rem;
        padding: 0 0.65rem !important;
    }

    .navbar .nav-menu {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 0;
        border: 1px solid rgba(233, 30, 99, 0.22);
        border-radius: 10px;
        background: #fff;
        color: #111432;
        cursor: pointer;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
        transition: transform 0.22s ease, opacity 0.22s ease;
    }

    .mobile-menu-toggle.is-open span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .mobile-menu-toggle.is-open span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.is-open span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .navbar .nav-menu.is-mobile-open {
        position: absolute;
        top: calc(100% + 0.55rem);
        left: 0.75rem;
        right: 0.75rem;
        display: flex !important;
        max-height: calc(100vh - 100px);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        overflow-y: auto;
        padding: 0.65rem;
        border: 1px solid rgba(233, 30, 99, 0.14);
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 20px 48px rgba(17, 20, 50, 0.18);
    }

    .navbar .nav-menu > li {
        width: 100%;
    }

    .navbar .nav-menu > li > a,
    .navbar .nav-dropdown-toggle {
        display: flex;
        width: 100%;
        min-height: 46px;
        align-items: center;
        justify-content: space-between;
        padding: 0.72rem 0.85rem;
        border-radius: 9px;
        font-size: 0.86rem !important;
        text-align: left;
    }

    .navbar .nav-menu > li > a:hover,
    .navbar .nav-dropdown-toggle:hover {
        background: rgba(233, 30, 99, 0.07);
    }

    .navbar .nav-submenu {
        position: static !important;
        width: 100% !important;
        display: none;
        transform: none !important;
        margin: 0.15rem 0 0.45rem !important;
        padding: 0.35rem 0.45rem 0.35rem 1rem !important;
        border: 0 !important;
        border-left: 2px solid #e91e63 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .navbar .nav-dropdown.is-open .nav-submenu {
        display: block;
    }

    .navbar .nav-submenu a {
        min-height: 42px;
        display: flex;
        align-items: center;
    }

    .navbar .brand-logo {
        width: min(34vw, 150px) !important;
        height: 64px !important;
    }

    .navbar .book-btn {
        justify-self: end;
        flex: 0 0 auto;
        padding: 0.65rem 0.72rem !important;
        font-size: 0.67rem !important;
    }

    .hero#home {
        width: 100%;
        min-height: 0 !important;
        aspect-ratio: 16 / 9;
        padding: 0 !important;
    }

    .hero#home .hero-background-film {
        object-fit: contain;
        object-position: center;
    }

    .pillars {
        grid-template-columns: 1fr !important;
        margin: 0 auto 2rem !important;
        padding: 1.25rem 1rem 2rem !important;
        gap: 1rem !important;
        background: #fff !important;
    }

    .pillar-card {
        min-height: 0 !important;
        padding: 2rem 1.4rem !important;
    }

    .digital-profile,
    .locations {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .digital-profile-frame {
        padding: 2rem 1.35rem 2rem 1.55rem !important;
        border-radius: 16px !important;
    }

    .social-profile-links {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .social-profile-link {
        justify-content: center;
        min-height: 48px;
    }

    .treatments {
        padding: 3.5rem 1rem !important;
    }

    .treatments-grid,
    .locations-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .treatment-content,
    .location-card {
        padding: 1.5rem !important;
    }

    .diagnostic-overview,
    .experience-section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .diagnostic-list {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .diagnostic-item::before {
        display: none !important;
    }

    .experience-panel {
        padding: 2rem 1.25rem !important;
        border-radius: 18px !important;
    }

    .experience-cta {
        padding: 2rem 1.35rem !important;
    }

    .contact-panel {
        padding: 2rem 1.25rem !important;
        margin-bottom: 3rem !important;
    }

    .footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center !important;
    }

    /* Inner-page headers */
    body > .topbar {
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: 0.65rem !important;
        padding: 0.7rem 0.85rem !important;
    }

    body > .topbar .page-title {
        min-width: 0;
        font-size: 0.92rem !important;
        line-height: 1.25;
    }

    body > .topbar .home-link,
    body > .topbar > .home,
    body > .topbar .nav {
        display: none !important;
    }

    body > .topbar .book-btn,
    body > .topbar .book,
    body > .topbar .home-btn {
        padding: 0.7rem 0.8rem !important;
        font-size: 0.7rem !important;
        white-space: nowrap;
    }

    body > .topbar .brand {
        width: min(52vw, 230px) !important;
        height: 58px !important;
    }

    /* Equipment */
    .equipment-list {
        gap: 3rem !important;
    }

    .equipment {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1.75rem !important;
    }

    .equipment:nth-child(even) .equipment-media {
        order: 0 !important;
    }

    .equipment-media {
        width: min(100%, 360px) !important;
        border-radius: 18px !important;
    }

    .capability-grid {
        grid-template-columns: 1fr !important;
    }

    /* Treatments */
    .treatment-index {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .treatment {
        grid-template-columns: 1fr !important;
        gap: 1.75rem !important;
    }

    .treatment:nth-child(even) .treatment-media {
        order: 0 !important;
    }

    /* Reviews and gallery */
    .reviews {
        grid-template-columns: 1fr !important;
    }

    .flow-gallery {
        touch-action: pan-y;
    }
}

@media (max-width: 600px) {
    .book-label-full { display: inline !important; }
    .book-label-short { display: none !important; }

    .navbar .brand-logo {
        width: min(32vw, 135px) !important;
        height: 60px !important;
    }

    .navbar .book-btn {
        padding: 0.6rem 0.58rem !important;
        font-size: 0.63rem !important;
    }

    .section-header {
        margin-bottom: 2rem !important;
    }

    .section-header h2,
    .digital-profile h2,
    .experience-panel h2,
    .diagnostic-overview h2 {
        font-size: 1.85rem !important;
        line-height: 1.2 !important;
    }

    .treatment-image {
        height: auto !important;
        aspect-ratio: 4 / 3;
    }

    .counter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 1.5rem 0 !important;
    }

    .counter-item {
        padding: 0 0.8rem !important;
    }

    .counter-item:nth-child(odd) {
        padding-left: 0 !important;
        border-left: 0 !important;
    }

    .counter-number {
        font-size: 2.15rem !important;
    }

    .contact-submit,
    .experience-button,
    .explore-treatments-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .location-phone {
        width: 100%;
    }

    footer {
        padding: 2.5rem 1rem !important;
    }

    body > .topbar .page-title {
        font-size: 0.82rem !important;
    }

    body > .topbar .book-btn,
    body > .topbar .book,
    body > .topbar .home-btn {
        padding: 0.62rem 0.65rem !important;
        font-size: 0.64rem !important;
    }

    body > .topbar .brand {
        width: min(48vw, 175px) !important;
        height: 52px !important;
    }

    body > main,
    .diagnostic-content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .intro h1,
    .hero-copy h1 {
        font-size: clamp(2.15rem, 11vw, 3.2rem) !important;
        letter-spacing: -0.035em !important;
    }

    .service {
        grid-template-columns: 38px minmax(0, 1fr) !important;
        gap: 0.85rem !important;
    }

    .service p {
        grid-column: 2 !important;
    }

    .equipment-copy h2,
    .treatment-copy h2,
    .capability-head h2,
    .closing h2 {
        font-size: clamp(1.8rem, 9vw, 2.5rem) !important;
    }

    .equipment-media {
        width: min(88vw, 330px) !important;
    }

    .capability-card,
    .detail {
        padding: 1.25rem !important;
    }

    .treatment-index,
    .detail-grid {
        grid-template-columns: 1fr !important;
    }

    .treatment-index a {
        min-height: 68px !important;
    }

    .treatment-media {
        aspect-ratio: 4 / 3 !important;
        min-height: 0 !important;
        border-radius: 14px !important;
    }

    .top {
        display: grid !important;
        gap: 0.3rem !important;
    }

    .date {
        white-space: normal !important;
    }

    .card {
        min-height: 0 !important;
        padding: 1.35rem !important;
    }

    .source {
        padding: 1.35rem !important;
    }

    .branch-tabs {
        grid-template-columns: 1fr !important;
    }

    .flow-gallery {
        min-height: 330px !important;
        margin-inline: -1rem;
    }

    .flow-card {
        width: 78vw !important;
        border-width: 4px !important;
    }

    .flow-card[data-position="-1"] {
        transform: translateX(-54vw) scale(.75) !important;
    }

    .flow-card[data-position="1"] {
        transform: translateX(54vw) scale(.75) !important;
    }

    .flow-card[data-position="-2"],
    .flow-card[data-position="2"],
    .flow-card[data-position="-3"],
    .flow-card[data-position="3"] {
        opacity: 0 !important;
    }

    .article {
        padding: 2.5rem 1rem 4rem !important;
    }

    .article h2 {
        font-size: 1.75rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
