/* GRANJA GO - Estilos Base y Animaciones */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

html, body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #0f172a;
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
}

/* ===================================================
   PILLS DE CATEGORÍAS 100% ESTABLES (CERO MOVIMIENTOS)
   =================================================== */
.category-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 18px !important;
    height: 42px !important;
    font-size: 13px !important;
    font-weight: 700 !important; /* EXACTAMENTE EL MISMO EN AMBOS ESTADOS */
    letter-spacing: normal !important;
    border-radius: 14px !important;
    white-space: nowrap !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    outline: none !important;
    transform: none !important;
    margin: 0 !important;
}

.category-pill:hover:not(.active) {
    background-color: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* Icono en estado INACTIVO: Color oscuro nítido (#0f172a), alta visibilidad sobre fondo blanco */
.category-pill i {
    color: #0f172a !important;
    font-size: 16px !important;
    line-height: 1 !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: color 0.15s ease !important;
}

/* Estado ACTIVO: Verde esmeralda intenso con texto e icono BLANCO PURO (Sin sombra verde) */
.category-pill.active {
    background-color: #059669 !important;
    color: #ffffff !important;
    border-color: #047857 !important;
    box-shadow: none !important;
    font-weight: 700 !important; /* EXACTAMENTE MISMO PESO PARA NO MOVERSE NI 1 PIXEL */
}

/* Icono en estado ACTIVO: BLANCO PURO TOTALMENTE VISIBLE SOBRE EL FONDO VERDE */
.category-pill.active i {
    color: #ffffff !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Contenedor de Pills */
#categories_pills {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ===================================================
   BOTONES DE FILTRO Y ORDEN 100% ESTABLES (CERO MOVIMIENTO)
   =================================================== */
.sort-filter-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0 12px !important;
    height: 32px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    border-radius: 12px !important;
    white-space: nowrap !important;
    background-color: #ffffff !important;
    color: #334155 !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04) !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    outline: none !important;
    transform: none !important;
    margin: 0 !important;
}

.sort-filter-btn:hover:not(.active) {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

.sort-filter-btn i {
    font-size: 11px !important;
    line-height: 1 !important;
    display: inline-block !important;
    transition: color 0.15s ease !important;
}

/* Iconos específicos en reposo */
.sort-filter-btn[data-sort="deals"] i { color: #f43f5e !important; }
.sort-filter-btn[data-sort="bestsellers"] i { color: #f59e0b !important; }
.sort-filter-btn[data-sort="featured"] i { color: #0ea5e9 !important; }
.sort-filter-btn[data-sort="alpha"] i { color: #64748b !important; }
.sort-filter-btn[data-sort="default"] i { color: #059669 !important; }

/* Estado ACTIVO: Verde esmeralda idéntico, borde y dimensiones fijas, texto e icono en blanco puro */
.sort-filter-btn.active {
    background-color: #059669 !important;
    color: #ffffff !important;
    border: 1.5px solid #047857 !important;
    box-shadow: 0 1px 3px 0 rgba(4, 120, 87, 0.3) !important;
    font-weight: 700 !important;
}

.sort-filter-btn.active i {
    color: #ffffff !important;
}

#sort_buttons_bar {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

/* Scrollbar estética y limpia */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #10b981;
}

/* Transiciones del Carrito Lateral */
.cart-drawer-overlay {
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer-panel {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Tarjeta de Producto */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* Modal legal y checkout */
.modal-fade-in {
    animation: modalFadeIn 0.25s ease-out forwards;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Botón Flotante de WhatsApp - Onda sutil y elegante */
@keyframes wspSubtleRipple {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55), 0 6px 16px rgba(0, 0, 0, 0.25);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(37, 211, 102, 0), 0 6px 16px rgba(0, 0, 0, 0.25);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0), 0 6px 16px rgba(0, 0, 0, 0.25);
    }
}

#floating_whatsapp_btn {
    animation: wspSubtleRipple 2.5s infinite;
}

#floating_whatsapp_btn:hover {
    animation: none;
    box-shadow: 0 10px 22px -2px rgba(37, 211, 102, 0.5), 0 4px 10px rgba(0, 0, 0, 0.2);
}
