/* Catálogo: listings /pneus and /rodas (filters, sort, pagination) and the product page /produto/:slug. Doop frames PNEU-LISTA-01, PRODUTO-01, Round 2 frames for the sidebar, chips, sort bar and pager. */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
}

/* Doop PNEU-LISTA: a white strip under the header holds the breadcrumb. */
.breadcrumb-strip {
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.breadcrumb-strip .breadcrumb {
  margin: 0;
  padding: 14px 0;
}

.breadcrumb a:hover {
  color: var(--dark);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--dark);
  font-weight: 600;
}

/* Doop PNEU-LISTA-01: the 32px heading sits above the results column, beside the filters. */
.catalog-head h1 {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.catalog-head .catalog-criteria {
  margin-top: 8px;
}

/* Doop PRODUTO-01/04: the product title is 28px and the brand is orange. */
.product-info h1 {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.catalog-count {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.catalog-criteria {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0 0;
  font-size: 14px;
}

.catalog-criteria a {
  color: var(--orange-dark);
  font-weight: 600;
}

.catalog-criteria a:hover {
  text-decoration: underline;
}

/* The grid follows the width of its results column, which shrinks when the sidebar is shown. */
.catalog-results {
  container-type: inline-size;
  min-width: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  list-style: none;
}

@container (min-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (min-width: 760px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.catalog-layout {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

@media (min-width: 900px) {
  .catalog-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    /* The side spans both rows: extra height must go to the results row, not push the grid below the head. */
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 16px 32px;
  }

  .catalog-head {
    grid-column: 2;
    grid-row: 1;
  }

  .catalog-side {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .catalog-results {
    grid-column: 2;
    grid-row: 2;
  }

  /* Search results use the full width; the filters stay in the results column, above the grid. */
  .catalog-layout.is-search {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .catalog-layout.is-search .catalog-head,
  .catalog-layout.is-search .catalog-results {
    grid-column: 1;
    grid-row: auto;
  }
}

.catalog-count {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.catalog-inline-filters {
  margin-bottom: 16px;
}

/* Doop HOME-01: search results are four full-width columns when there is room for them. */
@container (min-width: 960px) {
  .catalog-layout.is-search .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Filters: a collapsed "Filtros" panel on phones, the open sidebar on desktop. */
.filter-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.filter-panel > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  padding: 0 16px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  list-style: none;
}

.filter-panel > summary::-webkit-details-marker {
  display: none;
}

.filter-panel[open] > summary {
  border-bottom: 1px solid var(--border);
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 16px 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding: 0;
  border: 0;
}

/* Doop PNEU-LISTA-01: group names are small uppercase grey labels. */
.filter-group legend {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* The real catalog has ~230 brands: a long group scrolls inside itself instead of stretching the panel. */
.filter-group:has(> .filter-option:nth-of-type(9)) {
  max-height: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Room for the checkbox focus ring (3px outline + 3px offset), which the scroll box would clip. */
  margin-inline: -8px;
  padding: 8px;
  scrollbar-gutter: stable;
}

.filter-option {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.filter-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
}

.filter-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.price-fields {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.price-field {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.price-field input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--dark);
  font-size: 14px;
}

.price-field input[aria-invalid="true"] {
  border-color: #b42318;
}

.price-separator {
  padding-bottom: 10px;
  color: var(--muted);
}

/* Doop PNEU-LISTA exceptions: a pale red notice with a dashed outline and an error icon. */
.filter-error {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed #b42318;
  border-radius: var(--radius-sm);
  background: #fef3f2;
  color: var(--dark);
  font-size: 13px;
}

.filter-error p {
  margin: 0;
}

.filter-error strong {
  color: #b42318;
  font-size: 14px;
}

.filter-error svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: #b42318;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.filter-apply,
.sort-apply {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--dark);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.filter-apply:hover,
.sort-apply:hover {
  background: #262626;
}

.filter-clear,
.filter-clear-all {
  color: #b42318;
  font-size: 14px;
  font-weight: 600;
}

.filter-clear:hover,
.filter-clear-all:hover {
  text-decoration: underline;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.filter-chip > [aria-hidden="true"] {
  color: #737373;
}

.filter-chip:hover {
  background: #f0f0f0;
}

/* Desktop: the panel stays open beside the results. This needs ::details-content; browsers without it keep the summary, so the filters open on a click. */
@media (min-width: 900px) {
  @supports selector(::details-content) {
    .catalog-side .filter-panel {
      padding: 20px;
    }

    .catalog-side .filter-panel > summary {
      display: none;
    }

    .catalog-side .filter-panel::details-content {
      content-visibility: visible;
    }

    .catalog-side .filter-form {
      padding: 0;
    }

    .catalog-side .filter-form::before {
      content: "Filtros";
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
      font-size: 15px;
      font-weight: 800;
    }
  }
}

.sort-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.results-count {
  color: var(--muted);
  font-size: 14px;
}

.sort-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.sort-form select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--dark);
  font-size: 14px;
}

.product-card {
  display: flex;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.product-media {
  background: #f5f5f5;
}

.product-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.product-body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.product-brand {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.product-title a:hover {
  text-decoration: underline;
}

.product-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}

.product-chips li {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: #f0f0f0;
  color: #404040;
  font-size: 12px;
  font-weight: 600;
}

.product-price {
  margin-top: auto;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

/* Doop PNEU-LISTA-06: a product on request shows the words in place of the price. */
.product-price.is-on-request {
  font-size: 20px;
  line-height: 1.2;
}

.product-note {
  margin-top: -4px;
  color: var(--muted);
  font-size: 12px;
}

.product-consult,
.consult-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.product-consult:hover,
.consult-whatsapp:hover {
  background: #0e5d33;
}

.product-consult svg,
.consult-whatsapp svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: currentColor;
}

.product-buy,
.buy-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: var(--dark);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.product-buy:hover {
  background: #262626;
}

/* Doop PRODUTO-04: the product page buy button is orange with a black label; listing cards stay black. */
.buy-now {
  min-height: 56px;
  background: var(--orange);
  color: var(--dark);
  font-size: 15px;
}

.buy-now:hover {
  background: var(--orange-dark);
}

.product-buy svg,
.buy-now svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-unavailable,
.buy-unavailable {
  color: var(--muted);
  font-size: 14px;
}

.buy-unavailable {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #f5f5f5;
}

.buy-unavailable strong {
  color: var(--dark);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  font-size: 14px;
}

.pager-step,
.pager-page {
  display: inline-flex;
  min-width: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-weight: 600;
}

a.pager-step:hover,
a.pager-page:hover {
  border-color: var(--dark);
}

.pager-step[aria-disabled="true"] {
  color: var(--muted-light);
}

.pager-page[aria-current="page"] {
  border-color: var(--dark);
  background: var(--dark);
  color: var(--white);
}

.pager-gap {
  color: var(--muted);
}

.catalog-empty {
  margin-top: 24px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.catalog-empty h2 {
  font-size: 22px;
  font-weight: 800;
}

.catalog-empty p {
  margin-top: 8px;
  color: var(--muted);
}

.catalog-empty .search-button {
  margin-top: 20px;
}

/* Product page */
.product-layout {
  display: grid;
  gap: 32px;
}

@media (min-width: 900px) {
  .product-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.product-gallery {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f5f5f5;
}

.product-gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.product-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.product-info .product-brand {
  color: var(--orange);
  font-size: 13px;
}

.product-meta {
  font-size: 14px;
}

.product-meta a {
  color: var(--muted);
  text-decoration: underline;
}

.buy-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.buy-box .product-price {
  margin-top: 0;
  font-size: 40px;
}

.buy-now,
.consult-whatsapp {
  width: 100%;
}

.consult-whatsapp {
  min-height: 56px;
  font-size: 15px;
}

.buy-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.buy-note {
  color: var(--muted);
  font-size: 13px;
}

.ask-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1.5px solid var(--green);
  border-radius: var(--radius-sm);
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}

.ask-whatsapp:hover {
  background: #f0faf4;
}

.ask-whatsapp svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.product-specs,
.product-reviews,
.related {
  margin-top: 48px;
  scroll-margin-top: 24px;
}

/* Doop PRODUTO-01/02: anchor tabs with an orange underline on the active section. */
.product-tabs ul {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  list-style: none;
}

.product-tabs a {
  display: block;
  padding: 12px 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.product-tabs a:hover,
.product-tabs a.is-active {
  color: var(--dark);
}

.product-tabs a.is-active {
  border-bottom-color: var(--orange);
}

/* The related grid's @container rules need a query container; .catalog-results is only on listings. */
.related {
  container-type: inline-size;
}

/* Doop PRODUTO-06: four related products sit in one row at 1280; three or fewer keep the 3-column grid. */
@container (min-width: 960px) {
  .related .product-grid:has(> li:nth-child(4)) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.product-specs h2,
.product-reviews h2,
.related > h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.related > h2 span {
  color: var(--orange);
}

.related-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.product-specs dl {
  display: grid;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.product-specs dl > div {
  display: grid;
  grid-template-columns: minmax(120px, 200px) minmax(0, 1fr);
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.product-specs dl > div:first-child {
  border-top: 0;
}

.product-specs dt {
  color: var(--muted);
}

.product-specs dd {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.product-reviews p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

/* Doop PRODUTO-02: the empty reviews state is a bordered box, with no score. */
.reviews-empty {
  margin-top: 16px;
  padding: 20px;
  border: 1px dashed #bdbdbd;
  border-radius: var(--radius);
  background: var(--white);
}

.reviews-empty p {
  margin-top: 0;
  color: var(--dark);
  font-weight: 600;
}

@media (max-width: 639px) {
  .catalog-head h1 {
    font-size: 30px;
  }

  .product-info h1 {
    font-size: 26px;
  }

  .buy-box .product-price {
    font-size: 34px;
  }
}

/* Search, notices and Mais vendidos (Round 3) */
.catalog-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.catalog-search input {
  flex: 1 1 240px;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--white);
}

.catalog-notice {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.catalog-notice a,
.catalog-cross a {
  font-weight: 700;
  text-decoration: underline;
}

.catalog-cross {
  margin-top: 8px;
  color: var(--muted);
}

.catalog-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-weight: 700;
}

.catalog-whatsapp svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* Doop HOME-01: a black uppercase link with a separate orange arrow; the underline shows only on hover. */
.featured-all {
  color: var(--dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
}

.featured-all:hover {
  text-decoration: underline;
}

.featured-all .featured-arrow {
  margin-left: 6px;
  color: var(--orange);
}

/* The Home has no .catalog-results container, so the grid's container queries need one here. */
.featured {
  container-type: inline-size;
}

@container (min-width: 960px) {
  .featured .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
