/* ============================================
   FILTROS HORIZONTAIS - ProdivetZN
   Sistema moderno e criativo de filtros
   ============================================ */

:root {
    --filter-primary: #198754;
    --filter-primary-hover: #146c43;
    --filter-bg: #f8f9fa;
    --filter-border: #dee2e6;
    --filter-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --filter-radius: 12px;
}

/* ====== Container de Filtros Horizontais ====== */
.filters-horizontal {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: var(--filter-radius);
    box-shadow: var(--filter-shadow);
    padding: 1.75rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

/* ====== Filtros Avançados (Horizontal) ====== */
.advanced-filters {
    margin: 0;
}

/* ====== LINHA 1: Filtro Principal (Categoria) ====== */
.filters-row-primary {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.filter-primary .filter-dropdown-btn {
    min-width: 280px;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--filter-primary) 0%, var(--filter-primary-hover) 100%);
    color: #fff;
    border: 2px solid var(--filter-primary);
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.2);
    position: relative;
    justify-content: center;
}

.filter-primary .filter-dropdown-btn i.fa-chevron-down {
    position: absolute;
    right: 1.5rem;
    margin-left: 0;
}

.filter-primary .filter-dropdown-btn i.fa-tag {
    font-size: 1.1rem;
}

.filter-primary .filter-dropdown-btn:hover {
    background: linear-gradient(135deg, var(--filter-primary-hover) 0%, #0f5132 100%);
    border-color: var(--filter-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(25, 135, 84, 0.3);
}

.filter-primary .filter-badge {
    background: #fff;
    color: var(--filter-primary);
    font-weight: 700;
}

/* ====== LINHA 2: Filtros Secundários ====== */
.filters-row-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* Decoração dos Filtros Secundários */
.filters-row-secondary .filter-group:first-child .filter-dropdown-btn {
    background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
    color: #fff;
    border-color: #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.filters-row-secondary .filter-group:first-child .filter-dropdown-btn:hover {
    background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
    border-color: #43a047;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.filters-row-secondary .filter-group:first-child .filter-badge {
    background: #fff;
    color: #4caf50;
}

.filters-row-secondary .filter-stock-toggle {
    background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
    color: #fff;
    border-color: #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.filters-row-secondary .filter-stock-toggle:hover {
    background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
    border-color: #43a047;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.filters-row-secondary .filter-stock-label {
    color: #fff;
}

/* ====== Dropdown de Filtros ====== */
.filter-group {
    position: relative;
}

.filter-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--filter-bg);
    border: 2px solid transparent;
    border-radius: 8px;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-dropdown-btn:hover {
    background: #fff;
    border-color: var(--filter-primary);
    color: var(--filter-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-dropdown-btn i.fa-chevron-down {
    font-size: 0.75rem;
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.filter-group.open .filter-dropdown-btn i.fa-chevron-down {
    transform: rotate(180deg);
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--filter-primary);
    color: #fff;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Dropdown Content */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    max-height: 0;
    overflow: hidden;
    background: #fff;
    border: 2px solid var(--filter-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

/* Dropdown Largo (2 colunas) */
.filter-dropdown-wide {
    min-width: 560px;
    left: 50%;
    transform: translateX(-50%);
}

.filter-group.open .filter-dropdown {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
}

.filter-dropdown-content {
    padding: 0.75rem;
    max-height: 350px;
    overflow-y: auto;
}

/* Dropdown Content com 2 Colunas */
.filter-dropdown-content-twocol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-height: 400px;
}

.filter-column {
    padding: 1rem;
    overflow-y: auto;
    max-height: 400px;
}

.filter-column:first-child {
    border-right: 2px solid var(--filter-border);
}

.filter-column-header {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--filter-primary);
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--filter-bg);
}

.filter-empty {
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
    margin: 0;
}

.filter-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.filter-dropdown-content::-webkit-scrollbar-track {
    background: var(--filter-bg);
    border-radius: 3px;
}

.filter-dropdown-content::-webkit-scrollbar-thumb {
    background: var(--filter-primary);
    border-radius: 3px;
}

/* Checkboxes dentro do dropdown */
.filter-checkbox-label {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.filter-checkbox-label:hover {
    background: var(--filter-bg);
}

.filter-checkbox-label input[type="checkbox"],
.filter-checkbox-label input[type="radio"] {
    margin-right: 0.75rem;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--filter-primary);
}

.filter-checkbox-label span {
    font-size: 0.9rem;
    color: #333;
}

/* ====== Toggle de Stock ====== */
.filter-stock-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--filter-bg);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.filter-stock-toggle:hover {
    background: #fff;
    border-color: var(--filter-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-stock-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #fff;
    filter: brightness(1.1);
}

.filter-stock-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
}

/* ====== Botão Limpar ====== */
.btn-clear-filters {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: #fff;
    border: 2px solid #dc3545;
    border-radius: 8px;
    color: #dc3545;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-clear-filters:hover {
    background: #dc3545;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

/* ====== Chips de Filtros Ativos ====== */
.active-filters-horizontal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--filter-bg);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.active-filters-label {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.active-filters-chips {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--filter-primary);
    color: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.filter-chip:hover {
    background: var(--filter-primary-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(25, 135, 84, 0.25);
}

.filter-chip i.fa-times {
    font-size: 0.75rem;
}

/* ====== Responsive ====== */

/* Tablets (< 992px) */
@media (max-width: 991.98px) {
    .filters-horizontal {
        padding: 1.25rem;
    }

    .filters-row-primary,
    .filters-row-secondary {
        gap: 0.75rem;
    }

    .filter-primary .filter-dropdown-btn {
        min-width: 240px;
        font-size: 0.95rem;
        padding: 0.85rem 1.25rem;
    }

    .filter-dropdown-btn,
    .filter-stock-toggle,
    .btn-clear-filters {
        font-size: 0.85rem;
        padding: 0.65rem 1rem;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767.98px) {
    .filters-horizontal {
        padding: 1rem;
    }

    .filters-row-primary,
    .filters-row-secondary {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .filters-row-secondary {
        padding-top: 0.75rem;
    }

    .filter-primary .filter-dropdown-btn {
        min-width: 100%;
    }

    .filter-dropdown-btn,
    .filter-stock-toggle,
    .btn-clear-filters {
        width: 100%;
        justify-content: center;
    }

    .filter-dropdown {
        left: 0;
        right: 0;
        width: 100%;
    }

    .filter-dropdown-wide {
        min-width: 100%;
        left: 0;
        transform: none;
    }

    .filter-dropdown-content-twocol {
        grid-template-columns: 1fr;
        max-height: 70vh;
        overflow-y: auto;
    }

    .filter-column {
        max-height: none;
        overflow-y: visible;
    }

    .filter-column:first-child {
        border-right: none;
        border-bottom: 2px solid var(--filter-border);
    }

    .active-filters-horizontal {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .active-filters-label {
        width: 100%;
    }

    .active-filters-chips {
        width: 100%;
    }
}

/* Mobile pequeno (< 576px) */
@media (max-width: 575.98px) {
    .filter-chip {
        font-size: 0.8rem;
        padding: 0.4rem 0.85rem;
    }
}

/* Fechar dropdown ao clicar fora */
.filter-dropdown.closing {
    animation: dropdownClose 0.2s ease forwards;
}

@keyframes dropdownClose {
    from {
        opacity: 1;
        max-height: 400px;
    }
    to {
        opacity: 0;
        max-height: 0;
    }
}

/* ====== Animação Inicial ====== */
.filter-primary .filter-dropdown-btn {
    animation: gentlePulse 2s ease-in-out;
}

@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(25, 135, 84, 0.2);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 16px rgba(25, 135, 84, 0.3);
    }
}

/* ============================================
   T12 - PRODUTOS PROFISSIONAIS
   Filtro e Área Restrita
   ============================================ */

/* Toggle Produtos Profissionais */
.filter-professional-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border: 2px solid #ff9800;
    border-radius: var(--filter-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.filter-professional-toggle:hover {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    border-color: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.filter-professional-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #fff;
}

.filter-professional-label {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    user-select: none;
}

.filter-professional-label i {
    font-size: 1rem;
}

/* Chip de Filtro Profissional Ativo */
.filter-chip-professional {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: #fff;
    border-color: #ff9800;
}

.filter-chip-professional:hover {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    border-color: #f57c00;
}

/* Área Restrita (Quando não autenticado) */
.area-restrita {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: var(--filter-radius);
    padding: 3rem 2rem;
    text-align: center;
    margin: 2rem 0;
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.2);
}

.area-restrita-icon {
    font-size: 4rem;
    color: #ff9800;
    margin-bottom: 1.5rem;
    animation: lockPulse 2s ease-in-out infinite;
}

@keyframes lockPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.area-restrita h3 {
    color: #856404;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.area-restrita-texto {
    color: #856404;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.area-restrita-subtexto {
    color: #856404;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.area-restrita-acoes {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.area-restrita-acoes .btn {
    min-width: 200px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.area-restrita-acoes .btn-primary {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    border-color: #198754;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.area-restrita-acoes .btn-primary:hover {
    background: linear-gradient(135deg, #146c43 0%, #0f5132 100%);
    border-color: #146c43;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(25, 135, 84, 0.4);
}

.area-restrita-acoes .btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
    color: #fff;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.area-restrita-acoes .btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.4);
}

/* Responsive - Área Restrita */
@media (max-width: 768px) {
    .area-restrita {
        padding: 2rem 1.5rem;
    }

    .area-restrita-icon {
        font-size: 3rem;
    }

    .area-restrita h3 {
        font-size: 1.5rem;
    }

    .area-restrita-acoes {
        flex-direction: column;
    }

    .area-restrita-acoes .btn {
        width: 100%;
        min-width: unset;
    }
}
