@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}


/* TOOLTIP PARA WHATSAPP */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #25D366;
    padding: 12px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.6s ease-out;
    transition: transform 0.2s ease-in-out;
}

/* Tooltip */
.whatsapp-float::after {
    content: "¿Necesitas ayuda?";
    position: absolute;
    left: 60px; /* distancia del botón */
    bottom: 50%;
    transform: translateY(50%);
    background: #1f2937; /* gris oscuro elegante */
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

/* Flechita del tooltip */
.whatsapp-float::before {
    content: "";
    position: absolute;
    left: 52px;
    bottom: 50%;
    transform: translateY(50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent #1f2937 transparent transparent;
    opacity: 0;
    transition: opacity 0.25s ease-out;
}

/* Mostrar tooltip al pasar el mouse */
.whatsapp-float:hover::after,
.whatsapp-float:hover::before {
    opacity: 1;
}


/* ================================
   TABLA DE DISPONIBILIDAD (FIX)
   ================================ */

/* Forzar que la tabla nunca se desborde */
.tabla-disponibilidad {
    table-layout: fixed !important;
    width: 100% !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* Evitar que las columnas se expandan */
.tabla-disponibilidad th,
.tabla-disponibilidad td {
    max-width: 0 !important;
}

/* Permitir scroll horizontal si es necesario */
.scroll-area {
    overflow-x: auto !important;
}


/* ============================================================
   MODO CARDS EN MÓVIL PARA LA TABLA DE DISPONIBILIDAD
   ============================================================ */

@media (max-width: 640px) {

    /* Ocultar encabezados en móvil */
    .tabla-disponibilidad thead {
        display: none;
    }

    /* Cada fila se convierte en una card */
    .tabla-disponibilidad tr {
        display: block;
        background: white;
        margin-bottom: 12px;
        padding: 12px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    /* Cada celda se convierte en una fila dentro de la card */
    .tabla-disponibilidad td {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        border: none !important;
        max-width: 100% !important;
    }

    /* Etiquetas automáticas para cada campo */
    .tabla-disponibilidad td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #374151;
        margin-right: 10px;
        flex-shrink: 0;
    }

    /* Imagen más grande en móvil */
    .img-producto {
        width: 60px !important;
        height: 60px !important;
    }

    /* Ajustar texto del producto */
    .celda-producto span {
        font-size: 15px;
        line-height: 1.3;
    }
}
