/* Solo layout locale: l'estetica (colori, superfici, bottoni, input, select)
   viene da valorecasa.css del design-system condiviso. */

body {
  margin: 0;
  min-height: 100vh;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: "Inter", system-ui, sans-serif;
}

.s3-header { position: relative; overflow: hidden; }
.s3-header .vc-grid-paper { z-index: 0; }  /* layer decorativo, pointer-events:none */
.s3-header__inner {
  position: relative;  /* contenuto sopra il grid-paper */
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}
.s3-title { margin: 0.25rem 0 0.5rem; }
.s3-sub { max-width: 46rem; color: var(--color-text-secondary); margin: 0; line-height: 1.5; }

.s3-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.s3-search { padding: 1.1rem 1.2rem; margin-bottom: 1.5rem; }
.s3-search__row { display: flex; gap: 0.6rem; align-items: stretch; }
.s3-search__input { flex: 1; display: flex; }
.s3-search__input input {
  width: 100%; border: none; background: transparent; color: inherit;
  font-size: 1rem; padding: 0.55rem 0.65rem; outline: none;
}
.s3-interpretation {
  margin: 0.7rem 0 0; font-size: 0.86rem; color: var(--color-text-secondary);
}
.s3-interpretation strong { color: var(--color-brand-strong); }

.s3-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; }
.s3-pill { cursor: pointer; }
.s3-pill.is-active { box-shadow: inset 0 0 0 2px var(--color-brand); }

.s3-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-top: 0.9rem; flex-wrap: wrap;
}
.s3-sort { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem;
  color: var(--color-text-secondary); }
.s3-sort select { min-width: 12rem; }
.s3-meta { font-size: 0.85rem; color: var(--color-text-secondary); }
.s3-alert { margin-top: 0.9rem; }
.s3-alert-panel {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--vc-radius);
  background: var(--color-surface);
  box-shadow: var(--vc-shadow-sm);
}
.s3-alert-head,
.s3-alert-inline,
.s3-alert-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}
.s3-alert-head { justify-content: space-between; }
.s3-alert-head h2 { margin: 0; font-size: 1rem; }
.s3-alert-field { display: grid; gap: 0.4rem; font-weight: 700; }
.s3-alert-field input {
  min-height: 42px;
  border: 1px solid var(--color-border);
  border-radius: var(--vc-radius-sm);
  padding: 0.55rem 0.7rem;
  font: inherit;
}
.s3-alert-inline input { flex: 1 1 240px; }
.s3-alert-feedback { margin: 0; color: var(--color-brand-strong); }

.s3-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.s3-product { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.s3-thumb {
  aspect-ratio: 4 / 3; background: var(--color-surface-muted);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.s3-thumb img { width: 100%; height: 100%; object-fit: cover; }
.s3-thumb__ph { color: var(--color-text-secondary); font-size: 0.8rem; }
.s3-body { padding: 0.85rem 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.s3-badges { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.s3-name { font-weight: 600; line-height: 1.25; font-size: 0.95rem; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.s3-name a { color: inherit; text-decoration: none; }
.s3-name a:hover { text-decoration: underline; }
a.s3-thumb { cursor: pointer; text-decoration: none; }
.s3-brand { font-size: 0.78rem; color: var(--color-text-secondary); margin: 0; }
.s3-specs { font-size: 0.76rem; color: var(--color-text-secondary); display: flex;
  gap: 0.5rem; flex-wrap: wrap; }
.s3-pricerow { display: flex; align-items: baseline; justify-content: space-between;
  margin-top: auto; gap: 0.5rem; }
.s3-price { font-size: 1.15rem; font-weight: 700; }
.s3-perkg { font-size: 0.82rem; color: var(--color-brand-strong); font-weight: 600; }
.s3-offers { font-size: 0.75rem; color: var(--color-text-secondary); }
.s3-offers-detail { font-size: 0.78rem; }
.s3-offers-detail summary {
  cursor: pointer; color: var(--color-brand-strong); font-weight: 600;
  list-style: none; user-select: none;
}
.s3-offers-detail summary::-webkit-details-marker { display: none; }
.s3-offers-detail summary::before { content: "▸ "; }
.s3-offers-detail[open] summary::before { content: "▾ "; }
.s3-offers-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.s3-offers-list a {
  display: flex; justify-content: space-between; gap: 0.5rem; text-decoration: none;
  color: var(--color-text); padding: 0.25rem 0.4rem; border-radius: var(--vc-radius-sm);
}
.s3-offers-list a:hover { background: var(--color-surface-muted); }
.s3-offers-list li.is-best a { background: color-mix(in srgb, var(--color-brand) 12%, transparent); }
.s3-offers-store em { font-style: normal; text-transform: uppercase; font-size: 0.66rem;
  color: var(--color-text-secondary); }
.s3-offers-price { white-space: nowrap; font-weight: 600; }
.s3-cta { margin-top: 0.55rem; text-align: center; text-decoration: none; display: block; }

.s3-loadmore { display: flex; justify-content: center; margin-top: 1.5rem; }
.s3-loadmore__btn { cursor: pointer; padding: 0.6rem 1.4rem; }
.s3-loadmore__done { color: var(--color-text-secondary); font-size: 0.85rem; }
.s3-status { text-align: center; color: var(--color-text-secondary); margin-top: 1.5rem; min-height: 1.2rem; }
.s3-footer { text-align: center; color: var(--color-text-secondary); font-size: 0.8rem;
  padding: 2rem 1rem; border-top: 1px solid var(--color-border); }

.s3-skeleton { height: 280px; border-radius: var(--vc-radius); background: var(--color-surface-muted); }
