/* Produtos page */
.produtos-page {
  padding-bottom: var(--space-10);
  background: #f8f9fb;
}

.produtos-page .section {
  margin-top: var(--space-6);
  background: var(--light-color);
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
}

.produtos-page .section-header {
  background: var(--light-color);
  padding: var(--space-5) var(--space-6);
  box-shadow: 0 1px 0 var(--gray-medium);
}

/* Custom filter dropdowns (Família / Linha) */
.custom-select {
  position: relative;
  min-width: 180px;
  flex: 1 1 180px;
}

/* Fallback: native select when JS has not run yet */
.produtos-page select.filter-select:not(.custom-select__native) {
  display: block;
  min-width: 180px;
  min-height: 44px;
  padding: 12px 40px 12px 16px;
  border: 1px solid var(--gray-medium);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
  color: var(--secondary-color);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: none;
}

.produtos-page select.filter-select:not(.custom-select__native):hover {
  border-color: rgba(var(--primary-rgb), 0.35);
}

.produtos-page select.filter-select:not(.custom-select__native):focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.custom-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.custom-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 12px 40px 12px 16px;
  border: 1px solid var(--gray-medium);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  background: #fff;
  color: var(--secondary-color);
  cursor: pointer;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  transition: var(--transition-fast);
}

.custom-select__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select__chevron {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--gray-dark);
  transition: transform 0.2s ease, color 0.2s ease;
}

.custom-select__trigger:hover {
  border-color: rgba(var(--primary-rgb), 0.4);
}

.custom-select__trigger:focus,
.custom-select__trigger:focus-visible {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.custom-select__trigger:focus .custom-select__chevron,
.custom-select.is-open .custom-select__chevron {
  color: var(--primary-color);
}

.custom-select.is-open .custom-select__chevron {
  transform: rotate(180deg);
}

.custom-select.is-open .custom-select__trigger {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.custom-select__list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 200;
  margin: 0;
  padding: var(--space-2);
  list-style: none;
  background: var(--light-color);
  border: 1px solid var(--gray-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-medium) transparent;
}

.custom-select__list::-webkit-scrollbar {
  width: 6px;
}

.custom-select__list::-webkit-scrollbar-track {
  background: transparent;
}

.custom-select__list::-webkit-scrollbar-thumb {
  background: var(--gray-medium);
  border-radius: var(--radius-full);
}

.custom-select__list::-webkit-scrollbar-thumb:hover {
  background: var(--gray-dark);
}

.custom-select__option {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--secondary-color);
  cursor: pointer;
  transition: var(--transition-fast);
  outline: none;
}

.custom-select__option:hover,
.custom-select__option:focus {
  background: var(--gray-light);
}

.custom-select__option[aria-selected="true"] {
  background: var(--primary-subtle);
  color: var(--primary-color);
  font-weight: 500;
}

.custom-select__option[aria-selected="true"]:hover,
.custom-select__option[aria-selected="true"]:focus {
  background: rgba(var(--primary-rgb), 0.12);
}

.section-title-container {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.product-search {
  position: relative;
  display: flex;
  align-items: center;
}

.product-search input {
  padding: 10px 38px 10px 14px;
  border: 1px solid var(--gray-medium);
  border-radius: var(--radius-full);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  width: 280px;
  background: var(--light-color);
  transition: var(--transition-fast);
}

.product-search input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.product-search button {
  position: absolute;
  right: 6px;
  background: var(--gray-light);
  border: none;
  color: var(--gray-dark);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-full);
  display: none;
  transition: var(--transition-fast);
}

.product-search button.visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-search button:hover {
  background: var(--primary-subtle);
  color: var(--primary-color);
}

.product-filters {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.produtos-page .alert-info {
  margin: var(--space-5) var(--space-6) 0;
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary-color);
  background: rgba(var(--primary-rgb), 0.06);
}

.favoritos-vazio {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--gray-dark);
  background: var(--gray-light);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--gray-medium);
  margin: var(--space-5);
}

.favoritos-vazio i {
  font-size: 3rem;
  color: var(--primary-color);
  opacity: 0.4;
  margin-bottom: var(--space-4);
}

.alert-info a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: underline;
}

.alert-info a:hover {
  text-decoration: none;
}

.produtos-page .section-content {
  padding: 0;
}

.produtos-page .products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
  padding: var(--space-6);
  background: #f8f9fb;
}

/* Cards na página de produtos — acabamento premium */
.produtos-page .product-card {
  border-radius: var(--radius-xl);
  background: var(--light-color);
}

.produtos-page .product-card:hover {
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14), 0 6px 12px rgba(var(--primary-rgb), 0.08);
}

.produtos-page .product-image {
  height: 190px;
  padding: var(--space-4);
  background: linear-gradient(180deg, var(--gray-light) 0%, #fff 72%);
}

.produtos-page .product-info {
  padding: var(--space-4) var(--space-4) var(--space-5);
  gap: var(--space-2);
  background: #fafafa;
}

.produtos-page .product-category {
  color: var(--primary-color);
}

.produtos-page .product-title {
  font-size: var(--text-lg);
}

.produtos-page .product-type {
  color: var(--gray-dark);
}

.produtos-page .price-current {
  font-size: var(--text-lg);
}

@media (max-width: 1199px) {
  .produtos-page .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .produtos-page .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }

  .produtos-page .product-image {
    height: 200px;
  }
}

.produtos-page .product-linha-logo-img {
  width: 40px;
  height: 40px;
}

.produtos-page .product-linha-badge {
  font-size: 0.68rem;
}

.produtos-page .product-type {
  min-height: 2.8em;
}

@media (max-width: 768px) {
  .product-search input {
    width: 100%;
  }

  .section-title-container {
    flex-direction: column;
    align-items: stretch;
  }

  .product-filters {
    width: 100%;
  }

  .custom-select {
    flex: 1;
    min-width: 0;
  }

  .produtos-page .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    padding: var(--space-4);
  }

  .produtos-page .product-image {
    height: 160px;
  }
}

@media (max-width: 480px) {
  .produtos-page .products-grid {
    grid-template-columns: 1fr;
  }
}
