/* ============================================
   Widgets: video Sobre nosotros + asistente VA
   ============================================ */

/* —— Botón play flotante (Sobre nosotros) —— */
.about-image {
    border-radius: 4px;
}

.about-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 68px;
    height: 68px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--gold-light, #d4af37), var(--gold-dark, #a8861e));
    color: var(--dark);
    font-size: 1.35rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 4px var(--gold-a25);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    padding-left: 4px;
}

.about-video-play i {
    position: relative;
    z-index: 2;
}

.about-video-play-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--gold-a60);
    animation: aboutPlayPulse 2.2s ease-out infinite;
    pointer-events: none;
}

.about-video-play-pulse-2 {
    animation-delay: 1.1s;
}

.about-video-play:hover,
.about-video-play:focus-visible {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 12px 40px var(--gold-a45), 0 0 0 6px var(--gold-a20);
    outline: none;
}

.about-video-play:active {
    transform: translate(-50%, -50%) scale(0.96);
}

@keyframes aboutPlayPulse {
    0% { transform: scale(1); opacity: 0.85; }
    100% { transform: scale(1.55); opacity: 0; }
}

@media (max-width: 575px) {
    .about-video-play {
        width: 58px;
        height: 58px;
        font-size: 1.15rem;
    }
}

/* —— Modal video —— */
.media-modal {
    position: fixed;
    inset: 0;
    z-index: 14000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.media-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.media-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
}

.media-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    background: var(--dark-2, #141414);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--gold-a25);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.92);
    transition: transform 0.3s ease;
}

.media-modal.open .media-modal-dialog {
    transform: scale(1);
}

.media-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 5;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: var(--white);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.media-modal-close:hover {
    background: var(--gold);
    color: var(--dark);
}

.media-modal-body {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.media-modal-body video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.media-modal-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
}

.media-modal-placeholder i {
    font-size: 2.5rem;
    color: var(--gold);
}

.media-modal-placeholder small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* —— Asistente virtual — botón fijo (estilo chat widget) —— */
.va-fab {
    position: fixed;
    z-index: 1080;
    right: 1rem;
    bottom: calc(var(--app-tabbar-h, 0px) + var(--app-safe-bottom, 0px) + 16px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease, opacity 0.25s ease;
}

@media (min-width: 992px) {
    .va-fab {
        right: 1.5rem;
        bottom: 1.5rem;
    }

    .va-chat-panel {
        bottom: 100px !important;
    }
}

.va-fab-avatar {
    position: relative;
    flex-shrink: 0;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    color: var(--dark);
    background: linear-gradient(145deg, var(--gold-light, #e8c547), var(--gold, var(--gold)) 45%, var(--gold-dark, #9a7b1a));
    border: 3px solid rgba(255, 255, 255, 0.25);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.45),
        0 0 0 1px var(--gold-a35),
        inset 0 2px 4px rgba(255, 255, 255, 0.35);
}

.va-fab-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--dark-2, #141414);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.va-fab-text {
    display: none;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.55rem 1rem 0.55rem 0.85rem;
    background: rgba(13, 13, 13, 0.94);
    border: 1px solid var(--gold-a35);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.va-fab-text strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.02em;
}

.va-fab-text span {
    font-size: 0.68rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

@media (min-width: 768px) {
    .va-fab-text {
        display: flex;
    }

    .va-fab-avatar {
        width: 62px;
        height: 62px;
        font-size: 1.55rem;
    }
}

.va-fab:hover,
.va-fab:focus-visible {
    transform: scale(1.04);
    outline: none;
}

.va-fab:active {
    transform: scale(0.97);
}

.va-fab[aria-expanded="true"] .va-fab-avatar {
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.45),
        0 0 0 4px var(--gold-a45),
        inset 0 2px 4px rgba(255, 255, 255, 0.35);
}

/* Mini avatar en panel chat */
.va-chat-avatar-mini {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--dark);
    background: linear-gradient(145deg, var(--gold-light, #e8c547), var(--gold-dark, #9a7b1a));
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* —— Panel chat asistente —— */
.va-chat-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1350;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.va-chat-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.va-chat-panel {
    position: fixed;
    z-index: 1360;
    background: linear-gradient(165deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid var(--gold-a25);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Móvil: bottom sheet */
@media (max-width: 991px) {
    .va-chat-panel {
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 72vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        padding-bottom: calc(var(--app-safe-bottom, 0px) + 0.5rem);
    }

    .va-chat-panel.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }
}

/* Escritorio: panel flotante */
@media (min-width: 992px) {
    .va-chat-panel {
        right: 24px;
        bottom: 24px;
        width: 380px;
        max-height: 520px;
        border-radius: 20px;
        transform: translateY(20px) scale(0.96);
    }

    .va-chat-panel.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }
}

.va-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--gold-a08);
}

.va-chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.va-chat-header strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.va-chat-header span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.va-chat-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.va-chat-close:hover {
    background: var(--gold);
    color: var(--dark);
}

.va-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.15rem;
    min-height: 160px;
    max-height: 280px;
}

.va-msg {
    margin-bottom: 0.85rem;
    max-width: 92%;
}

.va-msg p {
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.va-msg-bot p {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.va-msg-user {
    margin-left: auto;
}

.va-msg-user p {
    background: var(--gold-a15);
    border: 1px solid var(--gold-a25);
    color: var(--white);
}

.va-chat-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.va-chat-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--dark);
    color: var(--white);
    font-size: 16px;
}

.va-chat-form input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.va-chat-form button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--gold);
    color: var(--dark);
    cursor: pointer;
    flex-shrink: 0;
}

.va-chat-form button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.va-chat-soon {
    margin: 0;
    padding: 0.5rem 1rem 0.85rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
}

.va-chat-soon i {
    margin-right: 0.35rem;
}

.va-chat-soon--live {
    color: #86efac;
}

.va-msg-typing p {
    opacity: 0.75;
    font-style: italic;
}

body.va-chat-open {
    overflow: hidden;
}

body.va-chat-open .va-fab {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@media (max-width: 991px) {
    body.va-chat-open .app-tabbar {
        z-index: 1040;
    }
}

/* —— WhatsApp contacto rápido —— */
.wa-contact-widget {
    position: fixed;
    z-index: 1075;
    left: 1rem;
    bottom: calc(var(--app-tabbar-h, 0px) + var(--app-safe-bottom, 0px) + 16px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

@media (min-width: 992px) {
    .wa-contact-widget {
        left: 1.5rem;
        bottom: 1.5rem;
    }
}

.wa-contact-fab {
    position: relative;
    width: 60px;
    height: 60px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease;
}

.wa-contact-fab:hover {
    transform: scale(1.06);
}

.wa-contact-fab:active {
    transform: scale(0.96);
}

.wa-contact-fab-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.35);
    animation: wa-pulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes wa-pulse {
    0% { transform: scale(0.92); opacity: 0.85; }
    70% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

.wa-contact-fab-icon {
    position: relative;
    z-index: 1;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    color: #fff;
    background: linear-gradient(145deg, #25d366 0%, #128c7e 100%);
    box-shadow:
        0 6px 24px rgba(37, 211, 102, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.wa-contact-fab[aria-expanded="true"] .wa-contact-fab-icon {
    background: linear-gradient(145deg, #128c7e 0%, #075e54 100%);
}

.wa-contact-fab[aria-expanded="true"] .wa-contact-fab-pulse {
    animation: none;
    opacity: 0;
}

.wa-contact-panel {
    order: -1;
    width: min(320px, calc(100vw - 2rem));
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transform: translateY(10px) scale(0.96);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform-origin: bottom left;
    transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.22s ease, visibility 0.22s;
}

.wa-contact-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.wa-contact-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #075e54, #128c7e);
    color: #fff;
}

.wa-contact-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.wa-contact-header-text {
    flex: 1;
    min-width: 0;
}

.wa-contact-header-text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-contact-header-text span {
    display: block;
    font-size: 0.72rem;
    opacity: 0.88;
    margin-top: 0.1rem;
}

.wa-contact-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.wa-contact-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.wa-contact-form {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: #ece5dd;
}

.wa-contact-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #54656f;
    margin-bottom: 0.3rem;
}

.wa-contact-field input,
.wa-contact-field textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #d1d7db;
    background: #fff;
    color: #111;
    font: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wa-contact-field input:focus,
.wa-contact-field textarea:focus {
    outline: none;
    border-color: #25d366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

.wa-contact-field textarea {
    resize: vertical;
    min-height: 72px;
}

.wa-contact-submit {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
}

.wa-contact-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.wa-contact-submit:disabled {
    opacity: 0.65;
    cursor: wait;
}

.wa-contact-note {
    margin: 0;
    font-size: 0.68rem;
    color: #667781;
    text-align: center;
    line-height: 1.4;
}

.wa-contact-note--warn {
    color: #b45309;
}

.wa-contact-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1070;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.wa-contact-backdrop.open {
    opacity: 1;
    visibility: visible;
}

body.wa-contact-open {
    overflow: hidden;
}

@media (max-width: 991px) {
    body.wa-contact-open .app-tabbar {
        z-index: 1060;
    }
}

@media (min-width: 992px) {
    body.wa-contact-open {
        overflow: auto;
    }
}

/* Móvil: WhatsApp apilado encima del asistente IA (derecha) */
@media (max-width: 991px) {
    .wa-contact-widget {
        left: auto !important;
        right: 1rem !important;
        bottom: calc(var(--app-tabbar-h, 0px) + var(--app-safe-bottom, 0px) + 16px + 58px + 14px) !important;
        align-items: flex-end !important;
    }

    .wa-contact-panel {
        transform-origin: bottom right;
        width: min(300px, calc(100vw - 2rem));
    }

    .wa-contact-fab {
        width: 52px;
        height: 52px;
    }

    .wa-contact-fab-icon {
        width: 52px;
        height: 52px;
        font-size: 1.6rem;
    }
}
