﻿/* ===========================
   BOTÓN SOPORTE (ESCRÍBENOS)
   =========================== */

.soporte-boton {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: rgb(0, 150, 64);
    color: #fff;
    padding: 10px 15px;
    border-radius: 43px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    overflow: hidden;
    width: 90px;
    height: 90px;
    transition: width 0.4s ease, background-color 0.3s ease;
}

    .soporte-boton:hover {
        width: 210px;
    }

    .soporte-boton.activo {
        background-color: #009A44;
    }

/* Íconos flotantes (tamaño fijo 40x40) */
.fab-icon {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    font-size: 40px !important;
    line-height: 40px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0 !important;
    transform: none !important;
    margin-right: 8px !important;
    /* Aseguramos Font Awesome 6 */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

/* Ícono específico del botón de soporte (comentarios) */
#soporte-boton .fa-comments,
#soporte-boton .fa-comments::before {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 40px !important;
    line-height: 1 !important;
}

/* Texto del botón soporte */
.soporte-boton .soporte-texto {
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 23px;
}

.soporte-boton:hover .soporte-texto {
    opacity: 1;
    transform: translateX(0);
}

/* ===========================
   PANEL DE SOPORTE (FORMULARIO)
   =========================== */

.soporte-panel {
    position: fixed;
    bottom: 20px;
    left: 50px;
    background-color: #fff;
    border: 1px solid #211f1f;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px;
    z-index: 1001;
    width: min(92vw, 420px);
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: all 0.3s ease;
    height: auto;
    /* alto máximo: viewport - FAB - margen */
    max-height: calc(100vh - (var(--fab-gap) + var(--fab-height) + 24px));
    overflow-y: auto;
}

    .soporte-panel.activo {
        opacity: 1;
        pointer-events: auto;
    }

.soporte-form-group {
    margin-bottom: 10px;
}

    .soporte-form-group span {
        display: block;
        font-size: 14px;
        margin-bottom: 4px;
    }

    .soporte-form-group input {
        width: 90%;
        padding: 6px;
        border-radius: 5px;
        border: 1px solid #ccc;
        font-size: 14px;
    }

.soporte-btn {
    background: #fff;
    border: 2px solid rgb(0, 166, 81);
    color: rgb(0, 166, 81);
    border-radius: 5px;
    padding: 6px 12px;
    font-size: 15px;
    cursor: pointer;
}

.soporte-cerrar {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: #d6009a;
    cursor: pointer;
}

/* ===========================
   CORRECCIÓN GLOBAL FONT AWESOME
   (para que Genesys no cambie la fuente)
   =========================== */

.soporte-boton i,
.boton-chat i,
.boton-rastreo i,
#boton-rastreo i,
#boton-chat i {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    text-rendering: auto !important;
}

/* Uso de unidades dinámicas en móviles con notch */
@supports (height: 100dvh) {
    .soporte-panel {
        max-height: calc(100dvh - (var(--fab-gap) + var(--fab-height) + env(safe-area-inset-bottom) + 24px));
    }
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 991.98px) {
    #soporte-boton {
        width: 70px !important;
        height: 60px !important;
    }

        #soporte-boton i {
            font-size: 40px !important;
        }

        #soporte-boton .soporte-texto {
            display: none !important;
        }

    #soporte-panel {
        transform: translate(-10%, -30%) !important;
        width: auto !important;
    }

    #soporte-boton .fa-comments,
    #soporte-boton .fa-comments::before {
        font-size: 30px !important;
    }
}
