/* ===================== MENU DE CATEGORIAS - VERSÃO WEB MODERNA E PROFISSIONAL ===================== */

/* Container principal do menu */
.category-nav {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
    position: relative;
    overflow: visible;
    padding: 1.25rem 0 !important;
}

/* Container interno - uma linha só */
.categories-flex-desktop {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding: 0 1.25rem !important;
    max-width: 1400px;
    margin: 0 auto;
    overflow: visible !important;
}

/* ==================== BOTÃO "TODAS" - DESTAQUE PREMIUM ==================== */
.category-item-desktop[href*="index.php"]:not([href*="category"]) {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow:
        0 6px 16px rgba(99, 102, 241, 0.3),
        0 2px 6px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    font-weight: 700 !important;
    font-size: 0.65rem !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    padding: 0.625rem 0.875rem !important;
    border-radius: 10px !important;
    width: auto !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    flex-shrink: 0 !important;
}

/* Efeito de brilho sutil no "TODAS" */
.category-item-desktop[href*="index.php"]:not([href*="category"])::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: left 0.5s ease;
}

.category-item-desktop[href*="index.php"]:not([href*="category"]):hover::before {
    left: 100%;
}

/* Hover do "TODAS" */
.category-item-desktop[href*="index.php"]:not([href*="category"]):hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 8px 20px rgba(59, 130, 246, 0.35),
        0 4px 8px rgba(59, 130, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* Estado ativo do "TODAS" */
.category-item-desktop[href*="index.php"]:not([href*="category"]).active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow:
        0 8px 20px rgba(16, 185, 129, 0.35),
        0 4px 8px rgba(16, 185, 129, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* ==================== BOTÕES DE CATEGORIA - DESIGN MODERNO ==================== */
.category-item-desktop:not([href*="index.php"]):not([href*="category"]),
.category-item-desktop[href*="category"] {
    background: #ffffff !important;
    color: #374151 !important;
    border: 1.5px solid #e5e7eb !important;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04) !important;
    font-weight: 600 !important;
    font-size: 0.65rem !important;
    letter-spacing: 0.005em !important;
    padding: 0.625rem 0.875rem !important;
    border-radius: 10px !important;
    min-width: auto !important;
    max-width: none !important;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, background-color, border-color;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    flex-shrink: 0 !important;
}

/* Hover das categorias */
.category-item-desktop:not([href*="index.php"]):hover,
.category-item-desktop[href*="category"]:hover {
    background: linear-gradient(to bottom, #f9fafb, #f3f4f6) !important;
    color: #111827 !important;
    border-color: #d1d5db !important;
    transform: translateY(-2px);
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.08),
        0 3px 6px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 1) !important;
}

/* Estado ativo das categorias */
.category-item-desktop.active:not([href*="index.php"]),
.category-item-desktop[href*="category"].active {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    color: #1e40af !important;
    border-color: #60a5fa !important;
    font-weight: 700 !important;
    box-shadow:
        0 6px 12px rgba(59, 130, 246, 0.15),
        0 3px 6px rgba(59, 130, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 0 0 1px rgba(59, 130, 246, 0.1) !important;
    position: relative;
}

/* Indicador visual no item ativo */
.category-item-desktop.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background: linear-gradient(to right, transparent, #3b82f6, transparent);
    border-radius: 3px 3px 0 0;
}

/* ==================== ÍCONES ==================== */
.category-item-desktop svg {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.category-item-desktop:hover svg {
    transform: scale(1.15) rotate(5deg);
}

/* ==================== TEXTOS E TIPOGRAFIA ==================== */
.category-text-desktop {
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Poppins', Roboto, sans-serif;
}

/* ==================== EFEITO RIPPLE AO CLICAR ==================== */
.category-item-desktop::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.category-item-desktop:active::before {
    width: 300px;
    height: 300px;
}

/* ==================== RESPONSIVIDADE ==================== */
@media (max-width: 1400px) {
    .categories-flex-desktop {
        gap: 0.625rem;
        padding: 0 1.25rem;
    }
}

@media (max-width: 1200px) {
    .category-item-desktop[href*="index.php"]:not([href*="category"]) {
        min-width: 100px;
        padding: 0.7rem 1.25rem !important;
        font-size: 0.8125rem !important;
    }

    .category-item-desktop:not([href*="index.php"]),
    .category-item-desktop[href*="category"] {
        min-width: 90px;
        padding: 0.65rem 1.125rem !important;
        font-size: 0.8rem !important;
    }
}

@media (max-width: 1024px) {
    .category-nav {
        padding: 0.75rem 0 !important;
    }

    .categories-flex-desktop {
        gap: 0.5rem;
        padding: 0 1rem;
        justify-content: flex-start;
    }

    .category-item-desktop {
        flex-shrink: 0;
        min-width: 85px;
        padding: 0.625rem 1rem !important;
        font-size: 0.75rem !important;
    }
}

@media (max-width: 768px) {
    .category-nav {
        display: none !important;
    }
}

/* ==================== ACESSIBILIDADE - FOCUS STATES ==================== */
.category-item-desktop:focus {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.category-item-desktop:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 3px;
}

/* ==================== ANIMAÇÃO REDUZIDA (ACESSIBILIDADE) ==================== */
@media (prefers-reduced-motion: reduce) {

    .category-item-desktop,
    .category-item-desktop::before,
    .category-item-desktop svg {
        transition: none !important;
        animation: none !important;
    }
}

/* ==================== DARK MODE SUPPORT ==================== */
@media (prefers-color-scheme: dark) {
    .category-nav {
        background: linear-gradient(to bottom, #1e293b, #0f172a) !important;
        border-bottom-color: #334155 !important;
    }

    .category-item-desktop:not([href*="index.php"]),
    .category-item-desktop[href*="category"]:not(.active) {
        background: linear-gradient(to bottom, #1e293b, #0f172a) !important;
        color: #e2e8f0 !important;
        border-color: #334155 !important;
    }

    .category-item-desktop:not([href*="index.php"]):hover,
    .category-item-desktop[href*="category"]:hover {
        background: linear-gradient(to bottom, #334155, #1e293b) !important;
        color: #f1f5f9 !important;
        border-color: #475569 !important;
    }

    .category-item-desktop.active:not([href*="index.php"]),
    .category-item-desktop[href*="category"].active {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%) !important;
        color: #dbeafe !important;
        border-color: #3b82f6 !important;
    }
}

/* ==================== ESTADO DE LOADING ==================== */
.category-nav.loading {
    opacity: 0.6;
    pointer-events: none;
}

.category-nav.loading .category-item-desktop {
    opacity: 0.5;
    cursor: wait;
}

/* ==================== OTIMIZAÇÕES DE PERFORMANCE ==================== */
.category-item-desktop {
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== SEPARADOR VISUAL ENTRE "TODAS" E CATEGORIAS ==================== */
.category-item-desktop[href*="index.php"]:not([href*="category"]) {
    margin-right: 0.5rem;
    position: relative;
}

.category-item-desktop[href*="index.php"]:not([href*="category"])::after {
    content: '';
    position: absolute;
    right: -0.5rem;
    top: 15%;
    bottom: 15%;
    width: 1px;
    background: linear-gradient(to bottom,
            transparent,
            rgba(226, 232, 240, 0.5),
            rgba(226, 232, 240, 1),
            rgba(226, 232, 240, 0.5),
            transparent);
}

/* ==================== TOOLTIP PARA NOMES LONGOS ==================== */
.category-item-desktop[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.25),
        0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease;
}

.category-item-desktop[title]:hover::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    pointer-events: none;
    z-index: 10000;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .category-nav {
        display: none !important;
    }
}

/* ==================== MICRO-INTERAÇÕES ==================== */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.category-item-desktop.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ==================== GRADIENTE DE FUNDO SUTIL ==================== */
.category-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right,
            transparent,
            rgba(59, 130, 246, 0.2),
            rgba(59, 130, 246, 0.4),
            rgba(59, 130, 246, 0.2),
            transparent);
    opacity: 0.6;
}

/* ==================== AJUSTES FINAIS PARA ALINHAMENTO PERFEITO ==================== */
.categories-flex-desktop {
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll no iOS */
}

.category-item-desktop {
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}