/* =============================================================================
   Hospital Website — Responsive System
   Breakpoints (mobile-first overrides via max-width):
     sm  ≤ 575px  — điện thoại nhỏ
     md  ≤ 767px  — điện thoại lớn / phablet
     lg  ≤ 1023px — tablet
     xl  ≤ 1199px — laptop nhỏ
   Desktop mặc định: ≥ 1200px (styles trong theme + pages)
   ============================================================================= */

/* ── Tablet & below (≤ 1023px) ── */
@media (max-width: 1023px) {
    :root {
        --header-height: 72px;
        --space-page: 1.5rem;
        --space-section: 2rem;
        --container-pad: 1rem;
    }

    .container { padding: 0 var(--container-pad); }

    /* Header & nav */
    .nav-toggle { display: flex; }

    .header-inner {
        min-height: var(--header-height);
        flex-wrap: wrap;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--color-white);
        border-top: 1px solid var(--color-border);
        box-shadow: var(--shadow);
        padding: 0.75rem;
        max-height: calc(100dvh - var(--header-height) - 36px);
        overflow-y: auto;
        z-index: 250;
        -webkit-overflow-scrolling: touch;
    }

    .main-nav.open { display: flex; }

    .nav-link {
        width: 100%;
        justify-content: space-between;
        font-size: 0.875rem;
        padding: 0.65rem 0.75rem;
        min-height: 44px;
        border-radius: 8px;
        letter-spacing: 0.03em;
    }

    .nav-dropdown.open > .nav-dropdown-toggle,
    .nav-dropdown:hover > .nav-dropdown-toggle {
        border-radius: 8px;
    }

    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0.35rem 0.35rem 0.5rem;
        margin: 0 0 0.35rem;
        background: var(--color-bg);
        border-radius: 10px;
        min-width: 0;
        width: 100%;
        left: auto;
        right: auto;
    }

    .main-nav > .nav-dropdown:nth-last-child(-n+3) > .nav-dropdown-menu {
        left: auto;
        right: auto;
        border-radius: 10px;
    }

    .main-nav > .nav-dropdown:nth-last-child(-n+3) .nav-submenu {
        left: auto;
        right: auto;
    }

    .nav-mega {
        border-radius: 10px;
        padding: 0.4rem 0.35rem 0.55rem;
        gap: 0.15rem;
    }

    .nav-dropdown.open > .nav-dropdown-menu,
    .nav-dropdown.open > .nav-mega {
        display: grid;
        grid-template-columns: 1fr;
    }

    .nav-mega.nav-mega--cols-2 {
        min-width: 0;
        width: 100%;
        max-width: none;
        grid-template-columns: 1fr;
        padding: 0.4rem 0.35rem 0.55rem;
    }

    .nav-mega-item,
    .nav-mega-item-btn {
        padding: 0.65rem 0.55rem;
        min-height: 44px;
        gap: 0.7rem;
    }

    .nav-mega-icon {
        width: 28px;
        height: 28px;
        border-radius: 8px;
    }

    .nav-mega-icon-img,
    .nav-mega-icon .nav-mega-icon-bi {
        width: 14px;
        height: 14px;
        font-size: 0.85rem;
    }

    .nav-mega-title {
        font-size: 0.9rem;
    }

    .nav-mega-desc {
        font-size: 0.78rem;
    }

    .nav-mega-item--parent {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-submenu {
        position: static;
        display: none;
        left: auto;
        top: auto;
        min-width: 0;
        width: 100%;
        box-shadow: none;
        border: none;
        background: rgba(0, 0, 0, 0.03);
        padding: 0.2rem 0.25rem 0.4rem 0.65rem;
        margin: 0 0 0.3rem;
    }

    .nav-mega-item--parent.open > .nav-submenu {
        display: block;
    }

    .nav-submenu::before { display: none; }

    .nav-chevron-right {
        transform: rotate(90deg);
    }

    .nav-mega-item--parent.open .nav-chevron-right {
        transform: rotate(-90deg);
    }

    .header-search-btn { margin-left: 0; }

    .brand {
        min-width: 0;
        max-width: calc(100% - 96px);
        gap: 0.5rem;
    }

    .brand-logo-img { height: 44px; }
    .brand-logo-mark svg { width: 40px; height: 40px; }
    .brand-name { font-size: 0.88rem; }
    .brand-tagline { font-size: 0.52rem; }

    /* Hero */
    .hero-carousel-viewport {
        aspect-ratio: 3 / 1;
    }

    .hero-carousel-img {
        object-position: right center;
    }

    .hero-carousel .hero-content {
        padding-top: 1.25rem;
        padding-bottom: 1rem;
    }

    .main-content .hero-float-actions {
        right: 0.75rem;
        bottom: 1.25rem;
    }

    /* Grids — 2 cột tablet */
    .card-grid-3,
    .card-grid-4 { grid-template-columns: repeat(2, 1fr); }

    .service-groups-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
    }

    .service-groups-all {
        margin-left: calc(2.35rem + 0.75rem);
        align-self: flex-start;
    }

    .home-news-categories .section-header,
    .home-featured-services .section-header,
    .home-experts .section-header,
    .home-news .section-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.5rem;
    }

    .news-block-inner {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.85rem;
    }

    .news-side-tab {
        font-size: 0.72rem;
        padding: 0.45rem 0.4rem;
    }

    .news-side-list {
        grid-template-rows: auto;
        height: auto;
    }

    .news-showcase {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.85rem;
    }

    .news-showcase .news-featured-card,
    .news-block-inner .news-featured-card {
        min-height: 280px;
    }

    .news-showcase-list {
        grid-template-rows: auto;
        height: auto;
    }

    .news-featured-card-body {
        padding: 0.95rem 1rem 1rem;
    }

    .expert-showcase {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .expert-featured-card {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        padding: 0;
        gap: 0;
    }

    .expert-featured-card-media {
        width: 100%;
        max-width: 220px;
        margin: 0 auto;
        border-radius: 0;
    }

    .expert-featured-card-summary {
        -webkit-line-clamp: 2;
    }

    .expert-featured-card-body {
        padding: 1rem;
    }

    .expert-showcase-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto;
        gap: 0.75rem;
        height: auto;
    }

    .expert-compact-card {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        gap: 0;
    }

    .expert-compact-card-media {
        width: 100%;
        border-radius: 0;
    }

    .expert-compact-card-body {
        padding: 0.65rem 0.7rem 0.75rem;
    }

    .expert-featured-card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .expert-featured-card-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .featured-service-slider {
        --svc-per-view: 2;
        --svc-gap: 1rem;
    }

    .service-group-slider {
        --svc-per-view: 2;
        --svc-gap: 0.75rem;
    }

    .partner-links-slider {
        --svc-per-view: 3;
    }

    .partner-ads-slider {
        --svc-per-view: 1.6;
    }

    .activity-media-slider {
        --svc-per-view: 2;
    }

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

    .featured-service-nav {
        width: 36px;
        height: 36px;
    }

    .featured-service-prev { left: 0.25rem; }
    .featured-service-next { right: 0.25rem; }

    .featured-service-card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .featured-service-card-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .service-group-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    /* Detail & profile */
    .detail-layout,
    .detail-layout-with-filters { grid-template-columns: 1fr; }

    .detail-sidebar { position: static; }

    .article-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        order: -1;
    }

    .profile-layout { grid-template-columns: 1fr; }

    .profile-appointment-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .profile-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .profile-panel-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .profile-panel-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .profile-panel {
        padding: 1rem;
    }

    .profile-appointment-title {
        font-size: 1rem;
    }

    .profile-nav {
        position: static;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.15rem;
        padding: 0.4rem;
    }

    .profile-nav::-webkit-scrollbar { display: none; }

    .profile-nav-item {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 0.55rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Filter panel — collapsible (tin tức + dịch vụ + chuyên gia) */
    .filter-panel-wrap {
        display: flex;
        flex-direction: column;
        order: -1;
    }

    .filter-panel-toggle {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        padding: 0.85rem 1rem;
        margin-bottom: 0.75rem;
        background: var(--color-white);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-sm);
        font-family: inherit;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--color-text);
        cursor: pointer;
        list-style: none;
        min-height: 44px;
    }

    .filter-panel-checkbox:checked + .filter-panel-toggle {
        border-color: var(--color-primary);
        background: var(--color-primary-light);
        color: var(--color-primary);
        margin-bottom: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .filter-panel-wrap > .detail-filter-panel {
        display: none;
    }

    .filter-panel-checkbox:checked ~ .detail-filter-panel {
        display: block;
        border-top: none;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        margin-bottom: 1rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }

    .footer-col--channels {
        grid-column: 1 / -1;
    }

    .booking-schedule {
        grid-template-columns: 1fr;
        gap: 1.15rem;
    }

    .booking-preset-cards {
        grid-template-columns: 1fr;
    }
}

/* ── Mobile landscape / large phone (≤ 767px) ── */
@media (max-width: 767px) {
    :root {
        --header-height: var(--header-height-compact);
        --space-page: 1.25rem;
        --space-section: 1.75rem;
    }

    body { font-size: 15px; }

    .featured-service-slider {
        --svc-per-view: 1;
    }

    .service-group-slider {
        --svc-per-view: 2;
    }

    .partner-links-slider {
        --svc-per-view: 2.15;
    }

    .partner-ads-slider {
        --svc-per-view: 1.2;
    }

    .activity-media-slider {
        --svc-per-view: 1.35;
    }

    /* Fixed bottom bar — ẩn: dùng float Đặt lịch | Hotline | Cấp cứu bên phải */
    .mobile-action-bar {
        display: none !important;
    }

    .main-content {
        padding-bottom: 0;
    }

    .site-footer {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    #blazor-error-ui {
        bottom: env(safe-area-inset-bottom, 0px);
    }

    /* Top bar */
    .top-bar { font-size: 0.75rem; }
    .top-bar-inner { min-height: 32px; }
    .top-bar-left { gap: 0.85rem; }
    .top-bar-right .lang-flags { gap: 0.25rem; }
    .lang-flag { font-size: 0.85rem; }

    /* Hero */
    .hero-carousel-viewport {
        aspect-ratio: 16 / 10;
        min-height: 260px;
        max-height: 360px;
    }

    .hero-carousel-img {
        object-position: 68% center;
    }

    .hero-carousel-overlay {
        background: linear-gradient(180deg, rgba(0, 28, 36, 0.55) 0%, rgba(0, 28, 36, 0.35) 45%, rgba(0, 28, 36, 0.5) 100%);
    }

    .hero-carousel .hero-content {
        justify-content: flex-end;
        padding-top: 0.75rem;
        padding-bottom: 1.75rem;
        gap: 0.15rem;
    }

    .hero-carousel .hero-eyebrow {
        margin-bottom: 0.35rem;
        padding: 0.22rem 0.6rem;
        font-size: 0.65rem;
    }

    .hero-carousel .hero-content h1 {
        font-size: clamp(1.15rem, 5vw, 1.45rem);
        line-height: 1.25;
    }

    .hero-carousel .hero-line {
        font-size: clamp(0.95rem, 4vw, 1.1rem);
    }

    .hero-carousel .hero-line--muted {
        font-size: 0.88rem;
    }

    .hero-carousel .hero-actions {
        margin-top: 0.65rem;
    }

    .hero-carousel .hero-actions .btn {
        min-height: 40px;
        padding: 0.45rem 0.9rem;
        font-size: 0.88rem;
    }

    .hero-carousel-nav { display: none; }

    .hero-carousel-dots {
        bottom: 0.45rem;
        padding: 0.28rem 0.5rem;
    }

    /* Float actions — giữ bên phải như desktop (thay bottom bar) */
    .main-content .hero-float-actions {
        display: flex;
        right: 0.65rem;
        bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
        gap: 0.5rem;
        z-index: 280;
    }

    .main-content .hero-float-actions .hero-float-btn {
        width: 36px;
        height: 36px;
        min-height: 36px;
        padding: 0;
        border-radius: 50%;
        font-size: 0.6rem;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    }

    .main-content .hero-float-actions .hero-float-btn .bi {
        font-size: 0.95rem;
    }

    /* Page layout — siết khoảng trống tiêu đề */
    .page-shell { padding: 1rem 0 1.75rem; }

    /* Chừa mép phải nhẹ — không ép hẹp stepper */
    .page-shell-booking .container {
        padding-right: var(--container-pad);
    }

    .page-shell-booking {
        padding-bottom: 5.5rem; /* tránh float che nút Tiếp tục */
    }
    .page-section { padding-top: 1.5rem; }

    .page-intro {
        margin-bottom: 0.85rem;
    }

    .breadcrumb {
        margin-bottom: 0.5rem;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        padding-bottom: 0.75rem;
    }

    .page-header-text {
        flex: none;
        width: 100%;
        min-width: 0;
    }

    .page-header-actions {
        width: 100%;
        gap: 0.5rem;
    }

    .page-header-actions .btn { flex: 1; }

    .page-title {
        font-size: clamp(1.3rem, 6vw, 1.55rem);
        margin-bottom: 0.3rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .page-header--catalog {
        margin-bottom: 0;
        gap: 0.35rem;
        padding-bottom: 0;
    }

    .catalog-head {
        margin-bottom: 1rem;
    }

    .catalog-head .page-intro {
        margin-bottom: 0.5rem;
    }

    .catalog-tools {
        padding: 0.75rem 0.8rem 0.85rem;
        gap: 0.65rem;
    }

    /* Chuyên mục: cuộn ngang gọn, không cắt mép */
    .catalog-tools .filter-bar,
    .filter-bar {
        margin: 0 -0.15rem;
        margin-bottom: 0;
        padding: 0.65rem 0.15rem 0.15rem;
        display: flex;
        flex-wrap: nowrap;
        gap: 0.4rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        overscroll-behavior-x: contain;
    }

    .catalog-tools .filter-bar::-webkit-scrollbar,
    .filter-bar::-webkit-scrollbar {
        display: none;
    }

    .catalog-tools .filter-chip,
    .filter-chip {
        flex: 0 0 auto;
        padding: 0.38rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.55rem;
        margin-bottom: 1.1rem;
    }

    .section-title {
        font-size: clamp(1.15rem, 5vw, 1.35rem);
    }

    .section-desc {
        font-size: 0.88rem;
    }

    .section-link {
        align-self: flex-start;
        font-size: 0.85rem;
    }

    /* Chuyên khoa home */
    .home-service-groups {
        padding: 1.1rem 0 1.75rem;
    }

    .service-groups-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
        margin-bottom: 0.85rem;
        padding-bottom: 0.75rem;
    }

    .service-groups-all {
        margin-left: calc(2.35rem + 0.75rem);
        align-self: flex-start;
        font-size: 0.85rem;
    }

    .service-groups-desc {
        font-size: 0.85rem;
    }

    /* Chuyên khoa — 2 cột / hàng cho gọn */
    .service-group-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .service-group-card {
        padding: 0 0 0.75rem;
    }

    .service-group-name {
        padding: 0.55rem 0.5rem 0.4rem;
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .service-group-hint { display: none; }

    /* Grids — 1 cột */
    .card-grid-2,
    .card-grid-3,
    .card-grid-4,
    .activity-detail-grid { grid-template-columns: 1fr; }

    .activity-lightbox {
        padding: 0.75rem;
    }

    .activity-lightbox-close,
    .activity-lightbox-nav {
        width: 38px;
        height: 38px;
    }

    .activity-lightbox-close { top: 0.55rem; right: 0.55rem; }
    .activity-lightbox-prev { left: 0.55rem; }
    .activity-lightbox-next { right: 0.55rem; }

    .activity-lightbox-image {
        max-height: calc(100vh - 120px);
    }

    .profile-family-grid { grid-template-columns: 1fr; }

    .profile-hub-grid { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }

    .hub-card { padding: 0.75rem 0.8rem; gap: 0.45rem; }

    /* Cards */
    .service-card,
    .expert-card,
    .news-card { padding: 1.15rem; }

    .service-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .service-card-actions {
        flex-direction: column;
        width: 100%;
    }

    .service-card-actions .btn { width: 100%; justify-content: center; }

    .expert-card-actions {
        flex-direction: column;
        width: 100%;
    }

    .expert-card-actions .btn { width: 100%; justify-content: center; }

    .expert-profile-header {
        grid-template-columns: 1fr;
        text-align: left;
        padding: 1rem;
        gap: 1.1rem;
    }

    .expert-profile-media {
        max-width: 280px;
        margin: 0 auto;
        width: 100%;
    }

    .expert-profile-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .expert-profile-actions .btn { width: 100%; justify-content: center; }

    .expert-career-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .news-card-horizontal { flex-direction: column; }

    /* Filter chips — cuộn ngang */
    .filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.15rem;
        margin-bottom: 1rem;
        gap: 0.4rem;
    }

    .filter-bar::-webkit-scrollbar { display: none; }

    .filter-chip {
        flex: 0 0 auto;
        padding: 0.38rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Forms & search */
    .form-grid { grid-template-columns: 1fr; }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .contact-map-frame {
        aspect-ratio: 16 / 12;
    }

    .catalog-search-row { flex-direction: column; }
    .catalog-search-input { min-width: 0; width: 100%; }
    .catalog-select { width: 100%; min-width: 0; }
    .catalog-search-row .btn { width: 100%; }

    .active-filters { flex-direction: column; align-items: flex-start; }
    .active-filter-clear {
        margin-left: 0;
        width: 100%;
        text-align: center;
        margin-top: 0.25rem;
    }

    /* Booking wizard — số bước đều + nhãn bước hiện tại bên dưới */
    .wizard-steps {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
        padding: 0.7rem 0.85rem;
        overflow: visible;
        position: relative;
    }

    .wizard-steps::before {
        content: "";
        position: absolute;
        left: 1.55rem;
        right: 1.55rem;
        top: 50%;
        height: 2px;
        background: var(--color-border);
        transform: translateY(-50%);
        z-index: 0;
        pointer-events: none;
    }

    .wizard-step {
        flex: 1 1 0;
        min-width: 0;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0;
        padding: 0;
        border: none !important;
        background: transparent !important;
        opacity: 1;
        position: relative;
        z-index: 1;
    }

    .wizard-step.active,
    .wizard-step.done {
        background: transparent !important;
    }

    .wizard-step-num {
        width: 28px;
        height: 28px;
        font-size: 0.78rem;
        background: var(--color-white);
        border: 2px solid var(--color-border);
        box-shadow: 0 0 0 3px var(--color-white);
    }

    .wizard-step.active .wizard-step-num {
        background: var(--color-primary);
        border-color: var(--color-primary);
        color: #fff;
    }

    .wizard-step.done .wizard-step-num {
        background: var(--color-success);
        border-color: var(--color-success);
        color: #fff;
    }

    .wizard-step-label {
        display: none;
    }

    .wizard-steps-current {
        display: block;
        margin: 0.55rem 0 1rem;
        text-align: center;
        font-size: 0.88rem;
        color: var(--color-muted);
    }

    .wizard-steps-current strong {
        color: var(--color-primary-dark, var(--color-primary));
        font-weight: 700;
    }

    .wizard-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .wizard-actions .btn { width: 100%; justify-content: center; }

    .page-shell-booking .booking-panel {
        padding: 1rem 0.95rem 1.1rem;
    }

    .page-shell-booking .booking-schedule {
        grid-template-columns: 1fr;
    }

    .time-slot-grid { grid-template-columns: repeat(3, 1fr); }

    .ticket-actions { flex-direction: column; align-items: stretch; }
    .ticket-actions .btn { width: 100%; justify-content: center; }

    /* CTA & auth */
    .cta-banner { padding: 2rem 0; }
    .cta-actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 320px; margin: 0 auto; }
    .cta-actions .btn { width: 100%; justify-content: center; }

    .auth-prompt-actions { flex-direction: column; align-items: stretch; }
    .auth-prompt-actions .btn { width: 100%; }

    .auth-card { padding: 1.5rem 1.25rem; }
    .auth-back { top: 0.75rem; left: 0.75rem; font-size: 0.85rem; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .footer-col--channels { grid-column: auto; }
    .partner-links-slider {
        --svc-per-view: 1.55;
    }
    .partner-ads-slider {
        --svc-per-view: 1.08;
    }
    .activity-media-slider {
        --svc-per-view: 1.08;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }
    .footer-bottom-mail { justify-content: center; }

    /* Error */
    .error-code { font-size: 4rem; }
    .error-actions { flex-direction: column; align-items: stretch; max-width: 280px; margin: 0 auto; }
    .error-actions .btn { width: 100%; justify-content: center; }

    /* Empty state */
    .empty-state { padding: 2rem 1rem; }
    .empty-state-icon .bi { font-size: 2.5rem; }

    /* Card panels */
    .card-panel { padding: 1.25rem; }
}

/* ── Small phone (≤ 575px) ── */
@media (max-width: 575px) {
    :root {
        --container-pad: 0.85rem;
        --space-page: 1rem;
    }

    /* Top bar — chỉ icon */
    .top-bar-item .top-bar-label { display: none; }
    .top-bar-left { gap: 0.65rem; }
    .top-bar-right .lang-flags .lang-flag:not(.active) { display: none; }

    /* Header compact */
    .brand-tagline { display: none; }
    .brand-name { font-size: 0.8rem; }
    .brand { max-width: calc(100% - 88px); }

    /* Search modal — gọn, không bị che bởi mobile action bar */
    .search-modal-backdrop {
        padding: 0.75rem var(--container-pad) calc(1rem + env(safe-area-inset-bottom, 0px));
        align-items: center;
        z-index: 1100;
    }

    .search-modal {
        border-radius: var(--radius-lg);
        max-height: min(78dvh, calc(100dvh - 2rem - env(safe-area-inset-bottom, 0px)));
        overflow-y: auto;
        padding: 1.15rem 1.1rem 1.25rem;
        width: 100%;
    }

    .search-modal-hint {
        margin-bottom: 0.85rem;
        font-size: 0.85rem;
    }

    .search-scope-tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
        margin-bottom: 0.9rem;
    }

    .search-scope-tab {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        padding: 0.55rem 0.35rem;
        min-height: 0;
        font-size: 0.78rem;
    }

    .search-scope-tab .bi {
        font-size: 1.1rem;
    }

    .search-modal-actions {
        flex-direction: row;
        justify-content: stretch;
        align-items: stretch;
        gap: 0.5rem;
        margin-top: 0.75rem;
        padding-top: 0.85rem;
    }

    .search-modal-actions .btn {
        flex: 1;
        width: auto;
        justify-content: center;
    }

    /* Hero contact strip */
    .hero-contact-strip {
        padding: 0.85rem 0 0.35rem;
    }

    .hero-contact-cell {
        align-items: flex-start;
        padding: 0.85rem 0.95rem;
        gap: 0.7rem;
    }

    .hero-contact-icon {
        margin-top: 0.05rem;
    }

    .hero-contact-label {
        margin-bottom: 0.25rem;
    }

    .hero-contact-text,
    .hero-contact-hours li,
    .hero-contact-phone-line strong { font-size: 0.82rem; }

    /* Service groups — giữ 2 cột trên màn hẹp hơn */
    .service-group-card { padding: 0 0 0.65rem; }
    .service-group-name { font-size: 0.85rem; padding: 0.5rem 0.4rem 0.35rem; }
    .service-group-more { min-height: 1.75rem; padding: 0.28rem 0.7rem; font-size: 0.7rem; }

    /* Profile hub */
    .profile-hub-grid { grid-template-columns: 1fr; }

    /* Buttons touch-friendly */
    .btn { min-height: 44px; }
    .btn-sm { min-height: 38px; padding: 0.45rem 0.75rem; }

    .wizard-step-num {
        width: 26px;
        height: 26px;
        font-size: 0.72rem;
    }

    .wizard-steps-current {
        font-size: 0.84rem;
        margin: 0.45rem 0 0.85rem;
    }

    .time-slot-grid { grid-template-columns: repeat(2, 1fr); }

    /* Ticket */
    .ticket-details div { flex-direction: column; gap: 0.15rem; align-items: flex-start; }
}

/* ── Hero contact strip — tablet (768px – 1199px) ── */
@media (min-width: 768px) and (max-width: 1199px) {
    .hero-contact-card {
        grid-template-columns: 1fr 1fr;
    }

    .profile-hub-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero-contact-cell {
        border-bottom: none;
        border-right: 1px solid var(--color-border);
        align-items: center;
        padding: 1rem 1.2rem;
    }

    .hero-contact-cell--phones {
        grid-column: 1 / -1;
        border-bottom: 1px solid var(--color-border);
        border-right: none;
    }

    .hero-contact-cell--phones .hero-contact-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 1.5rem;
        align-items: start;
    }

    .hero-contact-cell--phones .hero-contact-label {
        grid-column: 1 / -1;
    }

    .hero-contact-cell--address {
        border-right: none;
    }
}

/* ── Large desktop (≥ 1200px) — 3 ô ngang ── */
@media (min-width: 1200px) {
    :root {
        --container-pad: 1.25rem;
    }

    .container { padding: 0 var(--container-pad); }

    .hero-carousel .hero-content {
        padding-left: var(--container-pad);
        padding-right: var(--container-pad);
    }

    .hero-contact-card {
        grid-template-columns: minmax(14rem, 1.15fr) minmax(16rem, 1.35fr) minmax(14rem, 1.2fr);
        align-items: stretch;
    }

    .hero-contact-cell {
        border-bottom: none;
        border-right: 1px solid var(--color-border);
        padding: 1rem 1.35rem;
    }

    .hero-contact-cell:last-child {
        border-right: none;
    }

    .hero-contact-cell--phones .hero-contact-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 1.25rem;
        align-items: start;
    }

    .hero-contact-cell--phones .hero-contact-label {
        grid-column: 1 / -1;
    }

    .hero-contact-text,
    .hero-contact-hours li,
    .hero-contact-phone-line strong {
        font-size: 0.9rem;
    }

    .service-group-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }

    .service-group-card {
        padding: 0 0 1rem;
    }

    .featured-service-slider {
        --svc-per-view: 4;
        --svc-gap: 1.15rem;
    }

    .service-group-slider {
        --svc-per-view: 4;
        --svc-gap: 0.85rem;
    }

    .partner-links-slider {
        --svc-per-view: 6;
    }

    .partner-ads-slider {
        --svc-per-view: 3;
    }

    .activity-media-slider {
        --svc-per-view: 4;
    }

    .featured-service-prev { left: -0.55rem; }
    .featured-service-next { right: -0.55rem; }

    .expert-showcase {
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
        gap: 1.15rem;
    }

    .expert-showcase-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }
}

/* ── Desktop — filter panel luôn hiện, ẩn toggle ── */
@media (min-width: 1024px) {
    .filter-panel-wrap { display: contents; }
    .filter-panel-checkbox,
    .filter-panel-toggle { display: none !important; }
    .filter-panel-wrap > .detail-filter-panel { display: block !important; }

    .expert-showcase {
        gap: 1.25rem;
    }
}

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

    html { scroll-behavior: auto; }
}
