/*
 * Padaria Giulia — cookie consent visual overrides + FAB-collision rules.
 *
 * The plugin renders its own DOM (#cc-main and #cm) under <body>. We
 * keep the plugin's structure intact and only override colors / sizing
 * so the Accept button does NOT visually dominate the Reject button
 * (LGPD/ANPD equal-prominence requirement).
 */

/* Bakery palette pinned to the plugin's CSS variables. The hex values
   mirror the @theme tokens in app.css — we duplicate here because the
   plugin reads its own custom-property names. */
#cc-main {
    --cc-btn-primary-bg: var(--color-primary, #C62828);
    --cc-btn-primary-hover-bg: var(--color-primary-hover, #A91E1E);
    --cc-btn-secondary-bg: transparent;
    --cc-btn-secondary-border-color: var(--color-primary, #C62828);
    --cc-btn-secondary-color: var(--color-primary, #C62828);
    --cc-bg: var(--color-surface, #FFFFFF);
    --cc-primary-color: var(--color-text-main, #2D2422);
    --cc-secondary-color: var(--color-text-muted, #8D7B77);
}

/* Equal-prominence: collapse the primary/secondary visual hierarchy by
   giving both buttons the same border + background. ANPD's enforcement
   focus is exactly this. */
#cc-main .pm__btn,
#cc-main .cm__btn {
    border: 2px solid var(--color-primary, #C62828);
    background: var(--color-surface, #FFFFFF);
    color: var(--color-text-main, #2D2422);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#cc-main .pm__btn:hover,
#cc-main .cm__btn:hover {
    background: var(--color-primary, #C62828);
    color: #FFFFFF;
}

/* Side gutter on phones so the banner doesn't kiss the viewport edges. */
@media (max-width: 640px) {
    #cm {
        max-width: calc(100vw - 24px);
        margin: 0 12px;
    }
}

/* iOS safe-area: keep the banner above the home-indicator strip. */
#cm {
    padding-bottom: max(env(safe-area-inset-bottom), 12px);
}

/*
 * FAB-collision rules. While the consent banner OR preferences modal is
 * visible, the WhatsApp FAB and the back-to-top button slide up so the
 * banner doesn't occlude them. The Stimulus controller toggles
 * body.consent-visible based on the plugin's onModalShow/onModalHide
 * callbacks.
 *
 * Default (no body class): the FABs sit at the project's standard
 * bottom-20 / md:bottom-24 offsets, unchanged.
 */
body.consent-visible .whatsapp-fab { bottom: calc(20px + 240px); }
body.consent-visible .back-to-top-wa-visible { bottom: calc(20px + 240px + 80px); }
body.consent-visible .back-to-top-wa-hidden { bottom: calc(20px + 240px); }
@media (min-width: 768px) {
    body.consent-visible .whatsapp-fab { bottom: calc(24px + 200px); }
    body.consent-visible .back-to-top-wa-visible { bottom: calc(24px + 200px + 80px); }
    body.consent-visible .back-to-top-wa-hidden { bottom: calc(24px + 200px); }
}
