/* PC SERVICE - rifinitura responsive del sito pubblico (2026-08-01)
   Regole isolate: non coinvolgono il gestionale rivenditori. */

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

main,
.wrap,
.svc-hero,
.blk,
.panel,
.cta-band,
.about,
.loc-grid {
  min-width: 0;
}

img,
video,
iframe,
svg {
  max-width: 100%;
}

.crumb,
.svc-hero h1,
.sec-h,
.faq summary,
.vt-name,
.rec-name,
.pm-name,
.pm-desc {
  overflow-wrap: break-word;
}

/* Desktop: testo leggibile e contenuti centrati anche su schermi molto larghi. */
@media (min-width: 1100px) {
  main > .wrap {
    padding-inline: clamp(24px, 2.2vw, 34px);
  }

  .svc-hero h1 {
    max-width: 27ch;
  }

  .svc-hero .lead {
    max-width: 72ch;
  }
}

/* Tablet e telefono: una sola misura di sicurezza per tutte le pagine pubbliche. */
@media (max-width: 760px) {
  .wrap,
  main > .wrap {
    width: 100%;
    max-width: 100%;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .mast {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  .mast-inner,
  .mast-switch {
    width: 100%;
    min-width: 0;
  }

  .crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 5px;
    width: 100%;
    padding-top: 16px;
    line-height: 1.45;
  }

  .svc-hero h1 {
    font-size: clamp(28px, 9vw, 38px);
    line-height: 1.08;
  }

  .svc-hero .lead {
    font-size: 16px;
    line-height: 1.58;
  }

  .fchips,
  .svc-cta,
  .rec-actions,
  .pm-actions {
    max-width: 100%;
  }

  .fchip {
    max-width: 100%;
    min-height: 34px;
    line-height: 1.25;
  }

  .btn,
  .vt-btn,
  .rec-cta,
  .pm-primary,
  .pm-share {
    min-height: 44px;
  }

  .faq summary {
    min-width: 0;
    padding-right: 42px;
  }

  .wa-widget {
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .wa-panel {
    max-width: calc(100vw - 24px) !important;
  }

  .wa-fab {
    width: 52px !important;
    height: 52px !important;
  }

  .wa-fab svg {
    width: 28px !important;
    height: 28px !important;
  }

  .pm-ov,
  .rich-ov,
  .cm-ov {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .pm,
  .rich-box,
  .cm {
    max-width: 100%;
    max-height: calc(100dvh - 20px);
  }

  /* Le tabelle legali diventano schede verticali: nessuno scorrimento laterale. */
  .policy-page table,
  .policy-page tbody,
  .policy-page tr,
  .policy-page td {
    display: block;
    width: 100%;
  }

  .policy-page table {
    border: 0;
    overflow: visible;
  }

  .policy-page thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
  }

  .policy-page tbody tr {
    margin: 0 0 12px;
    overflow: hidden;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    background: #fff;
  }

  .policy-page td {
    display: grid;
    grid-template-columns: minmax(82px, 31%) minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border: 0;
    border-top: 1px solid #e4e7ec;
    overflow-wrap: anywhere;
  }

  .policy-page td:first-child {
    border-top: 0;
  }

  .policy-page td::before {
    color: #14171a;
    font-weight: 700;
  }

  .privacy-page td:nth-child(1)::before { content: "Finalita"; }
  .privacy-page td:nth-child(2)::before { content: "Base giuridica"; }
  .cookie-page td:nth-child(1)::before { content: "Tipo"; }
  .cookie-page td:nth-child(2)::before { content: "Finalita"; }
  .cookie-page td:nth-child(3)::before { content: "Consenso"; }
}

/* Telefoni stretti: due card restano affiancate, ma senza badge che sbordano. */
@media (max-width: 360px) {
  .mast-opt {
    min-width: 0;
    padding-inline: 5px;
    font-size: 12.5px;
  }

  .vt-card,
  .rec-card {
    padding: 12px;
  }

  .vt-titleline .vt-tags,
  .vt-tags,
  .rec-tags {
    gap: 3px;
    max-width: 100%;
  }

  .vt-g,
  .rec-grade {
    padding: 3px 5px;
    font-size: 8.5px;
    letter-spacing: 0;
  }

  .vt-b,
  .rec-batt {
    margin-right: 3px;
  }

  .vt-bat,
  .rec-bat {
    min-width: 37px;
    height: 17px;
    padding-inline: 3px;
    font-size: 9.5px;
  }

  .vt-rate,
  .rec-rate {
    white-space: normal;
  }

  .paylogo {
    gap: 4px;
    margin-left: 0;
  }

  .paylogo .lk {
    height: 16px;
  }

  .paylogo .lp {
    height: 13px;
  }
}

/* Interazioni touch: nessun movimento accidentale mentre si tocca una card. */
@media (hover: none) and (pointer: coarse) {
  .svc-card:hover,
  .panel:hover,
  .vt-card:hover,
  .rec-card:hover {
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

/* Footer mobile unico per tutte le pagine pubbliche: stesso aspetto esteso della Home. */
@media (max-width: 760px) {
  body footer {
    margin-top: 20px !important;
    padding: 14px 0 12px !important;
  }

  body footer .wrap {
    width: 100% !important;
    max-width: 100% !important;
    padding-inline: 12px !important;
  }

  body footer .fgrid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  body footer .fgrid > :first-child {
    grid-column: 1 / -1 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 3px !important;
    padding: 0 4px 9px;
    border-bottom: 1px solid #20242a;
  }

  body footer .flogo {
    width: auto;
    height: 32px !important;
    margin: 0 !important;
  }

  body footer .soc {
    display: flex;
    gap: 6px;
    margin: 0 !important;
  }

  body footer .soc a {
    width: 32px !important;
    height: 32px !important;
  }

  body footer .fcol {
    grid-column: auto !important;
    min-width: 0;
    padding: 0 10px 7px !important;
    border: 1px solid #24282e;
    border-radius: 11px;
    background: #090a0c;
    overflow: hidden;
  }

  body footer .fcol > b.h {
    display: flex;
    align-items: center;
    min-height: 42px;
    margin: 0 !important;
    padding: 0 1px;
    font-size: 12px !important;
    cursor: default !important;
  }

  body footer .fcol > b.h::after {
    display: none !important;
    content: none !important;
  }

  body footer .fcol > a,
  body footer .fcol.is-open > a {
    display: block !important;
    margin: 0;
    padding: 7px 2px !important;
    border-top: 1px solid #1d2126;
    font-size: 11.5px !important;
    line-height: 1.25;
  }

  body footer .fic {
    width: 12px !important;
    height: 12px !important;
    margin-right: 5px !important;
  }

  body footer .lg {
    margin: 9px 0 0 !important;
    font-size: 9.5px !important;
    line-height: 1.45;
    text-align: center;
  }
}
