/* ==========================================================================
   Responsive styles
   NOTE: this file must be loaded AFTER styles.css so these overrides win.
   Breakpoints follow Bootstrap 5:
     xl  <= 1199.98px   lg <= 991.98px   md <= 767.98px   sm <= 575.98px
   ========================================================================== */

/* ---------- Global (all widths) ---------- */

/* Safety net against stray horizontal scrolling (clip keeps position:sticky working) */
body {
    overflow-x: clip;
}

/* Mobile menu toggle (hidden on desktop) */
.nav-toggle {
    display: none;
    background: none;
    border: 0;
    padding: 0 0 0 12px;
    font-size: 2rem;
    line-height: 1;
    color: #000;
}

.nav-mobile-buy {
    display: none;
}

/* FAQs nav is not fixed; give the mobile dropdown something to anchor to */
#faqs nav {
    position: relative;
    z-index: 100;
}

/* Newsletter input + arrow button stay on one line at any width */
.ftr-section-input-email {
    display: flex;
    align-items: center;
}

#ftr-section .d-flex .w-50 .ftr-section-input-email input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

/* The closed cart drawer sits off-screen; don't let its shadow bleed onto the page */
.cart-sidebar:not(.cart-open) {
    box-shadow: none !important;
}

/* "Annual" gradient label was clipped by the 25px line-height of its parent */
#product .d-flex .tile3 .tile3-span {
    line-height: 1.2;
}

/* Home - products: cards grow with their content instead of a fixed 650px height,
   and the BUY button is pinned to the bottom so all three line up */
#product .d-flex .tile1,
#product .d-flex .tile2,
#product .d-flex .tile3 {
    height: auto;
    min-height: 650px;
}

#product .d-flex .tile1-container-btn,
#product .d-flex .tile2-container-btn,
#product .d-flex .tile3-container-btn {
    height: auto;
    margin-top: auto;
    padding-top: 1.5rem;
}

/* Home - "RBS helps you": use the full container width and line the lists up with the headings */
#RBHY .container .grid {
    margin: 6% 0;
}

#RBHY .grid .content1 h2 {
    white-space: nowrap;
}

#RBHY .grid .content1 ul {
    padding-left: 0;
}

/* Footer: let "Follow Us" + icons size to their content instead of a fixed 23% */
#ftr .container > .d-flex {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 24px;
}

#ftr .d-flex .mx-5 {
    margin: 0 !important;
}

#ftr .d-flex .ftr-social {
    width: auto;
    gap: 16px;
}

#ftr .ftr-social p,
#ftr .container > .d-flex a {
    white-space: nowrap;
}

#ftr .ftr-social .w-75 {
    width: auto !important;
    padding: 0 !important;
}

/* Solution images have a fixed height; keep them from stretching */
#thesolution-03 img {
    object-fit: cover;
}

/* ==========================================================================
   XXL (<= 1399.98px) - laptops
   ========================================================================== */
@media screen and (max-width: 1399.98px) {
    /* Home - products: smaller type so "Wearable + App" fits on one line */
    #product .d-flex .tile1,
    #product .d-flex .tile2,
    #product .d-flex .tile3 {
        padding: 2rem !important;
    }

    #product .d-flex .tile1 h1,
    #product .d-flex .tile2 h1,
    #product .d-flex .tile3 h1 {
        font-size: 2.25rem;
    }

    #product .d-flex .tile1 p,
    #product .d-flex .tile2 p,
    #product .d-flex .tile3 p {
        font-size: 1.2rem;
    }

    #product .d-flex .tile1 span,
    #product .d-flex .tile2 span,
    #product .d-flex .tile3 span {
        font-size: 1.75rem;
    }

    /* Home - "RBS helps you" */
    #RBHY .grid .content1 h2 {
        font-size: 2.1rem;
    }

    #RBHY .grid .content1 ul li {
        font-size: 1.3rem;
    }
}

/* ==========================================================================
   XL  (<= 1199.98px)
   ========================================================================== */
@media screen and (max-width: 1199.98px) {
    /* Home - benefits: 3 tiles per row instead of wrapping 2 + 1 */
    #benefits .tile,
    #benefits .tile2 {
        width: calc(33.333% - 10px);
        padding: 15px 28px 40px 28px;
    }

    /* Home - products */
    #product .d-flex .tile1 h1,
    #product .d-flex .tile2 h1,
    #product .d-flex .tile3 h1 {
        font-size: 2rem;
    }

    /* Home - "RBS helps you" */
    #RBHY .grid .content1 h2 {
        font-size: 1.85rem;
    }

    /* Footer: slightly smaller text so the 4 items still fit on one line */
    #ftr .container > .d-flex {
        justify-content: center !important;
    }

    #ftr .fs-5 {
        font-size: 1.05rem !important;
    }

    #ftr .fs-3 {
        font-size: 1.5rem !important;
    }
}

/* ==========================================================================
   LG  (<= 991.98px) - tablets
   ========================================================================== */
@media screen and (max-width: 991.98px) {
    /* ---------- Navigation ---------- */
    #home nav .nav-links .list-group {
        gap: 32px;
    }

    #home nav .nav-links ul li {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }

    #home nav .nav-button {
        width: auto;
        padding: 0 12px;
    }

    #home nav .cart-logo {
        width: 60px;
    }

    /* ---------- Home: hero ---------- */
    .background .container-h1 {
        min-height: 480px;
        padding: 60px 40px;
    }

    .background .container-h1 h1 {
        font-size: 3.5rem;
    }

    .background .container-h1 p {
        font-size: 1.3rem;
        width: 75% !important;
    }

    /* ---------- Home: meet RBS ---------- */
    #m-r .container h1 {
        font-size: 3.5rem;
    }

    #m-r .container p {
        font-size: 1.9rem;
    }

    /* ---------- Home: benefits ---------- */
    #benefits .benefits-div-h1 {
        padding: 0 5%;
        margin: 24px 0;
    }

    #benefits .benefits-div-h1 h1 {
        font-size: 2.75rem;
    }

    #benefits .tile,
    #benefits .tile2 {
        width: calc(50% - 10px);
        min-height: 340px;
    }

    /* ---------- Home: RBS helps you ---------- */
    #RBHY .text-center h1 {
        font-size: 2.75rem;
    }

    #RBHY .container .grid {
        margin: 5% 0;
    }

    #RBHY .grid .content1 h2 {
        font-size: 1.75rem;
        white-space: normal;
    }

    #RBHY .grid .content1 ul li {
        font-size: 1.15rem;
    }

    /* ---------- Home: how it works (stack the 4 tiles) ---------- */
    #HIW .text-center h1 {
        font-size: 2.75rem;
    }

    #HIW .container > .d-flex {
        flex-direction: column;
    }

    #HIW .container > .d-flex > .row {
        width: 100% !important;
        margin: 10px 0;
    }

    #HIW .container > .d-flex > .row > div:last-child > img {
        max-width: 100%;
        height: auto;
        max-height: 250px;
    }

    /* ---------- Home: products (stack the 3 cards) ---------- */
    #product {
        padding: 2rem 1rem !important;
    }

    #product .text-center h5 {
        margin-top: 40px;
    }

    #product .product-h1 h1 {
        font-size: 2.75rem;
    }

    #product .container .product-btn {
        margin: 24px 0 40px 0;
    }

    #product .container > .d-flex {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    #product .container > .d-flex > div {
        width: 100% !important;
        max-width: 520px;
        min-height: 0;
    }

    /* ---------- Shared: newsletter section ---------- */
    #ftr-section {
        padding: 2.5rem 1.5rem !important;
    }

    #ftr-section .container > .d-flex {
        flex-wrap: wrap;
        row-gap: 1.5rem;
    }

    #ftr-section .container > .d-flex > .w-25 {
        width: 50% !important;
    }

    #ftr-section .container > .d-flex > .w-50 {
        width: 100% !important;
    }

    /* ---------- Shared: footer ---------- */
    #ftr .container > .d-flex {
        flex-direction: column !important;
        gap: 12px;
        text-align: center;
    }

    #ftr .d-flex .mx-5 {
        margin: 0 !important;
    }

    #ftr .d-flex .ftr-social {
        gap: 12px;
    }

    #ftr .ftr-social .w-75 {
        width: auto !important;
        padding: 0 !important;
    }

    /* ---------- Why RBS: hero ---------- */
    #why-rbs .container-xxl .rounded-5 {
        min-height: auto;
        padding: 2rem !important;
        align-items: center;
    }

    #why-rbs .container-xxl .w-50 h1 {
        font-size: 2.75rem;
    }

    #why-rbs .container-xxl .rounded-5 .btn {
        width: auto !important;
        padding: 0.75rem 2.5rem;
    }

    #why-rbs .container-xxl .rounded-5 .pb-5 {
        padding-bottom: 1.5rem !important;
    }

    #why-rbs .container-xxl .rounded-5 .pt-5 {
        padding-top: 1.5rem !important;
    }

    #why-rbs .container-xxl .rounded-5 .mb-5 {
        margin-bottom: 0 !important;
    }

    #why-rbs .container-xxl .rounded-5 .fs-3 {
        font-size: 1.25rem !important;
    }

    /* ---------- Why RBS: the problem ---------- */
    #theproblem-01 .text-center .p-5,
    #theproblem-01 .container > .text-center.p-5 {
        padding: 1.5rem 0 !important;
    }

    #theproblem-01 .text-center .fs-1 {
        font-size: 1.75rem !important;
    }

    #theproblem-01 .container > .d-flex {
        padding: 1.5rem 0 !important;
    }

    #theproblem-01 .container .d-flex h3 {
        font-size: 1.4rem;
        text-align: center;
    }

    #theproblem-01 .container .fs-4 {
        font-size: 1.1rem !important;
    }

    /* ---------- Why RBS: our findings ---------- */
    #ourfindings-02 .text-center .p-5 {
        padding: 1.5rem 0 !important;
    }

    #ourfindings-02 .text-center .pb-5 h1 {
        font-size: 2.75rem;
    }

    #ourfindings-02 .container > .d-flex {
        flex-direction: column !important;
        padding: 1.5rem 0 !important;
    }

    #ourfindings-02 .container > .d-flex > .w-50 {
        width: 100% !important;
        padding: 1rem 0 !important;
    }

    #ourfindings-02 .fs-1 {
        font-size: 1.6rem !important;
    }

    /* ---------- Why RBS: the solution ---------- */
    #thesolution-03 .text-center .p-5 {
        padding: 1.5rem 0 !important;
    }

    #thesolution-03 .text-center .pb-5 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #thesolution-03 .text-center .pb-5 h1 {
        font-size: 2.75rem;
    }

    #thesolution-03 .row-cols-2 {
        padding: 1.5rem 0 !important;
    }

    #thesolution-03 .row-cols-2 > .row h1 {
        font-size: 1.75rem;
    }

    #thesolution-03 .row-cols-2 .fs-4 {
        font-size: 1.1rem !important;
    }

    /* ---------- Why RBS: accordion ---------- */
    #hnwAccordion {
        width: 80% !important;
    }

    /* ---------- FAQs: hero ---------- */
    #faqs .container-xxl .rounded-5 {
        min-height: 420px;
        padding: 2.5rem 1.5rem !important;
    }

    #faqs .container-xxl .rounded-5 > .w-50 {
        width: 100% !important;
    }

    #faqs .container-xxl .pb-5 h1 {
        font-size: 3.5rem;
    }

    #faqs .container-xxl .ms-5 {
        margin-left: 0 !important;
    }

    #faqs .container-xxl .rounded-5 .pb-5 {
        padding-bottom: 1.5rem !important;
    }

    #faqs .container-xxl .rounded-5 .pt-5 {
        padding-top: 1.5rem !important;
    }

    /* ---------- FAQs: sidebar becomes a row of pills above the questions ---------- */
    #faqs-section .container > .d-flex {
        flex-direction: column !important;
    }

    #faqs-section .container > .d-flex > aside,
    #faqs-section .container > .d-flex > .w-75 {
        width: 100% !important;
    }

    #faqs-section aside ul {
        position: static !important;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem !important;
        margin: 0;
        padding: 0 0 1rem 0 !important;
    }

    #faqs-section aside ul > div {
        width: auto;
        margin-top: 0;
    }

    #faqs-section .w-25 .faqs-aside {
        width: auto;
        height: auto;
        padding: 0.5rem 1.25rem !important;
        border: 1px solid #c5c5c5;
        border-radius: 25px;
    }

    #faqs-section .w-25 .fs-3 a {
        width: auto;
    }

    #faqs-section aside .fs-3 {
        font-size: 1.1rem !important;
    }

    #faqs-section .w-75 > .container.p-5,
    #faqs-section .w-75.p-5 {
        padding: 1rem 0 !important;
    }

    #faqs-section .w-75 .container h1,
    #faqs-section .w-75 h1 {
        font-size: 2.5rem;
    }

    #faqs-section .accordion-button.fs-3 {
        font-size: 1.3rem !important;
    }

    #faqs-section .w-75 .container.mt-5 {
        padding: 0;
        margin-top: 1.5rem !important;
    }

    #faqs-section form .fs-3 {
        font-size: 1.25rem !important;
    }
}

/* ==========================================================================
   MD  (<= 767.98px) - phones (landscape) and small tablets
   ========================================================================== */
@media screen and (max-width: 767.98px) {
    /* ---------- Navigation: collapse links into a hamburger menu ---------- */
    #home nav {
        padding: 12px 16px !important;
        justify-content: space-between;
    }

    #home nav .logo img {
        height: 40px;
    }

    #home nav .nav-button {
        display: none !important;
    }

    #home nav .cart-logo {
        width: auto;
        margin-left: auto;
    }

    .nav-toggle {
        display: block;
    }

    #home nav .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: auto !important;
        background-color: #ffffff;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
        padding: 8px 24px 20px 24px;
    }

    #home nav.nav-open .nav-links {
        display: block;
    }

    #home nav .nav-links .list-group {
        flex-direction: column !important;
        gap: 0;
    }

    #home nav .nav-links ul li {
        font-size: 1.1rem;
        padding: 12px 0;
        border-bottom: 1px solid #eeeeee;
    }

    #home nav .nav-links ul li.nav-mobile-buy {
        display: block;
        border-bottom: 0;
        padding-top: 16px;
    }

    #home nav .nav-links ul li.nav-mobile-buy .btn {
        width: 100%;
        letter-spacing: 2px;
    }

    /* ---------- Home: hero ---------- */
    #home .container-xxl {
        margin-top: 76px;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .container-xxl .background {
        background-position: center;
    }

    .background .container-h1 {
        min-height: 420px;
        padding: 40px 24px;
    }

    .background .container-h1 h1 {
        font-size: 2.5rem;
    }

    .background .container-h1 p,
    .background .container-h1 .w-50 {
        width: 100% !important;
    }

    .background .container-h1 p {
        font-size: 1.15rem;
    }

    .background .container-h1 .w-50.my-5 {
        margin: 1.5rem 0 !important;
    }

    /* ---------- Home: benefits ---------- */
    #benefits .container > .row {
        margin-left: 0;
        margin-right: 0;
    }

    #benefits .tile,
    #benefits .tile2 {
        width: 100%;
        max-width: 480px;
        min-height: 0;
        margin: 10px 0;
        padding: 20px 28px 32px 28px;
    }

    #benefits .tile .tile-div-h1,
    #benefits .tile2 .tile-div-h1,
    #benefits .tile .tile-div-h1-c2,
    #benefits .tile2 .tile-div-h1-c2,
    #benefits .tile .tile-div-h1-c3,
    #benefits .tile2 .tile-div-h1-c3 {
        margin-top: 32px;
    }

    #benefits .row .col-md-4 h1 {
        font-size: 1.75rem;
    }

    #benefits .row .col-md-4 p {
        font-size: 1.05rem;
    }

    /* ---------- Home: RBS helps you (stack the 3 columns) ---------- */
    #RBHY .grid .content1 {
        width: 100%;
        margin-bottom: 1.5rem;
    }

    #RBHY .grid .content1 ul {
        padding-left: 0;
    }

    /* ---------- Home: products / guarantees strip ---------- */
    .product-ext .container > .p-5 {
        flex-wrap: wrap;
        row-gap: 1rem;
        padding: 2rem 0 !important;
    }

    .product-ext .container > .p-5 > .w-25 {
        width: 50% !important;
        padding: 0 8px;
    }

    /* ---------- Why RBS: hero (image on top, text below) ---------- */
    #why-rbs .container-xxl {
        margin-top: 76px;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    #why-rbs .container-xxl .rounded-5 {
        flex-direction: column-reverse !important;
        gap: 1.5rem;
        margin-top: 0;
        padding: 1.5rem !important;
    }

    #why-rbs .container-xxl .rounded-5 > .w-50 {
        width: 100% !important;
    }

    #why-rbs .container-xxl .w-50 h1 {
        font-size: 2.25rem;
    }

    #why-rbs .container-xxl .w-50 h1 br {
        display: none;
    }

    /* ---------- Why RBS: shipping / warranty strip ---------- */
    #fs .wr .tile1 {
        flex-direction: column !important;
        padding: 1.5rem 0 !important;
    }

    #fs .wr .tile1 > div {
        border-right: 0 !important;
        border-bottom: 1px solid #c5c5c5;
        padding: 14px 0;
    }

    #fs .wr .tile1 > div:last-child {
        border-bottom: 0;
    }

    /* ---------- Why RBS: the problem (stack the 3 tiles) ---------- */
    #theproblem-01 .container > .d-flex {
        flex-direction: column !important;
        align-items: center;
        gap: 2rem;
    }

    #theproblem-01 .container .d-flex .tile1,
    #theproblem-01 .container .d-flex .tile2,
    #theproblem-01 .container .d-flex .tile3 {
        width: 100%;
        max-width: 480px;
        margin: 0 !important;
    }

    /* ---------- Why RBS: the solution (1 card per row) ---------- */
    #thesolution-03 .row-cols-2 > .row {
        width: 100% !important;
    }

    #thesolution-03 .row-cols-2 > .row img {
        height: 240px;
    }

    /* ---------- Why RBS: accordion ---------- */
    #hnwAccordion {
        width: 100% !important;
    }

    #hnwAccordion .accordion-button.fs-3 {
        font-size: 1.2rem !important;
    }

    /* ---------- FAQs ---------- */
    #faqs .container-xxl .rounded-5 {
        min-height: 320px;
        background-size: cover;
        box-shadow: 0 12px 60px rgba(0, 0, 0, 0.05);
    }

    #faqs .container-xxl .pb-5 h1 {
        font-size: 3rem;
    }

    #faqs .container-xxl .rounded-5 .fs-3 {
        font-size: 1.25rem !important;
    }

    #faqs-section .container.py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    #faqs-section .accordion-button.fs-3 {
        font-size: 1.1rem !important;
    }

    #faqs-section .accordion-body .fs-5 {
        font-size: 1rem !important;
    }

    /* ---------- Shared: newsletter + footer ---------- */
    #ftr-section .w-50 h1 {
        font-size: 2rem;
    }

    #ftr-section .w-50 .fs-4 {
        font-size: 1.1rem !important;
    }

    #ftr-section .d-flex .ftr-section-li {
        padding-left: 0;
    }

    #ftr .fs-5 {
        font-size: 1rem !important;
    }

    /* Cart drawer never wider than the screen */
    .cart-sidebar {
        width: 85vw;
        right: -85vw;
    }

    .cart-sidebar.cart-open {
        right: 0;
    }
}

/* ==========================================================================
   SM  (<= 575.98px) - phones
   ========================================================================== */
@media screen and (max-width: 575.98px) {
    /* ---------- Home ---------- */
    #m-r .container h1 {
        font-size: 2.5rem;
    }

    #m-r .container p {
        font-size: 1.35rem;
    }

    #m-r .container img {
        width: 100%;
        margin-top: 30px;
    }

    #benefits .benefits-div-h1 {
        padding: 0;
    }

    #benefits .benefits-div-h1 h1,
    #RBHY .text-center h1,
    #HIW .text-center h1,
    #product .product-h1 h1 {
        font-size: 2rem;
    }

    /* How it works: text on top, image below */
    #HIW .container > .d-flex > .row {
        flex-direction: column;
        min-height: 0;
        padding: 24px 20px 32px 20px;
    }

    #HIW .container > .d-flex > .row > div {
        width: 100% !important;
        flex: 0 0 auto;
    }

    #HIW .container > .d-flex > .row > div:last-child > img {
        max-height: 220px;
        margin-top: 1.5rem;
    }

    #HIW .d-flex .w-50 .tile1-h2,
    #HIW .d-flex .w-50 .tile2-h2,
    #HIW .d-flex .w-50 .tile3-h2,
    #HIW .d-flex .w-50 .tile4-h2 {
        margin-top: 24px;
    }

    #HIW .container h2 {
        font-size: 1.5rem;
    }

    #product .container > .d-flex > div {
        padding: 1.5rem !important;
    }

    #product .d-flex .tile1 h1,
    #product .d-flex .tile2 h1,
    #product .d-flex .tile3 h1 {
        font-size: 2rem;
    }

    #product .d-flex .tile1 p,
    #product .d-flex .tile2 p,
    #product .d-flex .tile3 p {
        font-size: 1.1rem;
    }

    /* ---------- Why RBS ---------- */
    #theproblem-01 .text-center .fs-1 {
        font-size: 1.4rem !important;
    }

    #ourfindings-02 .text-center .pb-5 h1,
    #thesolution-03 .text-center .pb-5 h1 {
        font-size: 2rem;
    }

    #ourfindings-02 .fs-1 {
        font-size: 1.3rem !important;
    }

    #why-rbs .container-xxl .rounded-5 .btn {
        width: 100% !important;
    }

    /* ---------- FAQs ---------- */
    #faqs .container-xxl .pb-5 h1 {
        font-size: 2.5rem;
    }

    #faqs-section .w-75 .container h1,
    #faqs-section .w-75 h1 {
        font-size: 1.85rem;
    }

    /* ---------- Shared ---------- */
    #ftr-section {
        padding: 2rem 1rem !important;
    }
}

/* Very small phones */
@media screen and (max-width: 400px) {
    .background .container-h1 h1 {
        font-size: 2rem;
    }

    #why-rbs .container-xxl .w-50 h1 {
        font-size: 1.9rem;
    }

    #faqs .container-xxl .pb-5 h1 {
        font-size: 2.25rem;
    }
}

/* ---------- Buy RBS page ---------- */
@media screen and (max-width: 1024px) {
    .bg-tertiary .d-flex {
        flex-direction: column!important;
    }

    .bg-tertiary .d-flex .w-100 {
        border-bottom: 1px solid black!important;
        border-right: 0!important;
    }
}
