/*
 * RobloxPets – Footer · Styles
 *
 * Scoped under .rbp-footer-root. Design tokens are duplicated from the
 * header module (same RobloxPets visual system, intentionally not pulled
 * via a shared file so the footer can ship/rollback independently). Page-
 * level selectors are gated behind body.rbp-footer-active so we never
 * leak styles into admin/builder/REST surfaces.
 */

.rbp-footer-root {
    --rbp-bg:           #050E1B;
    --rbp-bg-elev:      rgba(255,255,255,0.04);
    --rbp-bg-elev-2:    rgba(10, 24, 48, 0.55);
    --rbp-panel:        rgba(11, 24, 45, 0.72);
    --rbp-panel-strong: rgba(7, 18, 38, 0.92);
    --rbp-line:         rgba(255,255,255,0.07);
    --rbp-line-strong:  rgba(96, 165, 250, 0.18);
    --rbp-text:         #E7ECFF;
    --rbp-text-dim:     #8A95B8;
    --rbp-text-mute:    #5A6488;
    --rbp-accent:       #3B82F6;
    --rbp-accent-soft:  rgba(59, 130, 246, 0.16);
    --rbp-accent-glow:  rgba(59,130,246,0.45);
    --rbp-grad-logo:    linear-gradient(135deg, #3B82F6, #2c70d8);

    font-family: 'Chivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--rbp-text);
    -webkit-font-smoothing: antialiased;
}

.rbp-footer-root *,
.rbp-footer-root *::before,
.rbp-footer-root *::after { box-sizing: border-box; }

/* Hide any Breakdance-rendered footer once this module is active. Same
   defensive pattern as the header module — cover every variant we have
   seen Breakdance ship under, but never broadly hide all <footer> tags
   so admin/builder/preview views stay functional. */
body.rbp-footer-active .breakdance-footer,
body.rbp-footer-active .bde-footer-builder,
body.rbp-footer-active .breakdance .bde-footer-builder,
body.rbp-footer-active .bde-section[data-template-type="footer"],
body.rbp-footer-active section[data-template-type="footer"],
body.rbp-footer-active [data-bde-template="footer"],
body.rbp-footer-active [class*="breakdance-footer"],
body.rbp-footer-active [class*="bde-footer-builder"] {
    display: none !important;
}

/* ────────────────────────────────────────────────────────────────────
   FOOTER SHELL
   ──────────────────────────────────────────────────────────────────── */

.rbp-footer {
    position: relative;
    /* No outer margin — the footer must sit flush against the bottom of
       page content. Internal padding-top provides the breathing room. */
    margin-top: 0;
    padding: clamp(32px, 4.4vw, 56px) 0 clamp(22px, 2.6vw, 32px);
    /* Base anchored to the header's --rbp-bg so the footer bookends the page
       with the exact same navy as the site chrome (no lighter "band" seam
       against dark page bottoms). A single soft, centred blue wash keeps the
       accent on-palette — the old off-centre blue + cyan pair read as a
       mismatched lighter stripe and the cyan hue existed nowhere else. */
    background:
        radial-gradient(1200px 420px at 50% -30%, rgba(59, 130, 246, 0.06), transparent 62%),
        linear-gradient(180deg, var(--rbp-bg) 0%, #060f1d 55%, #050b16 100%);
    /* Neutral hairline matching the header's own divider (border-bottom:
       var(--rbp-line)) — the previous blue line-strong added to the
       out-of-place "blue at the top" look. */
    border-top: 1px solid var(--rbp-line);
    color: var(--rbp-text);
    isolation: isolate;
}

.rbp-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(96, 165, 250, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(96, 165, 250, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 35%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 35%, transparent 80%);
    opacity: 0.5;
    z-index: -1;
}

.rbp-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 32px);
}

/* Defensive type colour reset — Breakdance global theme rules can win
   over module classes for h1-h6, p, a inside the footer because their
   selectors are at the same specificity but loaded later. Pin the
   footer's text colours inside its own scope so the dark surface
   reads consistently. */
.rbp-footer-root .rbp-footer,
.rbp-footer-root .rbp-footer p,
.rbp-footer-root .rbp-footer ul,
.rbp-footer-root .rbp-footer li,
.rbp-footer-root .rbp-footer span,
.rbp-footer-root .rbp-footer small {
    color: var(--rbp-text);
    font-family: inherit;
}

.rbp-footer-root .rbp-footer h1,
.rbp-footer-root .rbp-footer h2,
.rbp-footer-root .rbp-footer h3,
.rbp-footer-root .rbp-footer h4,
.rbp-footer-root .rbp-footer h5,
.rbp-footer-root .rbp-footer h6 {
    color: #ffffff !important;
    font-family: inherit !important;
    text-shadow: none !important;
}

.rbp-footer a {
    color: inherit;
    text-decoration: none;
    transition: color .18s ease;
}

.rbp-footer a:hover,
.rbp-footer a:focus-visible {
    color: #ffffff;
}

.rbp-footer a:focus-visible {
    outline: 2px solid rgba(108, 182, 255, 0.85);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ────────────────────────────────────────────────────────────────────
   TOP ROW – brand + columns
   ──────────────────────────────────────────────────────────────────── */

.rbp-footer__top {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 2fr);
    gap: clamp(24px, 3.4vw, 48px);
    align-items: start;
    padding-bottom: clamp(24px, 2.6vw, 34px);
    border-bottom: 1px solid var(--rbp-line);
}

.rbp-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.rbp-footer__logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    color: var(--rbp-text);
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* Brand mark — no surrounding tile, just the RobloxPets icon at size.
   Matches the header's mark (same .webp image) so both surfaces read as
   the same brand. */
.rbp-footer__logo-mark {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.rbp-footer__logo-mark .rbp-footer__logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    pointer-events: none;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.rbp-footer__logo-text {
    font-size: 18px;
    line-height: 1;
    color: var(--rbp-text);
}

.rbp-footer__logo-text small {
    font-size: 11px;
    margin-left: 4px;
    color: rgba(108, 182, 255, 0.92);
    letter-spacing: 0.06em;
    font-weight: 700;
    vertical-align: 2px;
}

.rbp-footer__disclaimer {
    margin: 0;
    color: var(--rbp-text-dim);
    font-size: 12.5px;
    line-height: 1.55;
    max-width: 42ch;
}

/* Social row */
.rbp-footer__socials {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rbp-footer__social {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--rbp-line-strong);
    background: linear-gradient(180deg, rgba(13, 30, 60, 0.78), rgba(7, 18, 38, 0.86));
    color: var(--rbp-text);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    transition: transform .15s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.rbp-footer__social:hover,
.rbp-footer__social:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(108, 182, 255, 0.42);
    background: linear-gradient(180deg, rgba(15, 35, 70, 0.85), rgba(9, 22, 46, 0.92));
    box-shadow: 0 8px 18px rgba(2, 6, 18, 0.30);
}

.rbp-footer__social-ico {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    color: #cfe1ff;
}

.rbp-footer__social-ico svg {
    width: 16px;
    height: 16px;
    display: block;
}

.rbp-footer__social--discord .rbp-footer__social-ico { color: #b5c0ff; }
.rbp-footer__social--youtube .rbp-footer__social-ico { color: #ff7a8a; }
.rbp-footer__social--tiktok  .rbp-footer__social-ico { color: #e6edf7; }

.rbp-footer__social-label { white-space: nowrap; }

/* Link columns grid */
.rbp-footer__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(20px, 3vw, 40px);
    min-width: 0;
}

.rbp-footer__column { min-width: 0; }

/* Heading colour bumped with high specificity + !important because
   Breakdance ships a global theme rule for h1-h6 that wins on
   .rbp-footer__heading alone. We need the column headings to stay
   crisp white-ish blue against the dark navy surface. */
.rbp-footer-root .rbp-footer .rbp-footer__heading,
.rbp-footer-root .rbp-footer__heading {
    margin: 0 0 14px !important;
    color: #ffffff !important;
    font-family: inherit !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    letter-spacing: 0.14em !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    text-shadow: none !important;
}

.rbp-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rbp-footer__link {
    display: inline-flex;
    align-items: center;
    color: var(--rbp-text-dim);
    font-size: 14px;
    line-height: 1.35;
    transition: color .15s ease, transform .15s ease;
}

.rbp-footer__link:hover {
    color: #ffffff;
    transform: translateX(2px);
}

/* ────────────────────────────────────────────────────────────────────
   TRUST STRIP
   ──────────────────────────────────────────────────────────────────── */

.rbp-footer__trust {
    list-style: none;
    padding: 14px 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(14px, 2vw, 28px);
    border-bottom: 1px solid var(--rbp-line);
}

.rbp-footer__trust li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--rbp-text-dim);
    font-size: 12.5px;
    font-weight: 600;
}

.rbp-footer__trust-ico {
    display: inline-flex;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    color: rgba(108, 182, 255, 0.85);
}

.rbp-footer__trust-ico svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* ────────────────────────────────────────────────────────────────────
   BOTTOM ROW – copyright + payment badges
   ──────────────────────────────────────────────────────────────────── */

.rbp-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding-top: 14px;
}

.rbp-footer__copy {
    margin: 0;
    color: var(--rbp-text-mute);
    font-size: 12.5px;
    line-height: 1.4;
}

.rbp-footer__badges {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* Payment brand badges — each <li> holds a self-contained card-shaped
   SVG sized 40x26. Light translucent surface so the brand colors inside
   the SVG (white card faces, brand wordmarks) stay legible against the
   dark footer. */
.rbp-footer__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 26px;
    padding: 0;
    border-radius: 4px;
    background: transparent;
    overflow: hidden;
    line-height: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.rbp-footer__badge svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ──────────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .rbp-footer__top {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .rbp-footer__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .rbp-footer {
        margin-top: clamp(24px, 6vw, 40px);
    }

    .rbp-footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 22px;
    }

    .rbp-footer__heading { font-size: 11px; }

    .rbp-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .rbp-footer__trust {
        justify-content: flex-start;
        padding: 14px 0;
    }
}

@media (max-width: 420px) {
    .rbp-footer__grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rbp-footer a,
    .rbp-footer__social,
    .rbp-footer__link {
        transition: none !important;
    }
    .rbp-footer__social:hover,
    .rbp-footer__link:hover {
        transform: none !important;
    }
}

/* ────────────────────────────────────────────────────────────────────
   Surface gating: don't render on the checkout payment frames or any
   admin-like context the body class somehow leaks into. Defensive.
   ──────────────────────────────────────────────────────────────────── */
body.woocommerce-order-received .rbp-footer-root { display: none !important; }
body.wp-admin .rbp-footer-root { display: none !important; }
