/**
 * Sitewide mobile / small-screen fixes (public theme).
 * Loaded after pharmaone-brand.css on every public page.
 */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.po-site {
    overflow-x: clip;
    max-width: 100%;
}

body.po-site .box-layout {
    overflow-x: clip;
    max-width: 100%;
}

body.po-site img,
body.po-site video,
body.po-site iframe,
body.po-site svg:not(.po-icon-fixed) {
    max-width: 100%;
    height: auto;
}

body.po-site .container,
body.po-site .container-fluid,
body.po-site .container-lg,
body.po-site .container-xl,
body.po-site .container-xxl {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}

body.po-site section,
body.po-site .section,
body.po-site .po-section {
    overflow-x: clip;
}

body.po-site .row {
    --bs-gutter-x: 1.25rem;
}

body.po-site [class*="col-"] {
    min-width: 0;
}

body.po-site h1,
body.po-site .h1,
body.po-site h2,
body.po-site .h2 {
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

body.po-site .table-responsive,
body.po-site .po-table-scroll,
body.po-site .dataTables_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

body.po-site table {
    max-width: 100%;
}

body.po-site .btn,
body.po-site button.po-btn,
body.po-site a.btn {
    min-height: 44px;
}

body.po-site .pharmaone-nav .navbar-toggler {
    min-width: 44px;
    min-height: 44px;
}

/* Kill glass/blur on phones — solid, readable chrome */
@media (max-width: 1199.98px) {
    body.po-site .page-layout {
        display: contents;
    }

    body.po-site .navbar-modern-inner,
    body.po-site .navbar-full-screen-menu-inner,
    body.po-site .navbar-show-modern-bg,
    body.po-site .navbar-toggler-clone,
    body.po-site #navbarNav-clone {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    body.po-site.navbar-collapse-show .box-layout,
    body.po-site.navbar-collapse-show .page-layout,
    body.po-site.navbar-collapse-show .pharmaone-site-header,
    body.po-site.navbar-collapse-show .navbar {
        transform: none !important;
        translate: none !important;
    }

    body.po-site .box-layout {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
        isolation: isolate;
    }

    body.po-site.po-menu-open .box-layout > *:not(.pharmaone-site-header):not(script):not(style) {
        pointer-events: none;
    }

    body.po-site:has(.po-mobile-dock) .box-layout,
    body.po-site:has(.contact-mobile-dock) .box-layout {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    body.po-site .po-mobile-dock,
    body.po-site .contact-mobile-dock,
    body.po-site .po-mobile-backdrop,
    body.po-site #pharmaOneFooter2026 .p1f26-grid {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        filter: none !important;
    }

    body.po-site .po-mobile-dock,
    body.po-site .contact-mobile-dock,
    body.po-site .po-mobile-add-more {
        z-index: 1045 !important;
    }

    body.po-site .po-back-to-top {
        z-index: 1040 !important;
    }

    body.po-site.po-menu-open .po-mobile-dock,
    body.po-site.po-menu-open .contact-mobile-dock,
    body.po-site.po-menu-open .po-back-to-top {
        opacity: 0.35;
        pointer-events: none !important;
    }

    body.po-site #pharmaOneFooter2026 {
        position: relative;
        z-index: 1;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.po-site .po-menu-order .navbar-collapse:not(#navbarNav) {
        display: none !important;
    }

    body.po-site .po-mobile-dock,
    body.po-site .contact-mobile-dock {
        background: #ffffff !important;
        border: 1px solid rgba(11, 74, 122, .14) !important;
        box-shadow: 0 12px 32px rgba(6, 42, 70, .16) !important;
    }

    body.po-site #pharmaOneFooter2026 .p1f26-grid {
        background: #ffffff !important;
    }

    body.po-site #pharmaOneFooter2026 .p1f26-hero-logo {
        filter: none !important;
    }
}

/* Home & corporate cards */
body.po-site .home-stat-grid,
body.po-site .po-stat-grid,
body.po-site .home-capability-grid,
body.po-site .home-production-grid,
body.po-site .po-card-grid,
body.po-site .po-grid-2,
body.po-site .po-grid-3,
body.po-site .po-grid-4 {
    display: grid;
    gap: 1rem;
}

@media (max-width: 991.98px) {
    body.po-site .home-stat-grid,
    body.po-site .po-stat-grid,
    body.po-site .po-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.po-site .po-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.po-site .po-hero-title,
    body.po-site .home-hero-title {
        font-size: clamp(1.65rem, 6vw, 2.35rem) !important;
        line-height: 1.15 !important;
    }

    body.po-site .po-hero-actions,
    body.po-site .home-hero-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.po-site .po-hero-actions .btn,
    body.po-site .home-hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    body.po-site #pharmaOneFooter2026 {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body.po-site .p1f26-footer-grid,
    body.po-site .footer-widget-group,
    body.po-site #pharmaOneFooter2026 .p1f26-grid,
    body.po-site .po-credentials-grid {
        grid-template-columns: 1fr !important;
    }

    body.po-site .po-credential-card {
        width: 100% !important;
        min-height: auto !important;
    }

    body.po-site .po-price-hero-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.po-site .po-product-grid,
    body.po-site .products-grid {
        grid-template-columns: 1fr !important;
    }

    body.po-site .pharma-interactive-book .profile-reader-shell,
    body.po-site .pharma-interactive-book .profile-reader-layout {
        flex-direction: column !important;
        min-height: 0 !important;
    }

    body.po-site .pharma-interactive-book .profile-reader-sidebar,
    body.po-site .pharma-interactive-book .profile-thumb-rail {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto !important;
    }

    body.po-site .pharma-interactive-book .profile-reader-stage {
        min-height: min(62vh, 520px) !important;
        height: auto !important;
    }

    body.po-site .pharma-interactive-book .profile-reader-bottom {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
    }

    body.po-site .pharma-interactive-book .profile-reader-toolbar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    body.po-site .home-stat-grid,
    body.po-site .po-stat-grid,
    body.po-site .home-capability-grid,
    body.po-site .home-production-grid,
    body.po-site .po-card-grid,
    body.po-site .po-grid-2,
    body.po-site .po-grid-3,
    body.po-site .po-grid-4 {
        grid-template-columns: 1fr !important;
    }

    body.po-site .po-inline-actions,
    body.po-site .po-hero-meta {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    body.po-site .po-split-layout,
    body.po-site .po-two-col {
        grid-template-columns: 1fr !important;
    }

    body.po-site .pharma-interactive-book .profile-reader-stage {
        min-height: min(52vh, 420px) !important;
    }
}

body.po-site .pharmaone-nav,
body.po-site .po-back-to-top {
    max-width: 100%;
}

/* Page-specific mobile safety nets */
@media (max-width: 991.98px) {
    body.po-site .po-cart-layout,
    body.po-site .po-verify-layout,
    body.po-site .distribution-map-shell,
    body.po-site .gallery-masonry,
    body.po-site .po-products-toolbar {
        max-width: 100%;
        overflow-x: clip;
    }

    body.po-site .po-cart-row {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.po-site:has(.po-mobile-add-more) .box-layout {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 767.98px) {
    body.po-site .hero-media-slider,
    body.po-site .hero-media-slider .carousel,
    body.po-site .hero-media-slider .carousel-inner,
    body.po-site .hero-media-slider .carousel-item,
    body.po-site .hero-media-slide,
    body.po-site .po-team-hero,
    body.po-site .po-page-hero {
        min-height: min(72vh, 680px) !important;
    }

    body.po-site iframe[src*="google.com/maps"] {
        max-width: 100%;
        width: 100% !important;
    }
}

body.po-site .modal-dialog {
    margin-left: max(12px, env(safe-area-inset-left, 0px));
    margin-right: max(12px, env(safe-area-inset-right, 0px));
}
