/* Vivaix: ricerca avanzata, barra di ricerca con suggerimenti, filtri, risultati, scheda in finestra */
.tp { padding: clamp(40px, 6vw, 64px) 0 80px; }
.tp-head { max-width: 760px; margin-bottom: 28px; }
.tp-head h1 { font-size: clamp(38px, 5vw, 60px); margin: 0 0 14px; }
.tp-lead { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.55; }
.tp-label { font-weight: 500; font-size: 14px; }

/* barra di ricerca */
.tp-search { position: relative; max-width: 860px; margin: 0 0 40px; z-index: 20; }
.tp-search__box { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 7px 7px 7px 18px;
  box-shadow: 0 1px 2px rgb(23 37 28 / .04), 0 16px 40px -24px rgb(23 37 28 / .3); transition: border-color .15s, box-shadow .15s; }
.tp-search__box:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgb(31 143 88 / .16), 0 16px 40px -24px rgb(23 37 28 / .3); }
.tp-search__ico { width: 22px; height: 22px; color: var(--muted); flex: none; }
.tp-search input { flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: none; font: 400 18px/1 var(--font-text); color: var(--ink); }
.tp-search input::placeholder { color: #8a948b; }
.tp-search input::-webkit-search-cancel-button { cursor: pointer; }
.tp-search__btn { height: 52px; padding: 0 28px; border-radius: 8px; flex: none; font-size: 16px; }
.hero-search .tp-search__box { padding: 8px 8px 8px 20px; }
.hero-search input { height: 58px; font-size: 19px; }
.hero-search .tp-search__btn { height: 58px; padding: 0 32px; }
@media (max-width: 639px) {
  .tp-search__box, .hero-search .tp-search__box { padding: 5px 5px 5px 14px; }
  .tp-search input, .hero-search input { height: 50px; font-size: 16px; }
  .tp-search__btn, .hero-search .tp-search__btn { height: 50px; padding: 0 18px; }
  .tp-search__ico { display: none; }
}

/* suggerimenti */
.tp-sugg { position: absolute; left: 0; right: 0; top: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 24px 60px -24px rgb(23 37 28 / .4); max-height: min(440px, 60svh); overflow-y: auto; z-index: 30; text-align: left; }
.tp-sugg li { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.tp-sugg li b { font: 500 17px/1.3 var(--font-display); color: var(--deep); }
.tp-sugg li i { grid-column: 1; font: italic 400 15px/1.3 var(--font-display); color: var(--muted); }
.tp-sugg li em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-size: 13px; color: var(--muted); }
.tp-sugg li:hover, .tp-sugg li[aria-selected=true] { background: var(--green-tint); }
.tp-sugg .sugg-tutte { display: block; color: var(--green); font-weight: 500; border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0 0 8px 8px; }
.tp-sugg .sugg-vuoto { display: block; color: var(--muted); cursor: default; }
.sugg-dove { font-style: normal; font-family: var(--font-text); font-size: 13px; color: var(--green); }
.tp-sugg li:has(.sugg-img) { grid-template-columns: 44px 1fr auto; }
.tp-sugg li:has(.sugg-img) > b, .tp-sugg li:has(.sugg-img) > i { grid-column: 2; }
.tp-sugg li:has(.sugg-img) > em { grid-column: 3; }
.sugg-img { grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--surface-2); align-self: center; }

/* impaginazione */
.tp-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 40px; align-items: start; }

/* filtri */
.tp-filters { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100svh - var(--nav-h) - 32px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 20px 16px; scrollbar-width: thin; }
.tp-filters__titolo { margin: 0; padding: 14px 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tp-filters details { border-top: 1px solid var(--line); }
.tp-filters summary { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 15px 0; list-style: none; font: 600 15px/1.3 var(--font-text); color: var(--deep); }
.tp-filters summary::-webkit-details-marker { display: none; }
.tp-filters summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.tp-filters details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.tp-n:empty { display: none; }
.tp-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--green); color: #fff; font-size: 12px; font-weight: 600; }
.tp-filters details > fieldset:last-of-type { padding-bottom: 16px; }
.tp-filters fieldset { border: 0; margin: 0; padding: 4px 0 12px; min-width: 0; }
.tp-filters legend { font-size: 13px; font-weight: 500; color: var(--muted); padding: 0 0 8px; }
.tp-filters__actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
.tp-filters__head, .tp-mostra { display: none; }
.tp-select { width: 100%; height: 44px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); font: inherit; font-size: 15px; color: var(--ink); }
.tp-select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgb(31 143 88 / .16); }
.tp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.tp-hint { margin: 8px 0 0; }

/* etichette di scelta */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface);
  font-size: 14px; transition: background-color .15s, border-color .15s, color .15s; }
.chips label:hover span { border-color: var(--deep); }
.chips input:checked + span { background: var(--deep); border-color: var(--deep); color: #fff; }
.chips input:focus-visible + span { outline: 2px solid var(--green-vivid); outline-offset: 2px; }
.chips--sw i { width: 14px; height: 14px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgb(23 37 28 / .25); }

/* risultati */
.tp-results__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; min-height: 44px; }
.tp-count { margin: 0; font: 500 22px/1.3 var(--font-display); color: var(--deep); }
.tp-open { display: none; }
.tp-open svg { width: 18px; height: 18px; }
.tp-attivi { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 20px; }
.tp-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--deep); font: 500 14px var(--font-text); cursor: pointer; transition: border-color .15s, background-color .15s; }
.tp-chip span[aria-hidden] { font-size: 17px; line-height: 1; color: var(--muted); }
.tp-chip:hover { border-color: var(--deep); background: var(--green-tint); }
.tp-chip--tutti { border-style: dashed; color: var(--muted); }

.tp-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.tp-card { width: 100%; height: 100%; text-align: left; display: grid; grid-template-rows: auto 1fr; padding: 0; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.tp-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-hover); }
.tp-card:focus-visible { outline: 2px solid var(--green-vivid); outline-offset: 2px; }
.tp-card__img { display: block; position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.tp-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.tp-card:hover .tp-card__img img { transform: scale(1.03); }
.tp-card__img--vuota::after { content: "Fotografia non disponibile"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.tp-card__body { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px 16px; }
.tp-card__cat { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tp-card__name { font: 500 20px/1.2 var(--font-display); color: var(--deep); }
.tp-card__sci { font: italic 400 16px/1.3 var(--font-display); color: var(--muted); }
.tp-card__facts { font-size: 14px; margin: 8px 0 12px; }
.tp-card__facts:empty { display: none; }
.tp-card__foot { display: flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); min-height: 16px; font-size: 14px; }
.tp-card__apri { margin-left: auto; color: var(--green); font-weight: 500; white-space: nowrap; }
.tp-card__foot em { font-style: normal; font-size: 13px; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.tp-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgb(23 37 28 / .25); background: #ccc; }
.tp-dot[data-c=bianco]{background:#fff}.tp-dot[data-c=crema]{background:#f3e8c4}.tp-dot[data-c=giallo]{background:#f2c418}.tp-dot[data-c=arancio]{background:#ee8a2a}
.tp-dot[data-c=rosso]{background:#c8312b}.tp-dot[data-c=rosa]{background:#ec8fb4}.tp-dot[data-c=viola]{background:#7a3fa0}.tp-dot[data-c=lilla]{background:#b9a2dc}
.tp-dot[data-c=blu]{background:#3f63c8}.tp-dot[data-c=verde]{background:#7fae5a}.tp-dot[data-c=marrone]{background:#7b5233}.tp-dot[data-c=nero]{background:#1d1d1d}
.tp-dot[data-c=argento]{background:#c7cdc9}.tp-dot[data-c=grigio]{background:#9aa09b}.tp-dot[data-c=porpora]{background:#5e2440}.tp-dot[data-c=bronzo]{background:#8a5a2b}
.tp-dot[data-c=variegato]{background:linear-gradient(90deg,#4f8a3a 50%,#efe9c8 50%)}.tp-dot[data-c=vari]{background:conic-gradient(#c8312b,#f2c418,#3f63c8,#ec8fb4,#c8312b)}
.tp-dot[data-c=bicolore]{background:linear-gradient(90deg,#c8312b 50%,#fff 50%)}
.tp-more { display: flex; justify-content: center; margin-top: 32px; }

/* scheda in finestra */
.tp-dialog { width: min(860px, calc(100vw - 32px)); max-height: calc(100svh - 48px); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--bg); color: var(--ink);
  box-shadow: 0 40px 100px -30px rgb(23 37 28 / .55); overscroll-behavior: contain; }
.tp-dialog[open] { animation: vx-apri .25s cubic-bezier(.2, .7, .2, 1); }
@keyframes vx-apri { from { opacity: 0; transform: translateY(10px); } }
.tp-dialog::backdrop { background: rgb(18 30 22 / .5); backdrop-filter: blur(2px); }
.tp-dialog__in { position: relative; padding: 36px 40px 36px; }
.tp-dialog__close { position: absolute; top: 16px; right: 16px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; color: var(--deep); transition: border-color .15s; }
.tp-dialog__close:hover { border-color: var(--deep); }
.tp-dialog__close svg { width: 18px; height: 18px; }

.footer--breve { padding: 28px 0; }
.footer--breve .footer__legal { padding-top: 0; }

@media (max-width: 1023px) {
  .tp-layout { grid-template-columns: 1fr; }
  .tp-filters { position: static; max-height: none; display: none; }
  .tp-open { display: inline-flex; }
  .tp-filters.is-open { display: block; position: fixed; inset: 0; z-index: 200; max-height: none; border-radius: 0; border: 0; padding: 0 var(--gutter); overflow-y: auto; }
  .tp-filters.is-open .tp-filters__titolo { display: none; }
  .tp-filters.is-open .tp-filters__head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 12px 0; border-bottom: 1px solid var(--line); font: 500 24px var(--font-display); color: var(--deep); }
  .tp-filters__x { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; color: var(--deep); }
  .tp-filters__x svg { width: 18px; height: 18px; }
  .tp-filters.is-open details:first-of-type { border-top: 0; }
  .tp-filters.is-open .tp-filters__actions { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); margin-top: 8px; flex-wrap: nowrap; }
  .tp-filters.is-open .tp-filters__actions .btn { flex: 1; min-height: 50px; }
  .tp-filters.is-open .tp-mostra { display: inline-flex; }
  html.tp-bloccato, html.tp-bloccato body { overflow: hidden; }
}
@media (max-width: 639px) {
  .tp-search { margin-bottom: 28px; }
  .tp-count { font-size: 19px; }
  .tp-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tp-card__body { padding: 12px 12px 12px; }
  .tp-card__name { font-size: 17px; }
  .tp-card__sci { font-size: 14px; }
  .tp-card__facts { display: none; }
  .tp-card__foot { flex-wrap: wrap; }
  .tp-card__apri { display: none; }
  .tp-dialog { width: 100vw; max-width: 100vw; max-height: 100svh; height: 100svh; border-radius: 0; margin: 0; }
  .tp-dialog__in { padding: 24px 18px 32px; }
  .tp-dialog__close { top: 12px; right: 12px; }
}
@media (max-width: 359px) { .tp-grid { grid-template-columns: 1fr; } }

/* vivai e vicinanza */
.tp-vicino { display: grid; gap: 6px; margin-bottom: 10px; }
.tp-geo { justify-self: start; gap: 8px; min-height: 40px; padding: 0 14px; font-size: 14px; }
.tp-geo svg { width: 18px; height: 18px; color: var(--green); }
.tp-select:disabled { opacity: .55; cursor: not-allowed; }
.tp-vivai span { flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 12px; border-radius: 10px; line-height: 1.25; }
.tp-vivai small { font-size: 12px; color: var(--muted); }
.tp-vivai input:checked + span small { color: #d9e4d6; }
.tp-vivai:empty { display: none; }

/* ordinamento */
.tp-results__bar { flex-wrap: wrap; }
.tp-ordina { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 14px; color: var(--muted); }
.tp-ordina .tp-select { width: auto; height: 40px; padding: 0 8px; }
.tp-open { order: 3; }
@media (max-width: 639px) { .tp-ordina { order: 4; width: 100%; margin-left: 0; } .tp-ordina .tp-select { flex: 1; } }

/* distanza nella card */
.tp-card__dist { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--coral-ink); }

/* intestazione del singolo vivaio */
.tp-vivaio { display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.tp-vivaio__info { display: grid; gap: 2px; }
.tp-vivaio__luogo { margin: 0; font-weight: 500; color: var(--deep); }
.tp-vivaio__orari { margin: 0; font-size: 14px; color: var(--muted); }
.tp-vivaio__az { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tp-vivaio__az .btn { min-height: 40px; padding: 0 14px; font-size: 14px; }
.tp-vivaio__nota { flex: 1 1 100%; margin: 0; padding: 10px 14px; border-radius: var(--r); background: #fbf1d3; color: #5c4400; font-size: 14px; line-height: 1.45; }

/* prezzi di listino nella card (catalogo di un solo vivaio) */
.tp-card__prezzi { display: grid; gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 13px; }
.tp-card__listino { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.tp-pz { display: flex; justify-content: space-between; gap: 8px; }
.tp-pz span { color: var(--ink); }
.tp-pz b { font-weight: 600; color: var(--deep); white-space: nowrap; }
@media (max-width: 639px) { .pz-vaso { display: none; } .tp-card__listino { font-size: 10px; } }

/* contatti nel catalogo del vivaio */
.tp-vivaio__az { display: grid; gap: 4px; justify-items: start; }
.tp-vivaio__contatta { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tp-vivaio__az .vx-contatti { margin: 2px 0; }
.tp-vivaio__link { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
@media (max-width: 639px) { .tp-vivaio__az { justify-items: stretch; width: 100%; } }

/* barra contatti fissa sul telefono */
.tp-barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: grid; gap: 6px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgb(251 249 244 / .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -20px rgb(23 37 28 / .35); }
.tp-barra__nome { font: 500 15px/1.2 var(--font-display); color: var(--deep); }
.tp-barra .vx-contatti { margin: 0; flex-wrap: nowrap; }
.tp-barra .vx-ct { flex: 1; min-height: 44px; padding: 0 8px; font-size: 14px; }
.tp-barra .vx-contatti__demo { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(100% + 8px); box-shadow: var(--shadow); }
@media (min-width: 768px) { .tp-barra { display: none !important; } }
@media (max-width: 767px) { body:has(.tp-barra:not([hidden])) { padding-bottom: 120px; } }
html.tp-bloccato .tp-barra, dialog[open] ~ .tp-barra { display: none !important; }

/* contatti in alto, accanto al nome del vivaio */
.tp-titolo { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 14px; }
.tp-titolo h1 { margin: 0; }
.tp-head:has(.tp-titolo__contatti:not([hidden])) { max-width: none; }
.tp-head:has(.tp-titolo__contatti:not([hidden])) .tp-lead { max-width: 760px; }
.tp-titolo__contatti .vx-contatti { margin: 0; }
.tp-titolo__contatti .vx-ct { min-height: 50px; padding: 0 22px; font-size: 16px; }
.tp-titolo__contatti .vx-ct svg { width: 20px; height: 20px; }
.tp-titolo__contatti .vx-contatti__demo { max-width: 420px; }
@media (max-width: 639px) {
  .tp-titolo__contatti { width: 100%; }
  .tp-titolo__contatti .vx-ct { flex: 1; padding: 0 10px; font-size: 15px; }
}
.tp-barra.is-ridotta { display: none !important; }

/* scheda: contatti sulla stessa riga del nome del vivaio */
.vx-vivai__testa { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.vx-vivai__testa .vx-contatti { margin: 0; }
