/* ═══════════════════════════════════════════════════════════════
   Pro Art Photographers — WhatsApp Widget (wa-widget)
   Piel 100% WhatsApp: header teal, wallpaper, burbujas, composer.
   Convive con el Concierge (.aqua-widget); z-index siempre encima.
   ═══════════════════════════════════════════════════════════════ */

/* ── Scrim ── */
.pa-waw__scrim {
    position: fixed; inset: 0; z-index: 9992;
    background: rgba(8, 16, 11, .38);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity .3s ease;
}
.pa-waw--open .pa-waw__scrim { opacity: 1; pointer-events: auto; }

/* Mientras el wa-widget está abierto, la pill del Concierge se aparta */
body.pa-waw-open .aqua-widget__bar { opacity: 0 !important; pointer-events: none !important; }

/* ── Panel ── */
.pa-waw__panel {
    position: fixed; bottom: 20px; right: 20px; z-index: 9993;
    width: 380px; max-width: calc(100vw - 32px);
    height: min(640px, 80vh); min-height: 420px;
    display: flex; flex-direction: column;
    border-radius: 18px; overflow: hidden;
    background: #ECE5DD;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .30), 0 0 0 1px rgba(0, 0, 0, .05);
    opacity: 0; transform: translateY(26px) scale(.94); pointer-events: none;
    transition: opacity .32s cubic-bezier(.32,.72,.28,1),
                transform .32s cubic-bezier(.32,.72,.28,1);
}
.pa-waw--open .pa-waw__panel { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

@media (max-width: 540px) {
    .pa-waw__panel {
        right: 0; left: 0; bottom: 0;
        width: auto; max-width: none;
        height: 86vh; height: 86dvh;
        border-radius: 20px 20px 0 0;
    }
}

/* ── Header (teal WhatsApp) ── */
.pa-waw__head {
    flex: none; display: flex; align-items: center; gap: 10px;
    background: #008069; color: #fff; padding: 10px 12px;
}
.pa-waw__ava {
    width: 40px; height: 40px; border-radius: 50%; flex: none;
    background: #0d1a12; color: #fff; display: grid; place-items: center;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600; font-size: 1.02rem; letter-spacing: .02em;
    border: 2px solid rgba(255, 255, 255, .35); position: relative;
}
.pa-waw__dot {
    position: absolute; right: -1px; bottom: -1px;
    width: 11px; height: 11px; border-radius: 50%;
    background: #3ae37f; border: 2px solid #008069;
}
.pa-waw__dot--off { background: #b8c4bd; }
.pa-waw__who { flex: 1; min-width: 0; }
.pa-waw__name {
    font-size: .88rem; font-weight: 700; line-height: 1.25;
    display: flex; align-items: center; gap: 5px; white-space: nowrap;
}
.pa-waw__name svg { flex: none; }
.pa-waw__status { font-size: .7rem; color: rgba(255, 255, 255, .85); }
.pa-waw__close {
    background: none; border: 0; color: #fff; cursor: pointer;
    font-size: 1.05rem; line-height: 1; width: 36px; height: 36px;
    border-radius: 50%; flex: none; display: grid; place-items: center;
}
.pa-waw__close:hover { background: rgba(255, 255, 255, .14); }

/* ── Chat (wallpaper) ── */
.pa-waw__chat {
    flex: 1; overflow-y: auto; overscroll-behavior: contain;
    padding: 14px 12px 10px;
    display: flex; flex-direction: column; gap: 7px;
    background:
        radial-gradient(circle at 18% 22%, rgba(255,255,255,.5) 0 1.6px, transparent 2px),
        radial-gradient(circle at 72% 64%, rgba(255,255,255,.5) 0 1.4px, transparent 2px),
        radial-gradient(circle at 44% 86%, rgba(255,255,255,.45) 0 1.4px, transparent 2px),
        radial-gradient(circle at 88% 14%, rgba(255,255,255,.45) 0 1.3px, transparent 2px),
        #ECE5DD;
    background-size: 130px 130px, 150px 150px, 170px 170px, 120px 120px, auto;
}
.pa-waw__day {
    align-self: center; flex: none;
    background: #fdf6e3; color: #5a6a60;
    font-size: .66rem; font-weight: 600;
    padding: 4px 11px; border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .08); margin-bottom: 2px;
}

/* ── Burbujas ── */
.pa-waw__bub {
    max-width: 84%; padding: 7px 10px 6px; border-radius: 10px;
    font-size: .84rem; line-height: 1.42; color: #111B21;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .09);
    animation: pa-waw-pop .22s ease;
    white-space: pre-line; word-wrap: break-word;
}
@keyframes pa-waw-pop {
    from { opacity: 0; transform: translateY(7px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.pa-waw__bub--in  { align-self: flex-start; background: #fff;     border-top-left-radius: 3px; }
.pa-waw__bub--out { align-self: flex-end;   background: #D9FDD3;  border-top-right-radius: 3px; }
.pa-waw__time {
    display: inline-block; float: right; margin-left: 8px; position: relative; top: 3px;
    font-size: .6rem; font-weight: 700; color: #53BDEB;
}
.pa-waw__time small { color: #7b8a80; font-weight: 400; margin-right: 3px; }

/* Spinner dentro de burbuja ("Sending your message…") */
.pa-waw__spin {
    width: 13px; height: 13px; flex: none;
    border: 2px solid rgba(0, 128, 105, .22); border-top-color: #008069;
    border-radius: 50%; display: inline-block;
    animation: pa-waw-spin .7s linear infinite;
    margin-right: 8px; vertical-align: -2px;
}
@keyframes pa-waw-spin { to { transform: rotate(360deg); } }

/* Indicador escribiendo… */
.pa-waw__typing {
    align-self: flex-start; background: #fff;
    border-radius: 10px; border-top-left-radius: 3px;
    padding: 11px 13px; display: inline-flex; gap: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .09);
}
.pa-waw__typing i {
    width: 6px; height: 6px; border-radius: 50%; background: #9aa8a0;
    animation: pa-waw-blink 1.1s infinite;
}
.pa-waw__typing i:nth-child(2) { animation-delay: .18s; }
.pa-waw__typing i:nth-child(3) { animation-delay: .36s; }
@keyframes pa-waw-blink { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }

/* ── Chips (quick replies) ── */
.pa-waw__chips {
    display: flex; flex-wrap: wrap; gap: 7px;
    padding: 2px 2px 4px; align-self: flex-start; flex: none;
}
.pa-waw__chip {
    border: 1.5px solid #25D366; background: #fff; color: #0f7a43;
    font-family: inherit; font-weight: 600; font-size: .8rem;
    padding: 8px 14px; border-radius: 999px; cursor: pointer;
    transition: background .15s ease;
    animation: pa-waw-pop .22s ease;
}
.pa-waw__chip:hover { background: #e9fbef; }

/* Chip de fecha: input date invisible encima; al tocar abre el calendario nativo */
.pa-waw__chip--date { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px; }
.pa-waw__chip--date input {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer; border: 0; padding: 0; margin: 0;
}
.pa-waw__chip--date:focus-within { background: #e9fbef; outline: 2px solid #25D366; outline-offset: 1px; }

/* ── Pie: consent + composer ── */
.pa-waw__foot { flex: none; padding: 8px 10px 12px; }
.pa-waw--nofoot .pa-waw__foot { display: none; }
.pa-waw__consent {
    font-size: .62rem; color: #6d7d72; text-align: center;
    margin: 0 0 6px; display: none;
}
.pa-waw__consent.on { display: block; }
.pa-waw__consent a { color: inherit; text-decoration: underline dotted; }
.pa-waw__bar { display: flex; gap: 8px; align-items: flex-end; }
.pa-waw__field {
    flex: 1; background: #fff; border-radius: 22px; padding: 11px 15px;
    border: 1.5px solid transparent; display: flex; align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.pa-waw__field.err { border-color: #e05656; }
.pa-waw__field input {
    border: 0; outline: 0; width: 100%; background: transparent;
    font-family: inherit; font-size: .88rem; color: #111B21;
}
.pa-waw__field input::placeholder { color: #98a59d; }
.pa-waw__field input:disabled { cursor: default; }
.pa-waw__send {
    width: 46px; height: 46px; border-radius: 50%; border: 0; flex: none;
    background: #25D366; color: #fff; cursor: pointer;
    display: grid; place-items: center;
    box-shadow: 0 4px 12px rgba(18, 110, 58, .35);
    transition: transform .15s ease, background .15s ease;
}
.pa-waw__send:hover { transform: scale(1.06); }
.pa-waw__send:disabled {
    background: #b9cfc0; box-shadow: none; transform: none; cursor: default;
}
.pa-waw__hint {
    font-size: .64rem; color: #6d7d72; text-align: center;
    margin: 6px 0 0; min-height: .9em;
}
.pa-waw__hint.act { cursor: pointer; font-weight: 700; color: #0f7a43; }

/* Botón de rescate (solo si el POST falla): ir a WhatsApp directo */
.pa-waw__rescue {
    align-self: stretch; flex: none; display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #25D366; color: #053019; text-decoration: none;
    font-weight: 800; font-size: .9rem; font-family: inherit;
    border: 0; border-radius: 14px; padding: 14px 16px; margin-top: 4px; cursor: pointer;
    box-shadow: 0 8px 22px rgba(18, 110, 58, .38);
    animation: pa-waw-pop .25s ease;
}
.pa-waw__rescue:hover { transform: translateY(-1px); }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .pa-waw__panel, .pa-waw__scrim, .pa-waw__bub, .pa-waw__chip { transition: none; animation: none; }
    .pa-waw__typing i { animation: none; opacity: .6; }
    .pa-waw__spin { animation-duration: 1.4s; }
}
