/* G1 :: g1-update-fab - FAB siempre visible "casi molesto" */

.g1-fab-wrap {
    /* Wrapper para que el FAB y el modal queden en el mismo z-index */
    position: relative;
    z-index: 9999;
}

/* === FAB principal === */
.g1-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 3px solid white;
    color: white;
    cursor: pointer;
    box-shadow:
        0 4px 12px rgba(245, 158, 11, 0.4),
        0 0 0 4px rgba(245, 158, 11, 0.15);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    animation: g1-fab-bounce 3s ease-in-out infinite;
}
.g1-fab:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow:
        0 6px 20px rgba(245, 158, 11, 0.6),
        0 0 0 6px rgba(245, 158, 11, 0.2);
}
.g1-fab:active {
    transform: scale(0.95);
}
.g1-fab.g1-fab-open {
    animation: none;
    transform: scale(1.05) rotate(15deg);
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

/* Animacion bounce - "casi molesto" pero no agresivo */
@keyframes g1-fab-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Modo CRITICA - mas agresivo */
.g1-fab.g1-fab-critica {
    animation: g1-fab-pulse-fuerte 1.2s ease-in-out infinite;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border-color: #fca5a5;
}
@keyframes g1-fab-pulse-fuerte {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 6px 24px rgba(220, 38, 38, 0.8), 0 0 0 8px rgba(220, 38, 38, 0.2);
    }
}

.g1-fab-ico {
    font-size: 1.8rem;
    line-height: 1;
}

/* Badge contador */
.g1-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.78rem;
    font-weight: 800;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Pulse anillo expandiéndose */
.g1-fab-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #f59e0b;
    animation: g1-fab-ring-pulse 2s ease-out infinite;
    pointer-events: none;
    opacity: 0;
}
@keyframes g1-fab-ring-pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* === Modal === */
.g1-fab-modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 1rem;
    animation: g1-fab-modal-fadein 0.2s ease;
}
@keyframes g1-fab-modal-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

.g1-fab-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    margin-bottom: 5rem;  /* Hueco para que se vea el FAB abajo */
    margin-right: 0.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: g1-fab-modal-slidein 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}
@keyframes g1-fab-modal-slidein {
    from { transform: translate(20px, 30px) scale(0.9); opacity: 0; }
    to { transform: translate(0, 0) scale(1); opacity: 1; }
}

.g1-fab-modal-head {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #fbbf24;
}
.g1-fab-modal-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #78350f;
    line-height: 1.3;
}
.g1-fab-modal-sub {
    font-size: 0.78rem;
    color: #92400e;
    margin-top: 0.2rem;
    font-weight: 600;
}
.g1-fab-modal-close {
    background: rgba(255, 255, 255, 0.5);
    border: none;
    font-size: 1.2rem;
    color: #78350f;
    cursor: pointer;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    line-height: 1;
}
.g1-fab-modal-close:hover { background: rgba(255, 255, 255, 0.9); }

.g1-fab-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem;
    background: #fafafa;
}

.g1-fab-card {
    background: white;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #9ca3af;
}
.g1-fab-card-critica { border-left-color: #dc2626; background: linear-gradient(90deg, #fef2f2 0%, white 50%); }
.g1-fab-card-alta    { border-left-color: #f59e0b; background: linear-gradient(90deg, #fffbeb 0%, white 50%); }
.g1-fab-card-media   { border-left-color: #3b82f6; }
.g1-fab-card-baja    { border-left-color: #9ca3af; }

.g1-fab-card-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}
.g1-fab-card-version {
    background: #1f2937;
    color: white;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: monospace;
}
.g1-fab-card-imp {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.5px;
}
.g1-fab-leida {
    margin-left: auto;
    font-size: 0.7rem;
    color: #10b981;
    font-weight: 600;
}
.g1-fab-card-titulo {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}
.g1-fab-card-desc {
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.4;
}

.g1-fab-loading, .g1-fab-empty {
    text-align: center;
    color: #9ca3af;
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

.g1-fab-modal-foot {
    padding: 0.85rem 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.g1-fab-btn-ghost, .g1-fab-btn-primary {
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    flex: 1;
    min-width: 110px;
}
.g1-fab-btn-ghost {
    background: #f3f4f6;
    color: #374151;
}
.g1-fab-btn-ghost:hover { background: #e5e7eb; }
.g1-fab-btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    flex: 2;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}
.g1-fab-btn-primary:hover { transform: translateY(-1px); }

/* Mobile - FAB mas chico, modal full-screen */
@media (max-width: 640px) {
    .g1-fab {
        width: 56px;
        height: 56px;
        bottom: 1rem;
        right: 1rem;
    }
    .g1-fab-ico { font-size: 1.5rem; }
    .g1-fab-modal {
        max-width: 100%;
        margin: 0;
        margin-bottom: 4.5rem;
        border-radius: 12px 12px 0 0;
        max-height: calc(100vh - 5rem);
    }
    .g1-fab-modal-bg { padding: 0; align-items: flex-end; }
}

/* Ocultar en pantallas de venta activa o lockdown (CSS opcional, lo hace el componente con _visible) */
.g1-fab-hidden { display: none !important; }
