/* ═══════════════════════════════════════════
   PRODUCTS CATALOG — Styles
   ═══════════════════════════════════════════ */

.catalog-section {
  background: var(--bg);
}

/* ─── SEARCH ─── */
.catalog-search {
  margin-bottom: var(--space-lg);
}

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

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--gray-400);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.9rem 3rem 0.9rem 3rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-family: var(--font-main);
  background: var(--white);
  transition: all 0.3s ease;
  outline: none;
}

.search-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.search-input::placeholder {
  color: var(--gray-400);
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.search-clear:hover {
  background: var(--gray-200);
  color: var(--dark);
}

/* ─── FILTERS ─── */
.catalog-filters {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.filters-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .filters-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .filters-row {
    grid-template-columns: auto 1fr 1fr 1fr;
    align-items: end;
  }
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  font-family: var(--font-mono);
}

.filter-pills {
  display: flex;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
}

.filter-pill {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main);
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--red);
  color: var(--red);
}

.filter-pill.active {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.filter-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  font-size: 0.85rem;
  font-family: var(--font-main);
  color: var(--dark);
  background: var(--white);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.filter-select:focus {
  border-color: var(--red);
}

/* Active filter tags */
.filters-active {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-md);
}

.filters-active:empty {
  margin-top: 0;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.3rem 0.5rem 0.3rem 0.75rem;
  background: var(--red-glow);
  color: var(--red);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

.filter-tag-remove {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(196, 26, 26, 0.15);
  color: var(--red);
  border: none;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.filter-tag-remove:hover {
  background: var(--red);
  color: white;
}

/* ─── RESULTS ─── */
.catalog-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.results-count {
  font-size: 0.85rem;
  color: var(--gray-400);
  font-weight: 500;
}

.results-clear {
  font-size: 0.8rem;
  color: var(--red);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-main);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  transition: all 0.2s;
}

.results-clear:hover {
  background: var(--red-glow);
}

/* ─── PRODUCT CARD LINK ─── */
.product-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* ─── EMPTY STATE ─── */
.catalog-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl) var(--space-xl);
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.catalog-empty h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: var(--space-sm);
}

.catalog-empty p {
  color: var(--gray-400);
  font-size: 0.9rem;
  margin-bottom: var(--space-xl);
}

/* ═══════════════════════════════════════════
   CENTERING — Mobile & Tablet
   ═══════════════════════════════════════════ */

/* Page hero centered */
.page-hero-short .container { text-align: center; }

/* Filters centered on mobile */
@media (max-width: 639px) {
  .catalog-filters { padding: var(--space-md); }
  .filter-pills { justify-content: center; flex-wrap: wrap; }
  .filter-group { align-items: center; }
  .filter-label { text-align: center; }
  .catalog-results-header { flex-direction: column; gap: var(--space-sm); text-align: center; }
}

@media (max-width: 1023px) {
  .catalog-search { text-align: center; }
  .filters-active { justify-content: center; }
}

/* ─── SVG Icon adjustments ─── */
.search-icon { display: inline-flex; align-items: center; }
.search-icon svg { width: 20px; height: 20px; }
.search-clear { display: flex; align-items: center; justify-content: center; }
.search-clear svg { width: 14px; height: 14px; }

.filter-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.filter-tag-remove svg { width: 12px; height: 12px; }

.empty-icon {
  font-size: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-400);
  margin: 0 auto var(--space-md);
}
.empty-icon svg { width: 36px; height: 36px; }

/* ─── Spinner centralizado no grid ─── */
.products-grid .page-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  width: 100%;
}

/* ═══ SMALL PHONE FIXES ═══ */
@media (max-width: 380px) {
  .filter-pills { flex-wrap: wrap; justify-content: center; }
  .filter-pill { padding: 0.4rem 0.8rem; font-size: 0.78rem; }
  .catalog-filters { padding: var(--space-md); }
}

/* ─── MOBILE TOUCH FIXES ─── */
@media (max-width: 639px) {
  .filter-select { min-height: 44px; }
  .filter-pill { min-height: 40px; padding: 0.5rem 1rem; }
}
