/**
 * Public portal — mobile / tablet responsive overrides (all themes).
 * Loaded after theme CSS from layout.ejs.
 */

/* ── Global (themes 1–4) ───────────────────────────────────── */
.public-portal-theme .main-wrapper {
    overflow-x: clip;
}

.public-portal-theme img {
    max-width: 100%;
    height: auto;
}

.public-portal-theme .table-responsive-theme {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.public-portal-theme .footer .footer-qr-img {
    max-width: 180px;
    height: auto;
}

/* ── Tablet (≤991px) ───────────────────────────────────────── */
@media (max-width: 991.98px) {
    /* Custom home heroes (themes 2–4): content height, not full viewport */
    .public-portal-theme-2 #hero-section.public-home-hero,
    .public-portal-theme-3 #hero-section.public-home-hero,
    .public-portal-theme-4 #hero-section.public-home-hero {
        position: relative !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 !important;
    }

    .theme-modern-hero,
    .theme-care-hero {
        min-height: 0 !important;
        padding-top: 1rem;
        padding-bottom: 1.5rem;
    }

    .theme-bold-hero {
        min-height: min(70vh, 520px) !important;
    }

    .theme-modern-hero-visual {
        min-height: 220px;
    }

    .theme-care-hero-card {
        margin-left: 0.75rem;
        margin-right: 0.75rem;
    }

    .theme-care-hero-content {
        padding: 1.25rem;
    }

    .theme-bold-hero-inner {
        padding: 2rem 0;
    }

    /* Mobile header: sign-in + language flags beside hamburger */
    #main-header .navbar > .container-fluid {
        align-items: center;
    }

    #main-header .public-header-mobile-toolbar {
        margin-left: auto;
        justify-content: flex-end !important;
        flex-wrap: nowrap;
        gap: 6px;
        min-width: 0;
    }

    #main-header .public-header-mobile-toolbar > .d-flex {
        justify-content: flex-end !important;
    }

    #main-header .public-language-switcher {
        flex-wrap: nowrap;
    }

    /* Headers */
    .portal-theme-shell--care #main-header .navbar .navbar-collapse {
        max-height: min(70vh, 480px);
        overflow-y: auto;
        margin-top: 0.5rem;
    }

    .portal-theme-shell--care #main-header .navbar .navbar-nav {
        padding-bottom: 0.5rem;
    }

    /* Page intros */
    .theme-modern-page-hero,
    .care-page-intro,
    .bold-page-strip {
        padding-top: 1.5rem !important;
        padding-bottom: 1.25rem !important;
    }

    .theme-modern-page-title,
    .care-page-title,
    .bold-page-title {
        font-size: clamp(1.35rem, 5vw, 2rem) !important;
        word-wrap: break-word;
    }

    .care-page-lead,
    .bold-page-lead,
    .theme-modern-page-lead {
        font-size: 0.95rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Contact */
    .theme-modern-contact-section .container,
    .care-contact-container,
    .bold-contact-container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .theme-modern-contact-card .card-body {
        padding: 1.25rem !important;
    }

    .bold-form-panel .card-body {
        padding: 1.25rem !important;
    }

    /* Clinic / about splits */
    .theme-modern-clinic-contact-grid {
        grid-template-columns: 1fr;
    }

    .bold-about-split__text {
        padding: 2rem 1.25rem;
    }

    .bold-clinic-main {
        padding: 1.5rem 1.25rem 2rem;
    }

    .bold-clinic-sidebar {
        padding: 1.5rem 1.25rem;
    }

    .bold-detail-layout {
        grid-template-columns: 1fr;
    }

    .bold-detail-sidebar {
        padding: 1.5rem;
    }

    .bold-detail-main {
        padding: 1.5rem 1.25rem;
    }

    /* Fees */
    .bold-fees-layout .row {
        flex-direction: column;
    }

    .bold-fees-slider {
        max-width: 100%;
        margin-bottom: 1rem;
    }

    /* Orientation */
    .care-orientation-step {
        margin-left: 0;
        padding-left: 1rem;
    }

    /* Auth */
    .bold-auth-split-layout__brand {
        min-height: 120px;
        padding: 1.5rem 1rem;
    }

    .bold-auth-split-layout__brand h1 {
        font-size: 1.35rem;
    }

    .bold-auth-split-layout__form,
    .care-auth-page {
        padding: 1.25rem 1rem;
    }

    .theme-modern-auth-shell .parallax-container {
        min-height: auto !important;
        padding: 1.5rem 0;
    }

    /* Home appointment collapse */
    .public-portal-theme #home-make-appointment .card-body {
        padding: 1rem !important;
    }

    .public-portal-theme #home-make-appointment .row.mb-5 > .col-lg-3,
    .public-portal-theme #home-make-appointment .row.mb-5 > .col-lg-9 {
        margin-bottom: 1rem;
    }

    /* Footer */
    .theme-care-footer-shell .footer-top,
    .theme-bold-footer-shell .footer-top {
        padding-top: 2rem;
        padding-bottom: 1.5rem;
    }

    .theme-care-footer-shell .footer-widget,
    .theme-bold-footer-shell .footer-widget {
        text-align: center !important;
    }

    .theme-care-footer-shell .footer-menu ul,
    .theme-bold-footer-shell .footer-menu ul {
        padding-left: 0;
    }

    /* Vault */
    .public-portal-theme .user-tabs .nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .public-portal-theme .user-tabs .nav-link {
        white-space: nowrap;
        font-size: 0.85rem;
    }
}

/* ── Phone (≤767px) ────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .care-reason-grid,
    .bold-reason-columns {
        grid-template-columns: 1fr !important;
    }

    .care-chip-row {
        gap: 0.4rem;
    }

    .care-chip span,
    .bold-option span {
        font-size: 0.82rem;
        padding: 0.5rem 0.75rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .bold-band {
        padding: 1rem !important;
    }

    .bold-option-row {
        gap: 0.35rem;
    }

    .theme-care-service-card__actions,
    .theme-bold-service-card__actions,
    .theme-modern-service-card__actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }

    .theme-care-service-link,
    .theme-bold-service-link,
    .theme-modern-service-link {
        text-align: center;
        padding: 0.5rem;
    }

    .care-letter-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .care-letter-item__actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .care-news-list__link {
        flex-direction: column;
        gap: 0.35rem;
    }

    .care-news-list__link img {
        width: 100% !important;
        max-height: 160px;
        object-fit: cover;
        border-radius: 8px;
    }

    .bold-news-feed__row {
        padding: 0.85rem 0;
    }

    .bold-doc-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .bold-doc-row .btn {
        width: 100%;
    }

    .care-edu-video-row {
        align-items: flex-start;
    }

    .care-edu-video-row__title {
        font-size: 0.9rem;
    }

    .care-community-card {
        padding: 2rem 1.25rem !important;
    }

    .care-about-hero-img {
        border-radius: 0;
        min-height: 180px;
    }

    .care-quality-pills .nav {
        justify-content: flex-start !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.35rem;
    }

    .care-quality-pills .nav-link {
        white-space: nowrap;
        font-size: 0.85rem;
    }

    .bold-quality-nav .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bold-metric-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bold-fees-table {
        display: block;
        overflow-x: auto;
        font-size: 0.9rem;
    }

    .bold-orientation-row {
        grid-template-columns: 40px 1fr;
        padding: 1rem;
        gap: 0.75rem;
    }

    .bold-orientation-row__idx {
        font-size: 1.15rem;
    }

    .bold-orientation-row__dl {
        width: 100%;
        text-align: center;
    }

    /* Service detail */
    .theme-care-service-detail-shell .public-detail-page > .container.mb-5 .row,
    .theme-bold-service-detail-shell .public-detail-page > .container.mb-5 .row,
    .theme2-page-service-detail .public-detail-page > .container.mb-5 .row {
        flex-direction: column;
    }

    .theme-care-service-detail-shell #request_service,
    .theme-care-service-detail-shell #send_friend,
    .theme-bold-service-detail-shell #request_service,
    .theme-bold-service-detail-shell #send_friend,
    .theme2-page-service-detail #request_service,
    .theme2-page-service-detail #send_friend {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .theme-care-service-detail-shell .d-flex.justify-content-center,
    .theme-bold-service-detail-shell .d-flex.justify-content-center,
    .theme2-page-service-detail .d-flex.justify-content-center {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .theme2-page-service-detail .public-detail-page > .container.my-5 .h1 {
        font-size: clamp(1.35rem, 5vw, 1.75rem);
        text-align: center;
    }

    /* Theme 2 modern */
    .theme-modern-contact-panel {
        margin-bottom: 0.75rem;
    }

    .theme-modern-about-visual {
        min-height: 200px;
        margin-top: 1rem;
    }

    .theme-modern-newsletter-grid {
        grid-template-columns: 1fr;
    }

    .theme-modern-letter-card__actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Home services strip */
    .public-portal-theme #service-section .col-md-4,
    .public-portal-theme #service-section .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .public-portal-theme .theme-care-cta,
    .public-portal-theme .theme-bold-cta,
    .public-portal-theme .theme-modern-cta {
        width: 100%;
        text-align: center;
    }

    .theme-care-hero-content .theme-care-cta,
    .theme-bold-hero .theme-bold-cta {
        width: auto;
        max-width: 100%;
    }
}

/* ── Small phone (≤575px) ───────────────────────────────────── */
@media (max-width: 575.98px) {
    .portal-theme-shell--care #main-header .navbar .navbar-brand img,
    .portal-theme-shell--bold #main-header .navbar .navbar-brand img {
        max-height: 48px;
        width: auto;
    }

    .theme-bold-title {
        font-size: clamp(1.5rem, 7vw, 2rem) !important;
    }

    .bold-page-eyebrow,
    .care-page-eyebrow,
    .theme-modern-eyebrow {
        font-size: 0.7rem;
    }

    .theme-insurance-card__body,
    .theme-care-insurance-card__body,
    .theme-bold-insurance-card__body {
        padding: 0.85rem;
    }

    .care-price-line {
        flex-wrap: wrap;
    }

    .care-price-dots {
        display: none;
    }

    .care-price-amount {
        margin-left: auto;
    }

    .care-auth-frame {
        padding: 1rem;
        border-radius: 16px;
    }

    .theme-modern-detail-icon {
        font-size: 4rem;
    }
}

/* ── Theme 1 Classic extras ─────────────────────────────────── */
@media (max-width: 767.98px) {
    .public-portal-theme-1 .footer .col-lg-3 {
        text-align: center !important;
    }

    .public-portal-theme-1 .footer .d-flex.gap-2 {
        justify-content: center;
    }
}
