/* ============ Contenedor y trigger principal ============ */
.vh-fcta-root {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 99998;
    font-family: inherit;
}
.vh-fcta-trigger {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: #fff;
    box-shadow: 0 6px 24px rgba(247,147,30,0.55), 0 2px 10px rgba(0,0,0,.15);
    display: flex; align-items: center; justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
}
.vh-fcta-trigger:hover { transform: scale(1.08); box-shadow: 0 8px 32px rgba(247,147,30,0.7), 0 2px 12px rgba(0,0,0,.2); }
.vh-fcta-trigger:active { transform: scale(0.95); }
.vh-fcta-trigger svg { width: 26px; height: 26px; transition: transform .3s ease; }
.vh-fcta-trigger.is-open svg { transform: rotate(135deg); }
.vh-fcta-trigger::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    opacity: .35;
    z-index: -1;
    animation: vh-fcta-pulse 2s ease-out infinite;
}
@keyframes vh-fcta-pulse {
    0%   { transform: scale(1);   opacity: .35; }
    70%  { transform: scale(1.4); opacity: 0;   }
    100% { transform: scale(1.4); opacity: 0;   }
}

/* ============ Satélites ============ */
.vh-fcta-sat {
    position: absolute;
    left: 4px;
    width: 52px; height: 52px;
    border-radius: 50%;
    border: 0;
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    opacity: 0;
    transform: scale(0.5) translateY(20px);
    pointer-events: none;
    transition: all .3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
}
.vh-fcta-sat svg { width: 22px; height: 22px; }
.vh-fcta-root.is-open .vh-fcta-sat {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}
.vh-fcta-sat-wa     { bottom: 78px;  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%); transition-delay: .05s; }
.vh-fcta-sat-call   { bottom: 138px; background: linear-gradient(135deg, #4DB6CC 0%, #1F708A 100%); transition-delay: .10s; }
.vh-fcta-sat-review { bottom: 198px; background: linear-gradient(135deg, #FBBC04 0%, #E37400 100%); transition-delay: .15s; }
.vh-fcta-sat:hover  { transform: scale(1.12); }

/* Tooltips */
.vh-fcta-sat-tip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #222; color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}
.vh-fcta-sat-tip::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-right-color: #222;
}
.vh-fcta-sat:hover .vh-fcta-sat-tip { opacity: 1; }

/* Backdrop cuando el panel principal está abierto */
.vh-fcta-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99997;
    display: none;
    opacity: 0;
    transition: opacity .25s;
}
.vh-fcta-backdrop.is-open { display: block; opacity: 1; }

/* ============ Panel modal formulario ============ */
.vh-fcta-modal {
    position: fixed;
    left: 50%; top: 50%;
    transform: translate(-50%, calc(-50% + 20px));
    width: min(92vw, 480px);
    max-height: 88vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 48px rgba(0,0,0,.35);
    z-index: 99999;
    overflow: hidden;
    display: none;
    opacity: 0;
    transition: opacity .25s, transform .25s;
    flex-direction: column;
}
.vh-fcta-modal.is-open {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%);
}
.vh-fcta-modal-header {
    padding: 20px 24px 16px;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: #fff;
    position: relative;
}
.vh-fcta-modal-title {
    margin: 0;
    font-size: 20px; /* Airbnb H3 modal - PX ABSOLUTO (theme usa html:62.5%) */
    font-weight: 700;
    line-height: 1.25;
}
.vh-fcta-modal-sub {
    margin: 6px 0 0;
    font-size: 15px; /* Airbnb sub */
    opacity: 0.95;
    line-height: 1.45;
}
.vh-fcta-modal-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 32px; height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.vh-fcta-modal-close:hover { background: rgba(255,255,255,.35); }
.vh-fcta-modal-close svg { width: 16px; height: 16px; }

.vh-fcta-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}
.vh-fcta-field { margin-bottom: 18px; }
.vh-fcta-field-label {
    display: block;
    font-size: 13px; /* labels legibles - PX ABSOLUTO */
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
/* Inputs y selects Airbnb-style: 16px es CRÍTICO en móvil para evitar zoom iOS */
.vh-fcta-input, .vh-fcta-select {
    width: 100%;
    border: 1.5px solid #d0d0d0;
    border-radius: 10px;
    padding: 14px 16px; /* +padding táctil */
    font-size: 16px; /* px explícito para no depender de rem: iOS no hace zoom si input>=16px */
    font-family: inherit;
    color: #222;
    line-height: 1.4;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
    box-sizing: border-box;
    min-height: 52px; /* área táctil Apple/Material recomendada */
    -webkit-appearance: none;
    appearance: none;
}
.vh-fcta-select {
    /* flecha personalizada porque quitamos appearance */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}
.vh-fcta-input::placeholder {
    color: #999;
    font-size: 16px;
    opacity: 1;
}
.vh-fcta-input:focus, .vh-fcta-select:focus {
    outline: 0;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255,107,53,.12);
}
/* Inputs de tipo date: mismo tamaño legible */
.vh-fcta-input[type="date"] {
    font-size: 16px;
    color: #222;
}
.vh-fcta-input[type="date"]::-webkit-datetime-edit-text,
.vh-fcta-input[type="date"]::-webkit-datetime-edit-month-field,
.vh-fcta-input[type="date"]::-webkit-datetime-edit-day-field,
.vh-fcta-input[type="date"]::-webkit-datetime-edit-year-field {
    font-size: 16px;
    color: #222;
}
.vh-fcta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .vh-fcta-row { grid-template-columns: 1fr; } }

.vh-fcta-chips {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-top: 8px;
}
.vh-fcta-chip {
    border: 1.5px solid #d0d0d0;
    background: #fff;
    color: #222;
    border-radius: 999px; /* pill Airbnb */
    padding: 10px 16px;
    font-size: 15px; /* legible PX ABSOLUTO */
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    min-height: 42px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.vh-fcta-chip:hover { border-color: #FF6B35; }
.vh-fcta-chip.is-selected {
    background: #FF6B35;
    border-color: #FF6B35;
    color: #fff;
    font-weight: 600;
}

.vh-fcta-modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #ebebeb;
    background: #fafafa;
}
.vh-fcta-submit {
    width: 100%;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 17px; /* botón principal Airbnb-style PX ABSOLUTO */
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 14px rgba(37,211,102,.4);
    font-family: inherit;
    min-height: 54px;
    letter-spacing: 0.2px;
}
.vh-fcta-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,211,102,.55); }
.vh-fcta-submit:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.vh-fcta-submit svg { width: 20px; height: 20px; }

.vh-fcta-legal {
    margin: 12px 0 0;
    font-size: 12px; /* legal footer legible PX ABSOLUTO */
    color: #6a6a6a;
    text-align: center;
    line-height: 1.5;
}
.vh-fcta-legal a { color: #FF6B35; text-decoration: underline; }

.vh-fcta-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231,76,60,.12) !important;
}

/* Mobile: mueve el botón un poco arriba para no tapar con el footer sticky */
@media (max-width: 640px) {
    .vh-fcta-root { left: 16px; bottom: 16px; }
    .vh-fcta-trigger { width: 56px; height: 56px; }
    .vh-fcta-sat { width: 48px; height: 48px; }
    .vh-fcta-sat-wa     { bottom: 68px;  }
    .vh-fcta-sat-call   { bottom: 122px; }
    .vh-fcta-sat-review { bottom: 176px; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE MODAL v3: Airbnb typography en PX ABSOLUTOS
   (theme Homey usa html:62.5% - los rem se dividen entre 10 - NO USAR)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .vh-fcta-modal-panel {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    .vh-fcta-modal-header {
        padding: 22px 20px 18px !important;
    }
    .vh-fcta-modal-title {
        font-size: 19px !important;
        line-height: 1.25 !important;
        font-weight: 700 !important;
    }
    .vh-fcta-modal-sub {
        font-size: 15px !important;
        line-height: 1.45 !important;
        margin-top: 8px !important;
        opacity: 0.95 !important;
    }
    .vh-fcta-modal-body {
        padding: 20px 18px !important;
    }
    .vh-fcta-modal-footer {
        padding: 16px 18px 22px !important;
        padding-bottom: calc(22px + env(safe-area-inset-bottom, 0)) !important;
    }
    .vh-fcta-field { margin-bottom: 18px !important; }
    .vh-fcta-field-label {
        font-size: 13px !important;
        letter-spacing: 0.6px !important;
        margin-bottom: 8px !important;
        font-weight: 700 !important;
        color: #333 !important;
        text-transform: uppercase !important;
    }
    /* CRÍTICO: 16px px reales para inputs/select → sin zoom iOS + legible */
    .vh-fcta-input,
    .vh-fcta-select,
    .vh-fcta-input[type="date"],
    .vh-fcta-input[type="tel"],
    .vh-fcta-input[type="text"] {
        font-size: 16px !important;
        line-height: 1.4 !important;
        min-height: 54px !important;
        padding: 14px 16px !important;
        border-radius: 12px !important;
        color: #222 !important;
    }
    .vh-fcta-select {
        padding-right: 42px !important;
        background-position: right 16px center !important;
    }
    .vh-fcta-input::placeholder {
        font-size: 16px !important;
        color: #999 !important;
    }
    /* Chips: legibles + área táctil */
    .vh-fcta-chips { gap: 10px !important; margin-top: 10px !important; }
    .vh-fcta-chip {
        font-size: 15px !important;
        padding: 12px 16px !important;
        min-height: 44px !important;
        border-radius: 999px !important;
        font-weight: 500 !important;
        color: #222 !important;
    }
    .vh-fcta-chip.is-selected { color: #fff !important; font-weight: 600 !important; }
    /* Botón submit: 17px táctil */
    .vh-fcta-submit {
        font-size: 17px !important;
        padding: 16px 20px !important;
        min-height: 56px !important;
        border-radius: 12px !important;
        font-weight: 700 !important;
        color: #fff !important;
    }
    /* Legal footer: legible sin ser dominante */
    .vh-fcta-legal {
        font-size: 12px !important;
        line-height: 1.5 !important;
        margin-top: 12px !important;
        color: #6a6a6a !important;
    }
    /* Close btn más táctil */
    .vh-fcta-modal-close {
        width: 40px !important;
        height: 40px !important;
        top: 14px !important;
        right: 14px !important;
    }
    .vh-fcta-modal-close svg { width: 18px !important; height: 18px !important; }
}

/* Extra pequeño: iPhone SE / móviles antiguos 320-400px */
@media (max-width: 400px) {
    .vh-fcta-modal-header { padding: 20px 16px 16px !important; }
    .vh-fcta-modal-body   { padding: 18px 16px !important; }
    .vh-fcta-modal-footer { padding: 14px 16px 20px !important; }
    .vh-fcta-modal-title  { font-size: 18px !important; }
    .vh-fcta-modal-sub    { font-size: 14px !important; }
    .vh-fcta-input, .vh-fcta-select {
        padding: 13px 14px !important;
        min-height: 50px !important;
        font-size: 16px !important;
    }
    .vh-fcta-chip { padding: 10px 14px !important; font-size: 14px !important; }
    .vh-fcta-field-label { font-size: 12px !important; }
}

/* ============================================================
   COEXISTENCIA CON EL MENÚ LATERAL
   El FAB usa z-index 99998, muy por encima de los drawers
   (#vh-drawer 10001 · #vhStaticDrawer 1100). Sin esto, el botón
   flotaba sobre el menú abierto y tapaba enlaces.
   Mientras un drawer esté abierto el FAB se retira.
   ============================================================ */
html.vh-ux-drawer-open #vh-fcta-root,
html.vh-ux-drawer-open #vh-fcta-backdrop,
html.vh-ux-drawer-open #vh-fcta-modal {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity .18s ease, visibility .18s ease !important;
}
/* Respaldo sin JS (navegadores con :has) */
body:has(#vh-drawer.is-open) #vh-fcta-root,
body:has(#vhStaticDrawer.is-open) #vh-fcta-root,
body:has(.vh-drawer.is-open) #vh-fcta-root {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
