/* ==========================================================
   CoregenX footer — desktop 4-column layout, collapsible
   sections on phones / tablets
   ========================================================== */

/* ─── Colours + type scale (same font as the header) ─── */
.cx-footer {
    --cx-font: 'Jost', sans-serif;
    --cx-f-bg: #13172d;
    --cx-f-text: #c3c8dc;
    --cx-f-muted: #8f96b3;
    --cx-f-heading: #ffffff;
    --cx-f-line: rgba(255, 255, 255, .09);
    --cx-f-badge: rgba(255, 255, 255, .07);
    --cx-f-teal: #2ec4a5;
    --cx-f-wa: #25d366;

    --cx-f-fs-heading: 26px;    /* column headings */
    --cx-f-fs-body: 16px;       /* about text, addresses */
    --cx-f-fs-link: 16px;       /* footer links */
    --cx-f-fs-small: 15px;      /* bottom bar */
    --cx-f-fs-btn: 18px;        /* Get a Quote / WhatsApp buttons */

    position: relative;
    overflow: hidden;
    background: var(--cx-f-bg);
    color: var(--cx-f-text);
    font-family: var(--cx-font);
    font-size: var(--cx-f-fs-body);
    line-height: 1.6;
}

.cx-footer a,
.cx-footer button {
    font-family: var(--cx-font);
}

/* Page stylesheets can style bare elements (css/blog.css makes every <span>
   bold); keep footer text at the weights set by the class rules below. */
:where(.cx-footer) span {
    font-weight: inherit;
}

/* Dotted world map (bottom-left) */
.cx-footer::before {
    content: '';
    position: absolute;
    left: -40px;
    bottom: 70px;
    width: 600px;
    height: 240px;
    background: url(../images/world-map-dots.svg) no-repeat left bottom / contain;
    opacity: .4;
    pointer-events: none;
}

/* Soft decorative circle (top-right) */
.cx-footer::after {
    content: '';
    position: absolute;
    top: -160px;
    right: -120px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    border: 60px solid rgba(249, 117, 143, .05);
    pointer-events: none;
}

.cx-footer__container {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Desktop grid ─── */
.cx-footer__grid {
    display: grid;
    grid-template-columns: .95fr 1.1fr .9fr 1.15fr;
    padding: 42px 0 32px;
}

.cx-footer__grid>* {
    min-width: 0;
    padding: 0 26px;
}

.cx-footer__grid>*:first-child {
    padding-left: 0;
}

.cx-footer__grid>*:last-child {
    padding-right: 0;
}

.cx-footer__grid>*+* {
    border-left: 1px solid var(--cx-f-line);
}

/* ─── Brand column ─── */
.cx-footer__logo {
    display: inline-block;
}

.cx-footer__logo img {
    display: block;
    width: auto;
    height: 64px;
}

.cx-footer__about {
    max-width: 420px;
    margin: 18px 0 20px;
    font-size: var(--cx-f-fs-body);
    line-height: 1.65;
    color: var(--cx-f-text);
}

.cx-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cx-footer__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--cx-f-badge);
    color: #fff;
    font-size: 19px;
    text-decoration: none;
    transition: background .2s, transform .2s;
}

.cx-footer__social a:hover,
.cx-footer__social a:focus-visible {
    background: var(--cx-f-teal);
    color: #fff;
    transform: translateY(-2px);
    outline: none;
}

/* Big action buttons: shown on phones / tablets only */
.cx-footer__ctas {
    display: none;
}

/* ─── Buttons ─── */
.cx-fbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 56px;
    padding: 0 30px;
    border-radius: 50px;
    font-size: var(--cx-f-fs-btn);
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
}

.cx-fbtn:hover,
.cx-fbtn:focus-visible {
    color: #fff;
    transform: translateY(-2px);
    outline: none;
}

.cx-fbtn--quote {
    background: linear-gradient(135deg, #f9577c 0%, #f9758f 100%);
    box-shadow: 0 10px 26px rgba(249, 87, 124, .28);
}

.cx-fbtn--wa {
    background: linear-gradient(135deg, #1fd07a 0%, #0fb872 100%);
    box-shadow: 0 10px 26px rgba(16, 185, 114, .28);
}

.cx-fbtn__icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
}

.cx-fbtn__arrow {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    transition: transform .2s;
}

.cx-fbtn:hover .cx-fbtn__arrow {
    transform: translateX(3px);
}

/* ─── Column headings (plain headings on desktop, toggles on phones) ─── */
.cx-fcol__heading {
    margin: 0 0 18px;
    padding: 0;
    font-size: inherit;
    line-height: 1;
}

.cx-fcol__toggle {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--cx-f-heading);
    font-size: var(--cx-f-fs-heading);
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
}

.cx-fcol__title {
    position: relative;
    padding-bottom: 10px;
}

/* Teal underline under each heading */
.cx-fcol__title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 46px;
    height: 3px;
    border-radius: 3px;
    background: var(--cx-f-teal);
}

.cx-fcol__toggle-icon,
.cx-fcol__chevron {
    display: none;
}

/* ─── Link lists ─── */
.cx-flinks {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cx-flink {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 0;
    font-size: var(--cx-f-fs-link);
    line-height: 1.35;
    color: var(--cx-f-text);
    text-decoration: none;
    transition: color .2s;
}

.cx-flink:hover,
.cx-flink:focus-visible {
    color: #fff;
    outline: none;
}

.cx-flink__icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
}

.cx-flink__label {
    flex: 1 1 auto;
    min-width: 0;
}

.cx-flink__arrow {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: var(--cx-f-muted);
    transition: transform .2s, color .2s;
}

.cx-flink:hover .cx-flink__arrow,
.cx-flink:focus-visible .cx-flink__arrow {
    color: var(--cx-f-teal);
    transform: translateX(3px);
}

.cx-flinks--muted .cx-flink__icon {
    color: var(--cx-f-text);
}

/* Icon tints (Solutions list) */
.cx-tint--blue {
    color: #3b82f6;
}

.cx-tint--green {
    color: #22c55e;
}

.cx-tint--orange {
    color: #f59e0b;
}

.cx-tint--purple {
    color: #8b5cf6;
}

.cx-tint--pink {
    color: #f43f5e;
}

.cx-tint--teal {
    color: #2ec4a5;
}

.cx-tint--amber {
    color: #fb923c;
}

.cx-tint--violet {
    color: #a78bfa;
}

/* ─── Quick Inquiry (desktop) ─── */
.cx-footer__inquiry {
    margin-top: 26px;
    padding-top: 30px;
    border-top: 1px solid var(--cx-f-line);
}

@media (min-width: 992px) {
    .cx-mobile-only {
        display: none !important;
    }
}

.cx-footer__inquiry-title {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--cx-f-heading);
}

.cx-footer__inquiry-text {
    margin: 0 0 22px;
    font-size: var(--cx-f-fs-link);
    line-height: 1.6;
    color: var(--cx-f-text);
}

.cx-footer__quote-box {
    margin-bottom: 15px;
}

.cx-footer__quote-desc {
    margin: 0 0 10px;
    font-size: var(--cx-f-fs-body);
    line-height: 1.45;
    color: var(--cx-f-text);
}

.cx-footer__quote-box .cx-fbtn--quote {
    min-height: 46px;
    padding: 0 24px;
    font-size: 15px;
}

.cx-footer__quote-wrap {
    margin-top: 18px;
}

.cx-footer__quote-wrap .cx-fbtn--quote {
    min-height: 46px;
    padding: 0 24px;
    font-size: 15px;
}

@media (min-width: 992px) {
    .cx-fcol--contact .cx-fcontact {
        gap: 12px;
    }
    .cx-fcol--contact .cx-fcontact__badge {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
    }
    .cx-fcol--contact .cx-fcontact__badge svg {
        width: 17px;
        height: 17px;
    }
}

/* ─── Get In Touch ─── */
.cx-fcontact {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cx-fcontact__item {
    display: flex;
    align-items: center;
    gap: 18px;
}

.cx-fcontact__item:has(address) {
    align-items: flex-start;
}

.cx-fcontact__item--divided {
    padding-top: 26px;
    border-top: 1px solid var(--cx-f-line);
}

.cx-fcontact__badge {
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cx-f-badge);
    color: #fff;
}

.cx-fcontact__badge svg {
    width: 20px;
    height: 20px;
}

.cx-fcontact__badge--teal {
    color: var(--cx-f-teal);
}

.cx-fcontact__badge--wa {
    color: var(--cx-f-wa);
}

.cx-fcontact__badge--wa svg {
    width: 22px;
    height: 22px;
}

.cx-fcontact__text {
    margin: 0;
    padding-top: 2px;
    font-style: normal;
    font-size: var(--cx-f-fs-body);
    line-height: 1.6;
    color: var(--cx-f-text);
}

.cx-fcontact__text strong {
    display: block;
    margin-bottom: 2px;
    font-weight: 600;
    color: var(--cx-f-heading);
}

.cx-fcontact__link {
    font-size: calc(var(--cx-f-fs-body) + 1px);
    color: #e3e6f0;
    text-decoration: none;
    transition: color .2s;
}

.cx-fcontact__link:hover,
.cx-fcontact__link:focus-visible {
    color: var(--cx-f-teal);
    outline: none;
}

.cx-fcontact__link--wa {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--cx-f-teal);
}

.cx-fcontact__link--wa svg {
    width: 18px;
    height: 18px;
    transition: transform .2s;
}

.cx-fcontact__link--wa:hover svg {
    transform: translateX(3px);
}

/* ─── Bottom bar ─── */
.cx-footer__bottom {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--cx-f-line);
}

.cx-footer__bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 15px;
    padding-bottom: 15px;
}

.cx-footer__copy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
    margin: 0;
    font-size: var(--cx-f-fs-small);
    line-height: 1.5;
    color: var(--cx-f-text);
}

.cx-footer__copy-sep {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, .2);
}

.cx-footer__legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    /* keeps the links clear of the floating back-to-top button */
    padding: 0 72px 0 0;
    list-style: none;
}

.cx-footer__legal li {
    padding: 2px 26px;
    border-left: 1px solid var(--cx-f-line);
}

.cx-footer__legal a {
    font-size: var(--cx-f-fs-small);
    color: var(--cx-f-text);
    text-decoration: none;
    transition: color .2s;
}

.cx-footer__legal a:hover,
.cx-footer__legal a:focus-visible {
    color: #fff;
    outline: none;
}

/* Floating WhatsApp button — hidden until js/cx-site.js reveals it after a delay */
.cx-wa-float--hidden {
    display: none;
}

/* Back-to-top: round pink button, sits in the footer corner */
#backtotop {
    bottom: 22px !important;
    right: 22px;
    width: 52px;
    height: 52px;
    line-height: 52px;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: 0 10px 24px rgba(249, 117, 143, .35);
}

/* ─── Large laptops ─── */
@media (max-width: 1399px) {
    .cx-footer {
        --cx-f-fs-heading: 23px;
        --cx-f-fs-body: 15.5px;
        --cx-f-fs-link: 15px;
        --cx-f-fs-btn: 17px;
    }

    .cx-footer__grid>* {
        padding: 0 24px;
    }

    .cx-footer__social {
        gap: 10px;
    }

    .cx-footer__social a {
        width: 42px;
        height: 42px;
        font-size: 17px;
    }

    .cx-flink {
        gap: 14px;
    }

    .cx-flink__icon {
        flex-basis: 24px;
        width: 24px;
        height: 24px;
    }

    .cx-fcontact__item {
        gap: 18px;
    }

    .cx-fcontact__badge {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
    }
}

/* ─── Small laptops: brand across the top, three columns below ─── */
@media (min-width: 992px) and (max-width: 1199px) {
    .cx-footer__grid {
        grid-template-columns: 1fr 1fr 1fr;
        padding-top: 60px;
    }

    .cx-footer__brand {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 36px;
        margin-bottom: 44px;
        padding: 0 0 40px !important;
        border-bottom: 1px solid var(--cx-f-line);
    }

    .cx-footer__about {
        max-width: none;
        margin: 0;
    }

    .cx-footer__grid>.cx-fcol--solutions {
        padding-left: 0;
        border-left: 0;
    }
}

/* Desktop columns narrower than the design: let addresses wrap naturally
   instead of forcing the three-line breaks (avoids orphaned words) */
@media (min-width: 992px) and (max-width: 1599px) {
    .cx-fcontact__text br {
        display: none;
    }
}

/* Keep the copyright clear of the floating WhatsApp button (fixed, bottom-left)
   whenever the centred container doesn't already leave room for it */
@media (min-width: 1200px) and (max-width: 1599px) {
    .cx-footer__bottom-inner {
        padding-left: 100px;
    }
}

/* Small laptops: centre the bottom bar, clear of both floating buttons */
@media (min-width: 992px) and (max-width: 1199px) {
    .cx-footer__bottom-inner {
        flex-direction: column;
        gap: 12px;
        padding-left: 96px;
        padding-right: 96px;
        text-align: center;
    }

    .cx-footer__copy {
        justify-content: center;
    }

    .cx-footer__legal {
        justify-content: center;
        padding: 0;
    }

    .cx-footer__legal li:first-child {
        border-left: 0;
    }
}

/* ─── Phones + tablets: stacked, collapsible sections ─── */
@media (max-width: 991px) {
    .cx-footer {
        --cx-f-fs-heading: 20px;
        --cx-f-fs-body: 16px;
        --cx-f-fs-link: 16px;
        --cx-f-fs-btn: 18px;
    }

    .cx-footer__container {
        max-width: 640px;
        padding: 0 20px;
    }

    .cx-footer__grid {
        display: block;
        padding: 44px 0 8px;
    }

    .cx-footer__grid>* {
        padding: 0;
        border-left: 0 !important;
    }

    .cx-fcol--brand {
        text-align: center;
    }

    .cx-footer__logo {
        display: inline-flex;
        justify-content: center;
        margin: 0 auto;
    }

    .cx-footer__logo img {
        height: 58px;
        margin: 0 auto;
    }

    .cx-footer__about {
        max-width: 520px;
        margin: 18px auto 22px;
        text-align: center;
    }

    .cx-footer__social {
        justify-content: center;
        gap: 14px;
    }

    .cx-footer__social a {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .cx-footer__ctas {
        display: grid;
        gap: 14px;
        margin: 28px 0 30px;
    }

    .cx-footer__ctas .cx-fbtn {
        width: 100%;
        min-height: 60px;
    }

    /* Accordion rows */
    .cx-fcol {
        border-top: 1px solid var(--cx-f-line);
    }

    .cx-fcol:last-child {
        border-bottom: 1px solid var(--cx-f-line);
    }

    .cx-fcol__heading {
        margin: 0;
    }

    .cx-fcol__toggle {
        min-height: 72px;
        gap: 18px;
        cursor: pointer;
    }

    .cx-fcol__toggle:focus-visible {
        outline: 2px solid var(--cx-f-teal);
        outline-offset: 2px;
        border-radius: 6px;
    }

    .cx-fcol__toggle-icon {
        display: block;
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
    }

    .cx-fcol__toggle-icon--blue {
        color: #3b82f6;
    }

    .cx-fcol__toggle-icon--muted {
        color: var(--cx-f-text);
    }

    .cx-fcol__toggle-icon--teal {
        color: var(--cx-f-teal);
    }

    .cx-fcol__title {
        flex: 1 1 auto;
        padding-bottom: 0;
    }

    .cx-fcol__title::after {
        display: none;
    }

    .cx-fcol__chevron {
        display: block;
        flex: 0 0 20px;
        width: 20px;
        height: 20px;
        color: var(--cx-f-text);
        transition: transform .25s ease;
    }

    .cx-fcol.is-open .cx-fcol__chevron {
        transform: rotate(180deg);
    }

    /* Height animation for the collapsible panels */
    .cx-fcol__panel {
        display: grid;
        grid-template-rows: 0fr;
        visibility: hidden;
        transition: grid-template-rows .3s ease, visibility .3s;
    }

    .cx-fcol.is-open .cx-fcol__panel {
        grid-template-rows: 1fr;
        visibility: visible;
    }

    .cx-fcol__inner {
        min-height: 0;
        overflow: hidden;
    }

    .cx-flinks,
    .cx-fcontact {
        padding-bottom: 22px;
    }

    .cx-flink {
        min-height: 48px;
        padding: 8px 4px;
    }

    .cx-fcontact__item {
        gap: 20px;
    }

    .cx-fcontact__item--divided {
        padding-top: 0;
        border-top: 0;
    }

    /* Phones already have the two big buttons at the top */
    .cx-footer__inquiry,
    .cx-footer__quote-box,
    .cx-footer__quote-wrap,
    .cx-fcontact__item--wa {
        display: none;
    }

    /* Map sits behind the bottom of the stacked content */
    .cx-footer::before {
        left: 50%;
        bottom: 150px;
        width: 92%;
        max-width: 560px;
        height: 200px;
        background-position: center bottom;
        transform: translateX(-50%);
        opacity: .35;
    }

    .cx-footer__bottom-inner {
        flex-direction: column;
        gap: 14px;
        padding-top: 24px;
        /* room for the floating WhatsApp and back-to-top buttons */
        padding-bottom: 92px;
        text-align: center;
    }

    .cx-footer__copy {
        justify-content: center;
        text-align: center;
    }

    .cx-footer__copy-sep {
        display: none;
    }

    .cx-footer__legal {
        justify-content: center;
        padding: 0;
    }

    .cx-footer__legal li {
        padding: 2px 16px;
    }

    .cx-footer__legal li:first-child {
        border-left: 0;
    }
}

@media (max-width: 575px) {
    .cx-footer {
        --cx-f-fs-heading: 19px;
        --cx-f-fs-body: 15.5px;
        --cx-f-fs-link: 15.5px;
        --cx-f-fs-small: 14px;
        --cx-f-fs-btn: 17px;
    }

    .cx-footer__container {
        padding: 0 16px;
    }

    .cx-footer__social {
        gap: 10px;
    }

    .cx-footer__social a {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }

    .cx-fcontact__badge {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }

    .cx-footer__legal li {
        padding: 2px 10px;
    }

    #backtotop {
        right: 16px;
        bottom: 16px !important;
        width: 48px;
        height: 48px;
        line-height: 48px;
    }
}
