/*
 * LeBike Floating Button — Frontend styles
 * Las variables --lfb-bg, --lfb-fg, --lfb-ac se inyectan inline desde PHP
 * con los colores configurados en el panel de ajustes.
 */

/* ── Wrapper fijo ─────────────────────────────────────────────────────────── */
#lfbtn {
    position: fixed;
    z-index: 99999;
    /* La posición (bottom/top/left/right) se inyecta inline desde PHP */
}

/* ── La caja que morphea ──────────────────────────────────────────────────── */
#lfbtn-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--lfb-w, auto);
    height: var(--lfb-h, 50px);
    min-width: 160px;
    background: var(--lfb-bg);
    border-radius: var(--lfb-r, 50px);
    box-shadow: 0 4px 22px rgba(0, 0, 0, .22);
    cursor: pointer;
    overflow: hidden;
    positio0n: relative;

    /* Transiciones del morphing */
    transition:
        width         .45s cubic-bezier(.34, 1.05, .64, 1),
        height        .45s cubic-bezier(.34, 1.05, .64, 1),
        border-radius .38s ease,
        background    .3s  ease,
        box-shadow    .3s  ease,
        min-width     .3s  ease;
}

/* Estado expandido */
#lfbtn-box.is-open {
    width: 450px;
    min-width: 400px;
    height: var(--lfb-open-h, 320px);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 56px rgba(0, 0, 0, .18);
    cursor: default;
}

@media (max-width: 768px) {
#lfbtn-box.is-open {
    min-width: 360px !important;	
	width: 85% !important;
    }
}


/* ── Cara A: pastilla-botón ───────────────────────────────────────────────── */
#lfbtn-face-btn {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    gap: 8px;
    color: var(--lfb-fg);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    transition: opacity .18s ease, transform .22s ease;
    pointer-events: auto;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
}

#lfbtn-box.is-open #lfbtn-face-btn {
    opacity: 0;
    transform: scale(.8);
    pointer-events: none;
}

#lfbtn-box:not(.is-open):hover #lfbtn-face-btn {
    transform: scale(1.04);
}

/* Texto corto en móvil */
.lfbtn-lshort { display: none; }

@media (max-width: 480px) {
    .lfbtn-lfull          { display: none; }
    .lfbtn-lshort         { display: inline; }
    #lfbtn-face-btn       { font-size: 14px; padding: 0 18px; }
}

/* ── Animación de pulso (solo en estado botón) ────────────────────────────── */
@keyframes lfb-pulse {
    0%   { box-shadow: 0 0 0 0   var(--lfb-bg-pulse, rgba(61, 84, 136, .53)); }
    70%  { box-shadow: 0 0 0 14px var(--lfb-bg-pulse, rgba(61, 84, 136, 0)); }
    100% { box-shadow: 0 0 0 0   var(--lfb-bg-pulse, rgba(61, 84, 136, 0)); }
}

#lfbtn.has-pulse #lfbtn-box:not(.is-open) {
    animation: lfb-pulse 2.4s ease-out infinite;
}

/* ── Cara B: formulario de fechas ────────────────────────────────────────── */
#lfbtn-face-form {
    position: absolute;
    inset: 0;
    padding: 22px 20px 18px;
    opacity: 0;
    transform: translateY(10px) scale(.96);
    transition: opacity .25s ease .12s, transform .28s ease .1s;
    pointer-events: none;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0;
}

#lfbtn-box.is-open #lfbtn-face-form {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

/* Header del formulario */
.lfbtn-fh {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.lfbtn-fh h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1a2035;
    line-height: 1.3;
    flex: 1;
}

#lfbtn-cls {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #bbb;
    padding: 0;
    line-height: 1;
    transition: color .15s;
    flex-shrink: 0;
    margin-left: 8px;
}

#lfbtn-cls:hover { color: #555; }

/* Grid de campos */
.lfbtn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.lfbtn-f label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #9ba3bc;
    margin-bottom: 4px;
}

.lfbtn-f input {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #e0e3ec;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    color: #1a2035;
    background: #f8f9fc;
    outline: none;
    transition: border-color .15s, background .15s;
}

.lfbtn-f input:focus {
    border-color: var(--lfb-bg);
    background: #fff;
}

/* Mensaje de error */
#lfbtn-err {
    font-size: 11px;
    color: #e24b4a;
    margin-bottom: 6px;
    min-height: 15px;
}

/* Botón de confirmación */
#lfbtn-go {
    margin-top: auto;
    width: 100%;
    padding: 11px;
    background: var(--lfb-ac);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity .15s, transform .15s;
}

#lfbtn-go:hover:not(:disabled) {
    opacity: .9;
    transform: translateY(-1px);
}

#lfbtn-go:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
}

/* ── Ocultar en móvil (clase opcional) ───────────────────────────────────── */
#lfbtn.lfbtn--nomob {
    display: block; /* por defecto visible */
}

@media (max-width: 768px) {
    #lfbtn.lfbtn--nomob { display: none !important; }
}
