@media (max-width: 991px) {
    * {
        font-family: "Inter Tight";
        /* font-size: 14px; */
        font-style: normal;
        font-weight: 400;
        line-height: 140%; /* 19.6px */
    }
    .lwptoc {
        display:none;
    }
    body .content-wrapper .row.margin-top-btm-50 > .col-md-9 .doc-page {
        padding: 0 40px 50px 80px;
    }
    .content-wrapper .row.margin-top-btm-50 .col-md-9 .doc-page {
        padding: 15px 30px;
    }
}
@media (max-width: 991px) {
    #searchform {
        position: relative;
    }
    .form-group.menu-bar-form {
        display: block;
        position: fixed;
        top: 83px;
        width: 100%;
        height: 100%;
        background: var(--body-bgr);
    }
    #jquery-live-search .manual-searchresults {
        border: 0;
        box-shadow: none;
        height: 100%;
    }
}
@media (max-width: 768px) {
    body ul {
        list-style-type: none !important;
        margin: 0 !important;
    }
    body #sidebar-box + .col-md-9.col-sm-12 {
        width: 100%;
        margin-left: 0;
    }
    body #sidebar-box {
        width: 100%;
    }
    body .entry-content ul li {
        list-style: none !important;
    }
    body .doc-single-post {
        padding: 15px 30px;
    }
    body #Navigation25 .links,
    body #Navigation25 .divider {
        display: none;
    }
    /* Keep the login button in the top navigation, right next to the search icon */
    body #Navigation25 .nav {
        gap: 12px;
    }
    body .content-wrapper .row.margin-top-btm-50 .col-md-9 .doc-page {
        text-align: center;
        padding: 15px 30px !important;
    }
    body:not(.page-home) .print-content .wpb-content-wrapper > .vc_row {
        text-align: center !important;
    }
    body footer {
        height: max-content !important;
        padding: 8px;
        width: 100% !important;
        z-index: 104;
    }
    body #sidebar-box {
        z-index: 108;
    }
    body footer .copyright {
        flex-direction: column !important;
        gap: 8px;
    }
    body .hamburger-menu {
        display: none !important;
    }
    body #HomeBoxes {
        margin-left: -30px !important;
        margin-right: -30px !important;
    }
    body.page-home .vc_tta-tabs-container {
        display: block !important;
    }
    body.page-home .vc_tta-panel-heading {
        display: none !important;
    }
    body.page-home .vc_tta-panel-body {
        background: none !important;
        border: none !important;
    }
    body.page-home #home-hero-bgr {
        height: auto;
        text-align: left;
    }
    body.page-home #home-hero-bgr .cards {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    body.page-home #home-hero-bgr .card {
        text-align: left;
        align-self: center;
    }
}
@media (max-width: 550px) {
    body #home-hero-bgr .vc_tta-tabs-container {
        background: none;
        box-shadow: none;
        border-radius: 0;
    }
    body #home-hero-bgr .vc_tta-tabs-container ul {
        flex-direction: column;
    }
}

/* ===========================================================
   Mobile slide-in menu (<= 768px)
   Cleans up the bottom of the sidebar. The login button now lives
   in the top navigation instead of at the bottom of the sidebar.
   =========================================================== */
@media (max-width: 768px) {
    /* Comfortable top padding now that the login button no longer sits here */
    body #sidebar-box {
        padding-top: 24px !important;
        padding-bottom: 0 !important;
    }
    body #sidebar-box.closed {
        left: -100% !important;
    }
    /* Stack the well's children vertically so they no longer overlap */
    body #sidebar-box .custom-well.blankbg.sidebar-nav {
        display: flex;
        flex-direction: column;
    }
    /* Menu list fills the remaining height and scrolls on its own */
    body #sidebar-box .sidebar-nav #list-manual {
        flex: 0 1 auto;
        min-height: 0;
        height: auto !important;
        max-height: none !important;
        margin: 8px 0 0 !important;
    }
    /* Remove the 130px spacer that sat under the last list item */
    body #sidebar-box .sidebar-nav #list-manual > li:last-child {
        padding-bottom: 0 !important;
    }
    /* Keep the design toggle anchored just above the language / theme bar, centered */
    body #sidebar-box .nuvei-design-toggle {
        flex: 0 0 auto;
        margin-top: auto;
        margin-bottom: 12px;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* ===========================================================
   Breadcrumb collapse (<= 768px)
   Keep the trail on a single line: collapse the middle links into a
   single "…" marker and truncate the current page title with an
   ellipsis, leaving room for the feedback button on the same row.
   =========================================================== */
@media (max-width: 768px) {
    /* Let the feedback button reserve space in the row instead of overlapping
       the breadcrumb, so the breadcrumb can shrink into the remaining space. */
    body .nuv-breadcrumb-feedback-wrapper .nuv-page-feedback {
        position: static;
        flex: 0 0 auto;
    }
    /* Same for the AI resources button: make it static so it flows in the row. */
    body .nuv-breadcrumb-feedback-wrapper .nuv-ai-resources {
        position: static;
        flex: 0 0 auto;
        margin-left: auto;
    }
    /* Breadcrumb column shrinks and clips instead of wrapping/overflowing. */
    body .nuv-breadcrumb-feedback-wrapper > .nuv-breadcrumb {
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
    }
    /* Single-line trail; the current page title truncates at the clip edge. */
    body .nuv-breadcrumb-feedback-wrapper .nuv-breadcrumb {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: left;
    }
    /* Swap the full middle trail for the compact "…" marker. */
    body .nuv-breadcrumb-feedback-wrapper .nuv-breadcrumb__middle {
        display: none;
    }
    body .nuv-breadcrumb-feedback-wrapper .nuv-breadcrumb__ellipsis {
        display: inline;
    }
}

/* ===========================================================
   Mobile top-nav links inside the slide-in menu (issue #2)
   #Navigation25 .links is hidden at <=768px, so the nav-25 items
   ("API References", "Release Notes", …) are cloned (by theme.js) into a
   <li class="mobile-topnav-links"> appended as the LAST item inside
   #list-manual. That way they are part of the documentation menu, inherit
   its left indent, and scroll WITH it (they can never overlap the menu).
   Shown only at <=768px, with any submenus expanded (no hover on touch).
   =========================================================== */
li.mobile-topnav-links {
    display: none;
}
@media (max-width: 768px) {
    #list-manual > li.mobile-topnav-links {
        display: block !important;
        width: 100%;
        margin: 16px 0 0 !important;
        padding: 16px 20px 24px 0 !important;
        border-top: 1px solid var(--border-color);
    }
    #list-manual > li.mobile-topnav-links ul {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        border-left: 0 !important;
    }
    #list-manual > li.mobile-topnav-links li {
        display: block;
        width: 100%;
    }
    /* Top-level items ("API References", "Release Notes") sit like menu items. */
    #list-manual > li.mobile-topnav-links > ul > li > a {
        display: block !important;
        justify-content: flex-start !important;
        padding: 8px 0 !important;
        font-weight: 700;
        color: var(--Primary-Deep-Blue) !important;
    }
    /* Always reveal submenus on mobile (nav-25 wraps them in div.sub-menu). */
    #list-manual > li.mobile-topnav-links .sub-menu,
    #list-manual > li.mobile-topnav-links ul.sub-menu,
    #list-manual > li.mobile-topnav-links div.sub-menu {
        display: block !important;
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        min-width: 0 !important;
        max-width: none !important;
        box-shadow: none !important;
        border: 0 !important;
        background: transparent !important;
        padding: 0 0 0 14px !important;
        margin: 0 !important;
    }
    #list-manual > li.mobile-topnav-links .sub-menu a {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center;
        gap: 8px;
        padding: 8px 0 !important;
        text-transform: none;
        font-weight: 400;
        color: var(--text-default) !important;
    }
    #list-manual > li.mobile-topnav-links .sub-menu img,
    #list-manual > li.mobile-topnav-links .submenu-link-icon img {
        width: 20px;
        height: 20px;
        flex: 0 0 auto;
    }
}

/* ===========================================================
   Left-align documentation body copy on mobile (issue #6)
   The broad `.doc-page { text-align: center }` / `.vc_row { text-align:center }`
   rules above centre long-form prose, lists and tables, which is hard to read.
   Re-align flowing content to the left while leaving headings and hero rows
   centred (some landing pages intentionally centre their headings).
   The home page is excluded on purpose: its hero/general copy stays centred,
   while its cards remain left-aligned via style.css (#payment-page-home .card).
   =========================================================== */
@media (max-width: 768px) {
    body:not(.page-home) .content-wrapper .row.margin-top-btm-50 .col-md-9 .doc-page :is(p, ul, ol, li, dl, dd, dt, table, blockquote, pre, figure, figcaption, .tablepress),
    body:not(.page-home) .print-content .wpb-content-wrapper > .vc_row :is(p, ul, ol, li, dl, dd, dt, table, blockquote, pre, figure, figcaption, .tablepress) {
        text-align: left !important;
    }
}

/* ===========================================================
   Restore list bullets/numbers for article content on mobile (issue #7)
   The generic `body ul { list-style: none }` reset (<=991px) and
   `body .entry-content ul li { list-style: none }` (<=768px) are meant for
   nav menus, but they also strip markers from documentation lists. Re-enable
   them for .entry-content lists to match the desktop styling (disc/decimal).
   =========================================================== */
@media (max-width: 991px) {
    body .doc-page .entry-content ul:not([class*="vc_"]),
    body .doc-page .entry-content ol:not([class*="vc_"]),
    body .entry-content ul:not([class*="vc_"]),
    body .entry-content ol:not([class*="vc_"]) {
        list-style-position: outside !important;
        margin: 0 0 16px 32px !important;
        padding-left: 0 !important;
    }
    body .doc-page .entry-content ul:not([class*="vc_"]) > li,
    body .entry-content ul:not([class*="vc_"]) > li {
        list-style: disc !important;
        list-style-type: disc !important;
    }
    body .doc-page .entry-content ol:not([class*="vc_"]) > li,
    body .entry-content ol:not([class*="vc_"]) > li {
        list-style: decimal !important;
        list-style-type: decimal !important;
    }
    /* Nested lists get their conventional secondary markers. */
    body .entry-content ul:not([class*="vc_"]) ul > li { list-style-type: circle !important; }
    body .entry-content ul:not([class*="vc_"]) ul ul > li { list-style-type: square !important; }
}
