/* ===========================================
   CPM Partners — Responsive Stylesheet
   Additions only — base styles untouched
   =========================================== */


/* =====================
   MOBILE NAVIGATION
   ===================== */

.mobile-nav {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: #f5f5f5;
    z-index: 99;
    border-bottom: 1px solid rgba(31, 36, 47, 0.12);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 1.5rem 1.25rem 2rem;
}

/* Only show mobile nav when body has the open class AND we're on mobile */
@media (max-width: 1023px) {
    body.mobile-menu-open .mobile-nav {
        display: block;
    }
    .usp-options > div:before{
        display: none;
    }
    .usp-options > div{
        h3{
            display: flex;
            flex-direction: column;
            row-gap: 1rem;
            &:before{
                content: '0'counter(usp);
                font-weight: 400;
                font-size: 0.9rem;
            }
        }
    }
}

/* Always hide mobile nav on desktop regardless of JS state */
@media (min-width: 1024px) {
    .mobile-nav {
        display: none !important;
    }
}

/* Hamburger bar animation */
.mobile-menu-toggle span {
    transition: all 0.3s ease-out;
    transform-origin: center;
    display: block;
}

.mobile-menu-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav menu — WordPress generated list */
.mobile-nav-menu ul {
    display: flex;
    flex-direction: column;
}

.mobile-nav-menu > ul > li {
    border-bottom: 1px solid rgba(31, 36, 47, 0.08);
}

.mobile-nav-menu > ul > li > a {
    display: block;
    padding: 0.6rem 0;
    font-weight: 400;
    font-size: 1rem;
    color: #1F242F;
    transition: color 0.3s ease-out;
}

.mobile-nav-menu > ul > li > a:hover {
    color: #DB0632;
}

/* Sub-menu — hidden by default, shown via JS class */
.mobile-nav-menu > ul > li > ul {
    display: none;
    padding-left: 1rem;
    padding-bottom: 0.75rem;
    flex-direction: column;
    gap: 0.3rem;
}

.mobile-nav-menu > ul > li.submenu-open > ul {
    display: flex;
}

.mobile-nav-menu > ul > li > ul > li > a {
    font-size: 0.9rem;
    opacity: 0.6;
    display: block;
    padding: 0.25rem 0;
    color: #1F242F;
    transition: all 0.3s ease-out;
}

.mobile-nav-menu > ul > li > ul > li > a:hover {
    opacity: 1;
    color: #DB0632;
}

/* Parent item row (a + toggle button) */
.mobile-nav-parent-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0;
}

.mobile-nav-parent-wrap > a {
    flex: 1;
}

/* Sub-menu toggle button (+) */
.mobile-submenu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    line-height: 0;
    color: #DB0632;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.mobile-submenu-toggle ion-icon {
    display: block;
    transition: transform 0.3s ease-out;
}

.mobile-nav-menu > ul > li.submenu-open > .mobile-nav-parent-wrap .mobile-submenu-toggle ion-icon {
    transform: rotate(45deg);
}


/* =====================
   MOBILE BRANDS ACCORDION
   ===================== */

.brand-accordion-item {
    border-bottom: 1px solid rgba(31, 36, 47, 0.12);
}

.brand-accordion-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 0;
    font-weight: 600;
    font-size: 1.1rem;
    color: #1F242F;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease-out;
}

.brand-accordion-btn:hover {
    color: #DB0632;
}

.brand-accordion-btn ion-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    transition: transform 0.3s ease-out;
    color: #DB0632;
}

.brand-accordion-btn.is-open ion-icon {
    transform: rotate(45deg);
}

.brand-accordion-content {
    display: none;
    padding-bottom: 1.25rem;
}

.brand-accordion-content.is-open {
    display: block;
}

.brand-accordion-logo {
    max-height: 55px;
    object-fit: contain;
    max-width: 120px;
    margin-bottom: 0.75rem;
    display: block;
}


/* =====================
   GENERAL RESPONSIVE FIXES
   ===================== */

@media (max-width: 1023px) {

    /* Section title — wrap on tablet/mobile */
    .section-title {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    /* Remove sticky behaviour when columns stack */
    .main-content .sticky {
        position: static !important;
    }

    /* Partners/story sticky text blocks */
    .sticky.top-\[120px\] {
        position: static !important;
    }

    /* USP counter — reposition for smaller padding */
    .usp-options > div:before {
        top: 1.25rem;
        right: 1.25rem;
        font-size: 0.8rem;
    }

    /* Brand content image — scale down inside the box */
    .brand-content img {
        width: 160px;
        height: 110px;
    }

    /* Footer rounded top corners — reduce on tablet */
    .footer .rounded-tr-\[3rem\],
    .footer .rounded-tl-\[3rem\] {
        border-top-left-radius: 1.5rem;
        border-top-right-radius: 1.5rem;
    }
}

@media (max-width: 767px) {

    /* Section title h2 — scale down further */
    .section-title h2,.section-title.inner h2 {
        font-size: 1.9rem;
    }
    

    /* Client image height — smaller on mobile */
    .client-image {
        height: 140px;
    }

    /* USP options items — smaller padding */
    .usp-options > div {
        padding: 1.25rem;
    }

    /* Footer rounded corners — even smaller on mobile */
    .footer .rounded-tr-\[3rem\],
    .footer .rounded-tl-\[3rem\] {
        border-top-left-radius: 1rem;
        border-top-right-radius: 1rem;
    }

    /* Reduce hero rounded bottom corners */
    .rounded-bl-\[3rem\],
    .rounded-br-\[3rem\] {
        border-bottom-left-radius: 1.25rem;
        border-bottom-right-radius: 1.25rem;
    }

    /* Main CTA — ensure it doesn't overflow */
    .main-cta {
        font-size: 0.9rem;
    }
}
