/**
 * Bufete WhatsApp Widget — estilos.
 *
 * Defensive: namespaced bajo .bcw-* y #bcw-* para no chocar con el tema
 * Avante ni con plugins de Elementor / Yoast / Essential Addons. NO usamos
 * !important salvo donde el tema parent inyecta reglas que necesitamos pisar.
 */

/* ============================================================
   Tokens del Bufete (modal interior) + WhatsApp brand (FAB)
   ============================================================ */
#bcw-fab, #bcw-modal {
    --bcr-green-deep: #0e3d2e;
    --bcr-green:      #16523e;
    --bcr-green-ink:  #0a2d22;
    --bcr-gold:       #c9a449;
    --bcr-gold-soft:  #e0c373;
    --bcr-gold-line:  rgba(201, 164, 73, 0.32);
    --bcr-cream:      #fbf9f3;
    --bcr-cream-dim:  rgba(251, 249, 243, 0.78);

    --wa-green:       #25d366;
    --wa-green-dark:  #128c7e;
    --wa-green-hover: #1ebf57;

    --bcr-shadow:     0 18px 48px rgba(10, 22, 40, 0.22), 0 4px 12px rgba(10, 22, 40, 0.12);
    --bcr-shadow-fab: 0 12px 28px rgba(18, 140, 126, 0.32), 0 4px 10px rgba(37, 211, 102, 0.22);

    --bcw-radius:     14px;
    --bcw-radius-fab: 999px;

    --ease-out:       cubic-bezier(0.22, 0.61, 0.36, 1);
}

#bcw-fab, #bcw-fab *,
#bcw-modal, #bcw-modal * {
    box-sizing: border-box;
}

/* ============================================================
   FAB — verde WhatsApp para que el visitante lo reconozca
   ============================================================ */
.bcw-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;

    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px 12px 12px;
    border: 0;
    border-radius: var(--bcw-radius-fab);
    background: var(--wa-green);
    color: #fff;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.005em;
    cursor: pointer;
    box-shadow: var(--bcr-shadow-fab);
    transition:
        transform 200ms var(--ease-out),
        box-shadow 200ms var(--ease-out),
        background 200ms var(--ease-out);

    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}
.bcw-fab:hover, .bcw-fab:focus-visible {
    transform: translateY(-2px);
    background: var(--wa-green-hover);
    box-shadow: 0 18px 36px rgba(18, 140, 126, 0.42), 0 6px 14px rgba(37, 211, 102, 0.28);
    outline: none;
    color: #fff;
}
.bcw-fab:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.bcw-fab:active { transform: translateY(0); }

.bcw-fab__icon {
    width: 32px; height: 32px;
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 32px;
}
.bcw-fab__icon svg {
    width: 32px; height: 32px;
    display: block;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
}

.bcw-fab__label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.12;
    text-align: left;
}
.bcw-fab__line1 {
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.92;
    margin-bottom: 2px;
}
.bcw-fab__line2 {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 700;
    font-size: 14.5px;
    letter-spacing: 0;
}

@keyframes bcw-pulse {
    0%, 100% { box-shadow: var(--bcr-shadow-fab); }
    50%      { box-shadow: 0 12px 28px rgba(18, 140, 126, 0.32),
                            0 0 0 14px rgba(37, 211, 102, 0); }
}
.bcw-fab.is-greeting { animation: bcw-pulse 2.4s var(--ease-out) 1; }

@media (max-width: 768px) {
    .bcw-fab { bottom: 16px; right: 16px; padding: 10px 16px 10px 10px; gap: 9px; }
    .bcw-fab__icon { width: 28px; height: 28px; flex-basis: 28px; }
    .bcw-fab__icon svg { width: 28px; height: 28px; }
    .bcw-fab__line1 { font-size: 10px; }
    .bcw-fab__line2 { font-size: 13.5px; }
}
@media (max-width: 380px) {
    .bcw-fab__label { display: none; }
    .bcw-fab { padding: 12px; }
}
@media (max-height: 520px) and (orientation: landscape) {
    .bcw-fab { bottom: 10px; right: 10px; padding: 8px 14px 8px 8px; }
    .bcw-fab__icon { width: 24px; height: 24px; flex-basis: 24px; }
    .bcw-fab__icon svg { width: 24px; height: 24px; }
    .bcw-fab__line1 { font-size: 9.5px; }
    .bcw-fab__line2 { font-size: 12.5px; }
}

/* ============================================================
   Modal full-screen
   ============================================================ */
.bcw-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(10, 45, 34, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;

    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms var(--ease-out);
}
.bcw-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.bcw-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: linear-gradient(180deg, var(--bcr-green-deep) 0%, var(--bcr-green) 100%);
    color: var(--bcr-cream);
    border: 1px solid var(--bcr-gold-line);
    border-radius: var(--bcw-radius);
    box-shadow: var(--bcr-shadow);

    transform: translateY(18px) scale(0.985);
    transition: transform 280ms var(--ease-out), opacity 280ms var(--ease-out);
    opacity: 0;
}
.bcw-modal.is-open .bcw-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.bcw-card::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--bcr-gold) 0%, var(--bcr-gold-soft) 50%, var(--bcr-gold) 100%);
    border-top-left-radius: var(--bcw-radius);
    border-top-right-radius: var(--bcw-radius);
}

/* Defensive: el tema Avante tiene reglas agresivas sobre <button> (min-width,
   padding, line-height, etc.). Los !important garantizan que el iconbtn quede
   cuadrado de 36×36 sin importar qué CSS externo lo intente estirar. */
.bcw-iconbtn {
    position: absolute !important;
    top: 14px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background: rgba(251, 249, 243, 0.08) !important;
    border: 1px solid rgba(251, 249, 243, 0.18) !important;
    color: var(--bcr-cream) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    transition: background 160ms var(--ease-out), opacity 200ms var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
}
.bcw-iconbtn:hover, .bcw-iconbtn:focus-visible {
    background: rgba(201, 164, 73, 0.22) !important;
    outline: none;
}
.bcw-iconbtn:focus-visible { outline: 2px solid var(--bcr-gold) !important; outline-offset: 2px; }
.bcw-iconbtn[hidden] { display: none !important; }

.bcw-back  { left: 14px !important; right: auto !important; }
.bcw-close { right: 14px !important; left: auto !important; }

.bcw-back svg, .bcw-close svg {
    width: 14px !important;
    height: 14px !important;
    display: block !important;
    flex: 0 0 14px !important;
}

@media (max-width: 640px) {
    .bcw-modal { padding: 0; align-items: stretch; }
    .bcw-card {
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        border-left: 0; border-right: 0;
    }
    .bcw-card::before { border-radius: 0; }
}

/* ============================================================
   Pantallas internas
   ============================================================ */
.bcw-screen {
    padding: 52px 36px 32px;
    animation: bcw-fade 220ms var(--ease-out);
}
.bcw-screen[hidden] { display: none; }
@keyframes bcw-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .bcw-screen { padding: 60px 22px 28px; }
}

.bcw-eyebrow {
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--bcr-gold);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.bcw-eyebrow::before {
    content: '';
    display: inline-block;
    width: 28px; height: 1px;
    background: var(--bcr-gold);
}

.bcw-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1.22;
    margin: 0 0 22px;
    color: #fff;
    letter-spacing: -0.005em;
}

.bcw-callout {
    border: 1px solid var(--bcr-gold-line);
    background: rgba(201, 164, 73, 0.08);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 0 0 22px;
    font-size: 15.5px;
    line-height: 1.6;
}
.bcw-callout p { margin: 0; }
.bcw-callout strong { color: var(--bcr-gold-soft); }

.bcw-question {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(19px, 2.4vw, 22px);
    line-height: 1.3;
    margin: 0 0 18px;
    color: #fff;
}

.bcw-body {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--bcr-cream);
    margin: 0 0 22px;
}
.bcw-body strong { color: var(--bcr-gold-soft); font-weight: 700; }

/* ============================================================
   Botones
   ============================================================ */
.bcw-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}
.bcw-actions--row { flex-direction: row; gap: 12px; }
.bcw-actions--row > .bcw-btn { flex: 1; }
@media (max-width: 540px) { .bcw-actions--row { flex-direction: column; } }

.bcw-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 10px;
    min-height: 54px;
    padding: 14px 22px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition:
        background 180ms var(--ease-out),
        border-color 180ms var(--ease-out),
        color 180ms var(--ease-out),
        transform 100ms var(--ease-out),
        box-shadow 180ms var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}
.bcw-btn:focus-visible { outline: 2px solid var(--bcr-gold); outline-offset: 3px; }
.bcw-btn:active { transform: translateY(1px); }

.bcw-btn--primary {
    background: var(--bcr-gold);
    color: var(--bcr-green-ink);
    box-shadow: 0 6px 14px rgba(201, 164, 73, 0.28);
}
.bcw-btn--primary:hover {
    background: var(--bcr-gold-soft);
    color: var(--bcr-green-ink);
    box-shadow: 0 10px 20px rgba(201, 164, 73, 0.36);
}

.bcw-btn--ghost {
    background: transparent;
    color: var(--bcr-cream);
    border-color: rgba(251, 249, 243, 0.32);
}
.bcw-btn--ghost:hover {
    border-color: var(--bcr-gold);
    color: var(--bcr-gold-soft);
    background: rgba(201, 164, 73, 0.06);
}

.bcw-btn--wa {
    background: var(--wa-green);
    color: #fff;
    box-shadow: 0 6px 14px rgba(37, 211, 102, 0.32);
}
.bcw-btn--wa:hover {
    background: var(--wa-green-hover);
    color: #fff;
    box-shadow: 0 10px 22px rgba(37, 211, 102, 0.42);
}
.bcw-btn--wa svg { width: 20px; height: 20px; }

.bcw-btn--full { width: 100%; }

.bcw-slogan {
    margin: 24px 0 0;
    padding-top: 18px;
    border-top: 1px solid rgba(251, 249, 243, 0.12);
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: 15px;
    color: var(--bcr-gold-soft);
    text-align: center;
    letter-spacing: 0.005em;
}

/* Pantalla "confirm" — countdown bajo el botón */
.bcw-countdown-note {
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    color: var(--bcr-cream-dim);
    text-align: center;
    margin: 22px 0 0;
    letter-spacing: 0.02em;
    line-height: 1.5;
}
.bcw-countdown-note strong {
    color: var(--bcr-gold-soft);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 380px) {
    .bcw-title    { font-size: 22px; }
    .bcw-question { font-size: 18px; }
    .bcw-body, .bcw-callout { font-size: 14.5px; }
    .bcw-btn { font-size: 15px; min-height: 52px; }
}

body.bcw-locked { overflow: hidden; }
