/*
 * Vigour V62 — unified responsive layer for every public-facing page.
 * Loaded last by layouts.public so it safely normalizes legacy page widths.
 */
:root {
    --vg-public-max: 1360px;
    --vg-public-pad: clamp(14px, 3vw, 48px);
    --vg-section-space: clamp(38px, 5vw, 76px);
}

html {
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    width: 100%;
    min-width: 320px;
    overflow-x: clip;
}

.vg-page-wrapper {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.vg-main-column {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    flex: 1 1 auto;
}

#main-content {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: clip;
}

#main-content > section,
#main-content > div {
    max-width: 100%;
}

/* One consistent content width across Bootstrap and custom public pages. */
#main-content .container,
#main-content .container-fluid {
    width: min(100%, var(--vg-public-max));
    max-width: var(--vg-public-max);
    margin-inline: auto;
    padding-inline: var(--vg-public-pad);
}

#main-content .container-fluid {
    width: 100%;
    max-width: none;
}

#main-content .hm-container,
#main-content .prv-container,
#main-content .provider-container,
#main-content .inv-wrap,
#main-content .st-hero-inner,
#main-content .st-main,
#main-content .pr-plans-container,
#main-content .cl-container,
#main-content .clinics-container,
#main-content .services-container,
#main-content .service-category-container,
#main-content .ai-shell__inner {
    width: 100%;
    max-width: var(--vg-public-max);
    margin-inline: auto;
    padding-inline: var(--vg-public-pad);
}

/* Prevent grid/flex children and long Arabic/English content from overflowing. */
#main-content :where(
    .row,
    [class*="grid"],
    [class*="layout"],
    [class*="wrapper"],
    [class*="content"],
    [class*="body"],
    [class*="card"],
    [class*="panel"],
    [class*="column"]
) > * {
    min-width: 0;
}

#main-content :where(p, li, dd, address, strong, a, span) {
    overflow-wrap: anywhere;
}

#main-content img,
#main-content video,
#main-content svg,
#main-content canvas,
#main-content iframe {
    max-width: 100%;
}

#main-content img,
#main-content video {
    height: auto;
}

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

#main-content input,
#main-content select,
#main-content textarea,
#main-content button {
    max-width: 100%;
    font-family: inherit;
}

#main-content input,
#main-content select,
#main-content textarea {
    font-size: 16px;
}

#main-content textarea {
    resize: vertical;
}

#main-content :where(h1, .page-title, .hero-title) {
    font-size: clamp(32px, 4.4vw, 64px);
    line-height: 1.12;
}

#main-content :where(h2, .section-title) {
    line-height: 1.25;
}

/* Stable wrapping for filters, actions, pagination and Swiper controls. */
#main-content :where(
    .filters,
    .filter-bar,
    .toolbar,
    .actions,
    .form-actions,
    .pagination
) {
    max-width: 100%;
    flex-wrap: wrap;
}

#main-content .swiper,
#main-content .swiper-wrapper,
#main-content .swiper-slide {
    min-width: 0;
    max-width: 100%;
}

#main-content .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

/* Keep public cards visually consistent without changing their brand colors. */
#main-content :where(
    .card,
    .provider-card,
    .inv-card,
    .feature-card,
    .vg-card,
    .vg-policy
) {
    background-clip: padding-box;
}

/* Tablet */
@media (max-width: 991.98px) {
    :root {
        --vg-public-pad: clamp(14px, 3.5vw, 28px);
    }

    #main-content :where(
        .hero-grid,
        .content-grid,
        .details-grid,
        .contact-grid,
        .booking-grid
    ) {
        grid-template-columns: 1fr;
    }

    #main-content .inv-filter {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #main-content .inv-filter input,
    #main-content .inv-filter select,
    #main-content .inv-filter button {
        width: 100%;
        min-width: 0;
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    :root {
        --vg-public-pad: 14px;
        --vg-section-space: 38px;
    }

    body {
        min-width: 0;
    }

    #main-content :where(section, .section) {
        scroll-margin-top: 78px;
    }

    #main-content .row {
        --bs-gutter-x: 1rem;
    }

    #main-content :where(
        .form-grid,
        .vg-form-grid,
        .inv-filter,
        .contact-grid,
        .booking-grid
    ) {
        grid-template-columns: 1fr;
    }

    #main-content :where(
        .btn,
        [class*="-btn"],
        button[type="submit"],
        input[type="submit"]
    ) {
        min-height: 44px;
    }

    #main-content .pagination {
        justify-content: center;
        gap: 5px;
    }

    #main-content .pagination .page-link {
        min-width: 40px;
        min-height: 40px;
        display: grid;
        place-items: center;
    }

    #main-content table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

/* Small phones */
@media (max-width: 479.98px) {
    :root {
        --vg-public-pad: 12px;
    }

    #main-content :where(.card, [class*="-card"], .vg-policy) {
        max-width: 100%;
    }

    #main-content :where(.modal-dialog, .offcanvas, [role="dialog"]) {
        max-width: calc(100vw - 16px);
        margin-inline: auto;
    }
}

/* Accessibility and browser compatibility. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@supports not (overflow: clip) {
    body,
    #main-content {
        overflow-x: hidden;
    }
}
