/* ========================================
   CONFORTOCARE - PRODUTOS CSS
   Estilos para páginas de categorias
======================================== */

/* ========================================
   BREADCRUMBS
======================================== */
.breadcrumbs {
    background: var(--bg-secondary);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.breadcrumbs ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.breadcrumbs li {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumbs a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.breadcrumbs a:hover {
    color: var(--primary-orange);
}

.breadcrumbs li:last-child {
    color: var(--primary-orange);
    font-weight: 600;
}

.breadcrumbs i {
    font-size: 12px;
}

/* ========================================
   LAYOUT DA PÁGINA
======================================== */
.products-page {
    padding: 40px 0 80px;
    background: var(--bg-primary);
}

.products-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* ========================================
   SIDEBAR DE FILTROS
======================================== */
.filters-sidebar {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.filters-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: var(--bg-elevated);
    border-radius: 3px;
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-orange);
    border-radius: 3px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-subtle);
}

.filters-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.filters-header i {
    color: var(--primary-orange);
    font-size: 20px;
}

.btn-clear-filters {
    padding: 6px 12px;
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary-orange);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-clear-filters:hover {
    background: var(--primary-orange);
    color: #fff;
    transform: translateY(-2px);
}

/* Grupos de Filtros */
.filter-group {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-group h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.filter-checkbox:hover {
    background: var(--bg-elevated);
}

.filter-checkbox input[type="checkbox"],
.filter-checkbox input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-orange);
}

.filter-checkbox span {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-checkbox input:checked + span {
    color: var(--primary-orange);
    font-weight: 600;
}

/* Range de Preço */
.price-range {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-inputs input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition);
    min-width: 0; /* ✅ ADICIONAR ESTA LINHA */
    width: 100%; /* ✅ ADICIONAR ESTA LINHA */
}

.price-inputs input:focus {
    outline: none;
    border-color: var(--primary-orange);
}

.price-inputs span {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0; /* ✅ ADICIONAR ESTA LINHA */
}

.btn-apply-price {
    width: 100%;
    padding: 10px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: var(--transition);
}

.btn-apply-price:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ========================================
   CONTEÚDO PRINCIPAL
======================================== */
.products-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Header da Listagem */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.products-info h1 {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.products-info p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.products-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-toggle-filters {
    display: none;
    padding: 10px 20px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-toggle-filters:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.select-order {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-elevated);
    cursor: pointer;
    transition: var(--transition);
}

.select-order:focus {
    outline: none;
    border-color: var(--primary-orange);
}

/* ========================================
   GRID DE PRODUTOS
======================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.product-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-orange);
}

/* Badge */
.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    color: #fff;
}

.product-badge.orange { background: linear-gradient(135deg, #FF6B35, #FF8C42); }
.product-badge.red { background: linear-gradient(135deg, #EF4444, #DC2626); }
.product-badge.green { background: linear-gradient(135deg, #10B981, #059669); }
.product-badge.blue { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.product-badge.gold { background: linear-gradient(135deg, #F59E0B, #D97706); }

/* Desconto */
.product-discount {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Imagem */
.product-image {
    position: relative;
    height: 260px;
    overflow: hidden;
    background: var(--bg-elevated);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-actions-hover {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .product-actions-hover {
    opacity: 1;
}

.btn-action {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-orange);
    font-size: 18px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.btn-action:hover {
    background: var(--gradient-primary);
    color: #fff;
    transform: scale(1.1);
}

/* Conteúdo */
.product-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.product-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* Features */
.product-features {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.product-features span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.product-features i {
    color: var(--accent-green);
    font-size: 12px;
}

/* Footer do Card */
.product-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.product-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-old {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.price-current {
    font-size: 24px;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.price-installment {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

.btn-add-cart {
    padding: 12px 20px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Nenhum Produto */
.no-products {
    grid-column: 1 / -1;
    padding: 80px 20px;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 2px dashed var(--border-color);
}

.no-products i {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-products h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.no-products p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.btn-clear {
    padding: 14px 32px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    transition: var(--transition);
}

.btn-clear:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

/* ========================================
   PAGINAÇÃO
======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 30px 0;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: var(--transition);
}

.page-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

/* ========================================
   RESPONSIVE - TABLET
======================================== */
@media (max-width: 1024px) {
    .products-layout {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        max-height: 100vh;
        z-index: 9999;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
    }
    
    .filters-sidebar.active {
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }
    
    .btn-toggle-filters {
        display: flex;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
======================================== */
@media (max-width: 768px) {
    .breadcrumbs {
        padding: 15px 0;
    }
    
    .breadcrumbs ul {
        font-size: 12px;
    }
    
    .products-page {
        padding: 30px 0 60px;
    }
    
    .products-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
    
    .products-info h1 {
        font-size: 22px;
    }
    
    .products-controls {
        width: 100%;
        flex-direction: column;
    }
    
    .btn-toggle-filters,
    .select-order {
        width: 100%;
        justify-content: center;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-image {
        height: 220px;
    }
    
    .pagination {
        gap: 6px;
        padding: 20px 0;
    }
    
    .page-btn {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .products-info h1 {
        font-size: 20px;
    }
    
    .product-content h3 {
        font-size: 15px;
    }
    
    .price-current {
        font-size: 20px;
    }
    
    .btn-add-cart {
        padding: 10px 16px;
        font-size: 12px;
    }
}

/* ========================================
   OVERLAY PARA MOBILE
======================================== */
.filters-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.filters-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   ANIMAÇÕES
======================================== */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.product-card {
    animation: fadeIn 0.6s ease;
}

/* ========================================
   LOADING STATE
======================================== */
.products-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    grid-column: 1 / -1;
    padding: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}