/**
 * ClearVyzr — CheckoutWC brand layer (header + footer only).
 *
 * Lives under /checkout-wc/ so CheckoutWC's cfw_remove_theme_styles filter
 * does not strip it.
 *
 * Scope: only the custom dark header (rendered by the cfw_custom_header
 * action in functions.php) and the redesigned dark footer. The body of the
 * checkout uses the plugin's default styling — no theme overrides here.
 */

@font-face {
    font-family: "ClearVyzr Poppins";
    src: url("../../fonts/poppins-400-latin.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "ClearVyzr Poppins";
    src: url("../../fonts/poppins-500-latin.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "ClearVyzr Poppins";
    src: url("../../fonts/poppins-600-latin.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "ClearVyzr Poppins";
    src: url("../../fonts/poppins-700-latin.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "ClearVyzr Jost";
    src: url("../../fonts/jost-normal-latin.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "ClearVyzr Montserrat";
    src: url("../../fonts/montserrat-normal-latin.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --cv-black: #000;
    --cv-ink: #252323;
    --cv-muted: rgba(0, 0, 0, .68);
    --cv-soft: #f3f3f3;
    --cv-line: rgba(0, 0, 0, .08);
    --cv-line-strong: rgba(0, 0, 0, .14);
    --cv-font-body: "ClearVyzr Poppins", "Poppins", Helvetica, Arial, sans-serif;
    --cv-font-nav: "ClearVyzr Jost", "Jost", Helvetica, Arial, sans-serif;
    --cv-font-accent: "ClearVyzr Montserrat", "Montserrat", Helvetica, Arial, sans-serif;
}

/* ---------------------------------------------------------------- header (dark, custom — rendered by cfw_custom_header action) */

body.checkout-wc #cfw-header,
body.cfw-thank-you #cfw-header,
body.cfw-order-pay #cfw-header {
    padding: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, .06) !important;
    background: var(--cv-black) !important;
    color: rgba(255, 255, 255, .72) !important;
}

body.checkout-wc .cv-cfw-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "back logo secure";
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: none;
    padding: 20px clamp(20px, 4vw, 56px);
}

body.checkout-wc .cv-cfw-header__back {
    grid-area: back;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, .62);
    font-family: var(--cv-font-nav);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color .15s ease;
    justify-self: start;
}

body.checkout-wc .cv-cfw-header__back:hover {
    color: #fff;
}

body.checkout-wc .cv-cfw-header__back-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

body.checkout-wc #cfw-logo-container.cv-cfw-header__logo {
    grid-area: logo;
    text-align: center;
    justify-self: center;
}

body.checkout-wc .cv-cfw-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 0;
    padding: 4px 2px;
}

body.checkout-wc .cv-cfw-logo img {
    display: block;
    height: clamp(26px, 2vw, 34px);
    width: auto;
    max-width: 100%;
}

body.checkout-wc .cv-cfw-header__secure {
    grid-area: secure;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, .58);
    font-family: var(--cv-font-nav);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    justify-self: end;
}

body.checkout-wc .cv-cfw-header__secure-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

/* Mobile: hide back-link/secure labels (keep icons), shrink logo */
@media (max-width: 720px) {
    body.checkout-wc .cv-cfw-header__inner {
        padding: 14px 18px;
        gap: 10px;
        grid-template-columns: auto 1fr auto;
    }

    body.checkout-wc .cv-cfw-header__back span,
    body.checkout-wc .cv-cfw-header__secure span {
        display: none;
    }

    body.checkout-wc .cv-cfw-header__back-icon,
    body.checkout-wc .cv-cfw-header__secure-icon {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }

    body.checkout-wc .cv-cfw-logo img {
        height: 24px;
    }
}

/* ---------------------------------------------------------------- checkout footer (redesign) */

/*
 * The legacy inline rules in functions.php give the footer a dark gradient with
 * pill-styled policy links and a quirky language switcher. They live at wp_head
 * priority 100, so they print after this stylesheet — overrides below win by
 * specificity (body.checkout-wc + #id + class > #id + class).
 */

body.checkout-wc #cfw-footer,
body.cfw-thank-you #cfw-footer,
body.cfw-order-pay #cfw-footer {
    margin-top: 64px !important;
    padding: 28px clamp(20px, 4vw, 56px) !important;
    border-top: 1px solid rgba(255, 255, 255, .06) !important;
    background: #141414 !important;
    color: rgba(255, 255, 255, .58) !important;
    font-family: var(--cv-font-body) !important;
}

body.checkout-wc #cfw-footer .wrap,
body.checkout-wc #cfw-footer .wrap.row {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.checkout-wc #cfw-footer .col-12 {
    padding: 0 !important;
}

body.checkout-wc #cfw-footer .cfw-footer-inner {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    grid-template-areas: "brand policies controls" !important;
    align-items: center !important;
    gap: 24px !important;
    width: 100% !important;
    padding: 0 !important;
    text-align: left !important;
}

/* Left: brand mark + copyright + secure note */
body.checkout-wc #cfw-footer .cfw-footer-inner > p {
    grid-area: brand !important;
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: rgba(255, 255, 255, .5) !important;
    font-family: var(--cv-font-body) !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
}

body.checkout-wc #cfw-footer .cfw-footer-inner > p::before {
    content: "ClearVyzr";
    color: #fff;
    font-family: var(--cv-font-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    padding-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, .14);
}

body.checkout-wc #cfw-footer .cfw-footer-inner > p::after {
    content: "Secure checkout · 256-bit SSL";
    display: inline-flex;
    align-items: center;
    padding-left: 19px;
    color: rgba(255, 255, 255, .42);
    font-family: var(--cv-font-nav);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='%23ffffff' stroke-opacity='0.55' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M12 3l8 3v5c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V6l8-3z'/></svg>") no-repeat 0 50% / 13px 13px;
}

/* Center: policy text links (no pills) */
body.checkout-wc #cfw-footer #cfw-store-policies-container {
    grid-area: policies !important;
    width: auto !important;
}

body.checkout-wc #cfw-footer #cfw-store-policies-container .cfw-store-policies {
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

body.checkout-wc #cfw-footer #cfw-store-policies-container .cfw-store-policies li,
body.checkout-wc #cfw-footer #cfw-store-policies-container .cfw-store-policies a {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body.checkout-wc #cfw-footer #cfw-store-policies-container .cfw-store-policies a {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 0 !important;
    padding: 6px 18px !important;
    border-radius: 0 !important;
    color: rgba(255, 255, 255, .78) !important;
    font-family: var(--cv-font-nav) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-decoration: none !important;
    transition: color .15s ease !important;
    transform: none !important;
}

body.checkout-wc #cfw-footer #cfw-store-policies-container .cfw-store-policies a:hover {
    background: transparent !important;
    color: #fff !important;
    transform: none !important;
    text-decoration: underline !important;
    text-underline-offset: 4px !important;
    text-decoration-thickness: 1px !important;
    text-decoration-color: rgba(255, 255, 255, .45) !important;
}

/* Subtle dot separators between policy links */
body.checkout-wc #cfw-footer #cfw-store-policies-container .cfw-store-policies li + li::before {
    content: "·";
    color: rgba(255, 255, 255, .22);
    font-weight: 700;
    margin: 0 -10px 0 -10px;
    padding: 0 6px;
}

/* Right: hide nav menu items, keep language toggle */
body.checkout-wc #cfw-footer .menu-primary-container {
    grid-area: controls !important;
    width: auto !important;
    justify-self: end !important;
}

body.checkout-wc #cfw-footer .menu-primary-container .menu {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Hide Home/Shop on checkout footer — keeps user focused on completing purchase */
body.checkout-wc #cfw-footer .menu-primary-container .menu > li:not(.trp-language-switcher-container) {
    display: none !important;
}

/* Language switcher: clean inline EN | FR toggle, no "Language" prefix */
body.checkout-wc #cfw-footer .menu > .trp-language-switcher-container {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
}

body.checkout-wc #cfw-footer .menu > .trp-language-switcher-container::before {
    content: none !important;
}

body.checkout-wc #cfw-footer .menu > .trp-language-switcher-container > a,
body.checkout-wc #cfw-footer .menu > .trp-language-switcher-container .sub-menu a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 0 !important;
    min-width: 36px !important;
    padding: 6px 10px !important;
    border: 0 !important;
    background: transparent !important;
    color: rgba(255, 255, 255, .56) !important;
    font-family: var(--cv-font-accent) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .1em !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    transition: color .15s ease !important;
}

body.checkout-wc #cfw-footer .menu > .trp-language-switcher-container > a {
    color: #fff !important;
}

body.checkout-wc #cfw-footer .menu > .trp-language-switcher-container .sub-menu a:hover,
body.checkout-wc #cfw-footer .menu > .trp-language-switcher-container > a:hover {
    background: transparent !important;
    color: #fff !important;
}

/* Show the sub-menu inline as siblings of the active language, with a divider */
body.checkout-wc #cfw-footer .menu > .trp-language-switcher-container > .sub-menu {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    list-style: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

body.checkout-wc #cfw-footer .menu > .trp-language-switcher-container > .sub-menu li {
    margin: 0 !important;
    padding: 0 !important;
}

body.checkout-wc #cfw-footer .menu > .trp-language-switcher-container > .sub-menu li::before {
    content: "" !important;
    display: inline-block !important;
    width: 1px !important;
    height: 12px !important;
    margin: 0 4px !important;
    background: rgba(255, 255, 255, .18) !important;
    vertical-align: middle !important;
}

/* ---------------------------------------------------------------- mobile footer */

@media (max-width: 820px) {
    body.checkout-wc #cfw-footer {
        padding: 26px 20px !important;
    }

    body.checkout-wc #cfw-footer .cfw-footer-inner {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "policies"
            "brand"
            "controls" !important;
        gap: 16px !important;
        text-align: center !important;
    }

    body.checkout-wc #cfw-footer .cfw-footer-inner > p {
        justify-content: center !important;
        text-align: center !important;
        font-size: 12px !important;
    }

    body.checkout-wc #cfw-footer .cfw-footer-inner > p::before {
        padding-right: 10px;
    }

    body.checkout-wc #cfw-footer .cfw-footer-inner > p::after {
        padding-left: 17px;
    }

    body.checkout-wc #cfw-footer #cfw-store-policies-container .cfw-store-policies {
        gap: 0 !important;
    }

    body.checkout-wc #cfw-footer #cfw-store-policies-container .cfw-store-policies a {
        padding: 6px 12px !important;
        font-size: 12.5px !important;
    }

    body.checkout-wc #cfw-footer .menu-primary-container {
        justify-self: center !important;
    }
}
