/* NESBİL NSBL — responsive refinements.
 * Keep WHMCS tables scrollable locally; do not change application logic.
 * Mobile gutters account for Bootstrap negative-row margins.
 */
@media (max-width: 991px) {
    body.nsbl-theme { overflow-x: clip; }
    body.nsbl-theme,
    body.nsbl-theme .nsbl-site-header,
    body.nsbl-theme .nsbl-site-footer { max-width: 100%; }
    /* Bootstrap .row has -15px side margins. Keep its full intrinsic width;
       constrain the parent, never the row itself (R16 cropped its left edge). */
    body.nsbl-theme:not(.nesbil-auth-page) #main-body.nsbl-main-body {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding-left: 16px;
        padding-right: 16px;
        margin-left: auto;
        margin-right: auto;
    }
    body.nsbl-theme .nsbl-shell {
        box-sizing: border-box;
        width: calc(100% - 32px);
        max-width: 1216px;
        min-width: 0;
        margin-inline: auto;
    }
    body.nsbl-theme #main-body.nsbl-main-body > .nsbl-content-row {
        max-width: none;
        width: auto;
        margin-left: -15px;
        margin-right: -15px;
    }
    body.nsbl-theme .nsbl-page-content,
    body.nsbl-theme .nsbl-account-sidebar,
    body.nsbl-theme .nsbl-dashboard,
    body.nsbl-theme .nsbl-main-body .main-content {
        min-width: 0;
        max-width: 100%;
    }
    body.nsbl-theme .nsbl-site-header__inner,
    body.nsbl-theme .nsbl-site-nav,
    body.nsbl-theme .nsbl-site-nav__list,
    body.nsbl-theme .nsbl-site-footer__grid,
    body.nsbl-theme .nsbl-dashboard-columns {
        min-width: 0;
        max-width: 100%;
    }
    body.nsbl-theme .nsbl-site-nav__submenu {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
    }
    body.nsbl-theme .nsbl-home-domain__form,
    body.nsbl-theme .nsbl-home-product-grid,
    body.nsbl-theme .nsbl-home-benefits__grid,
    body.nsbl-theme .nsbl-hero__content {
        min-width: 0;
        max-width: 100%;
    }
    body.nsbl-theme .nsbl-page-content :is(.table-responsive, .nsbl-dt-scroll),
    body.nsbl-theme .nsbl-native-list .table-container,
    body.nsbl-theme .nsbl-page-content .nsbl-list-view .table-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    body.nsbl-theme .nsbl-page-content .table-responsive > table,
    body.nsbl-theme .nsbl-page-content .nsbl-list-view table {
        max-width: none;
    }
    body.nsbl-theme .nsbl-page-content :is(.panel, .card, .nsbl-feature-panel, .nsbl-kb-panel),
    body.nsbl-theme .nsbl-metric,
    body.nsbl-theme .nsbl-service-info-card {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }
}
@media (max-width: 767px) {
    /* Avoid iOS auto-zoom on focus without forbidding manual zoom. */
    body.nsbl-theme input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    body.nsbl-theme textarea,
    body.nsbl-theme select,
    body.nsbl-theme .form-control {
        font-size: 16px;
        max-width: 100%;
        min-width: 0;
    }
    body.nsbl-theme .nsbl-site-logo,
    body.nsbl-theme .nsbl-site-logo img { max-width: min(174px, 54vw); }
    body.nsbl-theme .nsbl-utility__inner { gap: 6px; min-width: 0; }
    body.nsbl-theme .nsbl-utility__left,
    body.nsbl-theme .nsbl-utility__right { min-width: 0; flex-wrap: wrap; }

    body.nsbl-theme .nsbl-page-content :is(h1, h2, h3, h4),
    body.nsbl-theme .nsbl-site-footer,
    body.nsbl-theme .nsbl-home-cta,
    body.nsbl-theme .nsbl-home-domain { overflow-wrap: anywhere; }
    body.nsbl-theme .nsbl-page-heading,
    body.nsbl-theme .nsbl-list-heading { min-width: 0; }
    body.nsbl-theme .nsbl-page-content .dataTables_wrapper,
    body.nsbl-theme .nsbl-page-content .nsbl-dt-toolbar,
    body.nsbl-theme .nsbl-page-content .nsbl-dt-bottom { min-width: 0; max-width: 100%; }
    body.nsbl-theme .nsbl-page-content .dataTables_filter input[type="search"] {
        width: 100%; max-width: 100%; margin: 6px 0 0;
    }
    body.nsbl-theme .nsbl-page-content .nsbl-dt-toolbar :is(.dataTables_filter,.dataTables_length) {
        min-width: 0;
        width: 100%;
    }
    body.nsbl-theme .nsbl-home-product,
    body.nsbl-theme .nsbl-home-benefits__items > div { min-width: 0; max-width: 100%; }
}
@media (max-width: 490px) {
    body.nsbl-theme .nsbl-site-footer__grid { grid-template-columns: minmax(0, 1fr); }
    body.nsbl-theme .nsbl-site-footer__about { grid-column: auto; }
    body.nsbl-theme .nsbl-page-content .nsbl-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    body.nsbl-theme .nsbl-page-content .nsbl-metric { padding: 12px; }
    body.nsbl-theme .nsbl-page-content .nsbl-metric__number { overflow-wrap: anywhere; }
}
@media (hover: none), (pointer: coarse) {
    body.nsbl-theme :is(.nsbl-home-product, .single-pricing-table, .nsbl-feature-panel,
        .nsbl-btn, .nsbl-site-nav__cta, .nsbl-metric):hover {
        transform: none !important;
    }
}

/* Collapsible public navigation: default closed on touch layouts, never shown
   by focus-within/hover until the parent was explicitly opened. */
@media (max-width: 990px) {
    body.nsbl-theme .nsbl-site-nav__has-submenu:not(.is-submenu-open) > .nsbl-site-nav__submenu {
        display: none !important;
        opacity: 0;
        visibility: hidden;
    }
    body.nsbl-theme .nsbl-site-nav__has-submenu.is-submenu-open > .nsbl-site-nav__submenu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    body.nsbl-theme .nsbl-site-nav__has-submenu > a[aria-expanded="true"] {
        background: #eff6ff;
        color: #1969b9;
    }
}

/* R17: allow one-finger panning without touch-driven page pinch zoom. */
@media (max-width: 990px) and (pointer: coarse) {
    html, body.nsbl-theme { touch-action: pan-x pan-y; }
}

/* R18 | The mobile nav is an overlay, not part of the header's document height.
   Expanding a flex-wrapped sticky header made the page and its logo jump. */
@media (max-width: 990px) {
    body.nsbl-theme .nsbl-site-header { position: sticky; top: 0; isolation: isolate; }
    body.nsbl-theme .nsbl-site-header__inner {
        position: relative;
        flex-wrap: nowrap;
        min-height: 68px;
    }
    body.nsbl-theme .nsbl-site-nav {
        position: absolute;
        top: 100%; left: 0; right: 0;
        z-index: 120;
        width: 100%;
        max-height: min(75dvh, 600px);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 12px;
        border: 1px solid #dfe8f2;
        border-top: 0;
        border-radius: 0 0 14px 14px;
        background: #fff;
        box-shadow: 0 18px 40px rgba(13,36,65,.16);
        -webkit-overflow-scrolling: touch;
    }
    body.nsbl-theme .nsbl-site-nav:not(.is-open) { display: none; }
    body.nsbl-theme .nsbl-site-nav.is-open { display: flex; }
    body.nsbl-theme .nsbl-site-nav__submenu { max-width: 100%; }
}

/* R18 | Nested legacy Bootstrap containers: balance .row's -15px margins.
   Do not mask the problem by clipping off the left side of the page. */
@media (max-width: 991px) {
    body.nsbl-theme .nsbl-product-landing,
    body.nsbl-theme .nsbl-product-landing :is(.faq-area, .domain-chart-area, .sss-area) {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    body.nsbl-theme .nsbl-product-landing :is(.faq-area, .domain-chart-area, .sss-area) > .container,
    body.nsbl-theme .nsbl-product-landing :is(.faq-area, .domain-chart-area, .sss-area) .container {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding-left: 15px;
        padding-right: 15px;
    }
    body.nsbl-theme .nsbl-product-landing .faq-area :is(.panel-group, .panel, .panel-heading, .panel-collapse, .panel-body) {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
        overflow-wrap: break-word;
    }
    body.nsbl-theme .cloud-hosting-service.service-area .service-teatimonial-item-inner > img {
        display: block;
        float: none;
        position: static;
        width: auto;
        height: auto;
        max-width: min(100%, 108px);
        max-height: 108px;
        margin: 0 auto 18px;
        object-fit: contain;
    }
    body.nsbl-theme.nesbil-page-clientareahome .nsbl-live-summary-grid,
    body.nsbl-theme .nsbl-dashboard > .nsbl-live-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    body.nsbl-theme .nsbl-live-summary__header { flex-wrap: wrap; }
    body.nsbl-theme .nsbl-live-summary__header > a { margin-left: auto; }
}

/* R18 | Single-column, centered footer including copyright and trust text. */
@media (max-width: 767px) {
    body.nsbl-theme .nsbl-site-footer,
    body.nsbl-theme .nsbl-site-footer__about,
    body.nsbl-theme .nsbl-site-footer__bottom { text-align: center; }
    body.nsbl-theme .nsbl-site-footer__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
        justify-items: center;
    }
    body.nsbl-theme .nsbl-site-footer__grid > div { min-width: 0; width: 100%; text-align: center; }
    body.nsbl-theme .nsbl-site-footer__about { grid-column: auto; }
    body.nsbl-theme .nsbl-site-footer__about img { display: block; margin: 0 auto; }
    body.nsbl-theme .nsbl-site-footer__about p { margin-left: auto; margin-right: auto; }
    body.nsbl-theme .nsbl-site-footer__grid h3 { margin-bottom: 12px; }
    body.nsbl-theme .nsbl-site-footer__bottom {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    body.nsbl-theme .nsbl-site-footer__bottom > span { display: block; width: 100%; }
}
