/* ============================================================
   Soy Arquitecto Digital · Red Olah
   Widget de WhatsApp — Atención Prioritaria (premium)
   ============================================================ */

.wa-widget {
    --wa-cyan: #22D3EE;
    --wa-blue: #0EA5E9;
    --wa-ok: #34D399;
    --wa-green: #25D366;
    --wa-white: #F8FAFC;
    --wa-copy: #94A3B8;
    --wa-dim: #64748B;
    --wa-panel: #0F1B2E;
    position: fixed;
    z-index: 90;
    right: 24px;
    bottom: 24px;
    display: grid;
    justify-items: end;
    gap: 14px;
    pointer-events: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Launcher ---------- */
.wa-launcher {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 8px 18px 8px 9px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 18px;
    color: var(--wa-white);
    background: linear-gradient(145deg, rgba(15, 27, 46, .96), rgba(5, 11, 20, .96));
    box-shadow: 0 18px 44px rgba(0, 0, 0, .45), 0 0 0 1px rgba(34, 211, 238, .04), inset 0 1px 0 rgba(255, 255, 255, .08);
    pointer-events: auto;
    transition: transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s ease, border-color .3s ease;
}
.wa-launcher:hover,
.wa-widget.is-open .wa-launcher {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, .5);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .52), 0 0 0 5px rgba(34, 211, 238, .08), 0 0 26px rgba(34, 211, 238, .18);
}
.wa-launcher-icon {
    position: relative;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    color: #05200f;
    background: linear-gradient(145deg, #31E37A, #1DB954);
    box-shadow: 0 8px 20px rgba(37, 211, 102, .32), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.wa-launcher-icon svg { width: 23px; height: 23px; }
.wa-launcher-copy { display: grid; gap: 1px; text-align: left; }
.wa-launcher-copy strong { color: var(--wa-white); font: 700 13px 'Montserrat', sans-serif; letter-spacing: .01em; }
.wa-launcher-copy small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--wa-copy);
    font: 500 11px 'IBM Plex Mono', monospace;
    letter-spacing: .04em;
}
.wa-launcher-copy small i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--wa-ok);
    box-shadow: 0 0 9px var(--wa-ok);
    animation: wa-pulse 2.4s ease-in-out infinite;
}
@keyframes wa-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .5); }
    50% { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); }
}

/* ---------- Panel ---------- */
.wa-panel {
    width: 360px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 22px;
    color: var(--wa-white);
    background: linear-gradient(160deg, rgba(18, 34, 58, .98), rgba(6, 12, 22, .99));
    box-shadow: 0 34px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(34, 211, 238, .05), inset 0 1px 0 rgba(255, 255, 255, .07);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    transform-origin: bottom right;
    animation: wa-panel-in .34s cubic-bezier(.16, 1, .3, 1) both;
    pointer-events: auto;
}
.wa-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--wa-cyan), var(--wa-blue), transparent);
    opacity: .85;
}
.wa-panel[hidden] { display: none; }
@keyframes wa-panel-in {
    from { opacity: 0; transform: translateY(14px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.wa-panel-head {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, .1);
    background: radial-gradient(120% 160% at 0% 0%, rgba(34, 211, 238, .09), transparent 55%);
}
.wa-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 50%;
    color: var(--wa-white);
    background: linear-gradient(145deg, var(--wa-blue), #0A6BA8);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, .35), 0 6px 16px rgba(14, 165, 233, .3);
    font: 700 16px 'Montserrat', sans-serif;
}
.wa-panel-head .wa-who { flex: 1; min-width: 0; }
.wa-panel-head .wa-kicker {
    color: var(--wa-cyan);
    font: 500 9px 'IBM Plex Mono', monospace;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.wa-panel-head h3 { margin-top: 3px; color: var(--wa-white); font: 700 17px/1.15 'Montserrat', sans-serif; }
.wa-panel-head .wa-role { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--wa-copy); font-size: 11px; }
.wa-panel-head .wa-role i { width: 6px; height: 6px; border-radius: 50%; background: var(--wa-ok); box-shadow: 0 0 9px var(--wa-ok); }
.wa-close {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 9px;
    color: var(--wa-copy);
    background: rgba(255, 255, 255, .04);
    font-size: 18px;
    line-height: 1;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.wa-close:hover, .wa-close:focus-visible { color: #fff; border-color: var(--wa-cyan); background: rgba(34, 211, 238, .1); outline: none; }

.wa-panel-body { padding: 18px 20px 20px; }
.wa-panel-copy { color: var(--wa-copy); font-size: 13px; line-height: 1.55; }
.wa-panel-copy strong { color: var(--wa-white); font-weight: 600; }

.wa-options { display: grid; gap: 8px; margin-top: 16px; }
.wa-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 12px;
    color: var(--wa-copy);
    background: rgba(255, 255, 255, .025);
    text-align: left;
    font-size: 13px;
    transition: color .22s ease, border-color .22s ease, background .22s ease, transform .22s ease;
}
.wa-option:hover { transform: translateX(3px); }
.wa-option:hover,
.wa-option.selected,
.wa-option:focus-visible {
    border-color: rgba(34, 211, 238, .5);
    color: var(--wa-white);
    background: rgba(34, 211, 238, .08);
    outline: none;
}
.wa-option span { display: inline-flex; align-items: center; gap: 10px; }
.wa-option .wa-check {
    display: grid;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .3);
    border-radius: 5px;
    font-size: 10px;
    color: transparent;
    transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.wa-option.selected .wa-check { color: #05200f; background: var(--wa-green); border-color: var(--wa-green); }
.wa-option .wa-arrow { color: var(--wa-cyan); font-size: 15px; }

.wa-send {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    margin-top: 16px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 13px;
    color: #04210f;
    background: linear-gradient(145deg, #31E37A, #1DB954);
    box-shadow: 0 12px 28px rgba(37, 211, 102, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
    transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}
.wa-send:hover, .wa-send:focus-visible { transform: translateY(-2px); filter: brightness(1.04); box-shadow: 0 18px 36px rgba(37, 211, 102, .36); outline: none; }
.wa-send svg { width: 20px; height: 20px; }

.wa-panel-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed rgba(148, 163, 184, .14);
    color: var(--wa-dim);
    font: 500 10px 'IBM Plex Mono', monospace;
    letter-spacing: .04em;
}
.wa-panel-foot svg { width: 13px; height: 13px; color: var(--wa-cyan); }

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
    .wa-widget { right: 16px; bottom: 16px; gap: 10px; }
    .wa-panel { width: min(360px, calc(100vw - 32px)); }
    .wa-launcher { width: 56px; height: 56px; min-height: 56px; padding: 0; justify-content: center; border-radius: 50%; }
    .wa-launcher-copy { display: none; }
    .wa-launcher-icon { width: 42px; height: 42px; border-radius: 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .wa-panel { animation: none; }
    .wa-launcher, .wa-send, .wa-option { transition: none; }
    .wa-launcher-copy small i { animation: none; }
}
