/* ============================================================
   TECNOKIL — Stylesheet principale
   Palette: Rosso #E30613 · Nero #1A1A1A · Bianco #FFFFFF
   Font: Inter (Google Fonts)
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  color: #1A1A1A;
  background: #FFFFFF;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }
a { color: #E30613; text-decoration: none; }
a:hover { text-decoration: underline; }

ul { list-style: none; }

/* ── Tipografia ───────────────────────────────────────────── */
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; line-height: 1.2; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem);   font-weight: 600; line-height: 1.3; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p  { margin-bottom: 1rem; }

/* ── Utilità ──────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.section    { padding: 4rem 0; }
.section--gray { background: #F5F5F5; }
.text-center { text-align: center; }
.text-red    { color: #E30613; }

.btn {
  display: inline-block;
  padding: .75rem 1.75rem;
  border-radius: 3px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: background .2s, color .2s;
  text-decoration: none;
}
.btn--primary {
  background: #E30613;
  color: #FFFFFF;
  border: 2px solid #E30613;
}
.btn--primary:hover { background: #b80010; border-color: #b80010; text-decoration: none; }

.btn--outline {
  background: transparent;
  color: #E30613;
  border: 2px solid #E30613;
}
.btn--outline:hover { background: #E30613; color: #FFF; text-decoration: none; }

/* ── Header / Nav ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #1A1A1A;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

/* Logo: sfondo bianco per far risaltare le parti nere sul header scuro */
.nav-logo {
  overflow: hidden;
  height: 62px;
  flex-shrink: 0;
  background: #FFF;
  border-radius: 6px;
  padding: 0 10px;
  display: flex;
  align-items: center;
}
.nav-logo img {
  height: 150px;
  width: auto;
  margin-top: -54px;
}

/* Desktop nav — flex:1 sul nav, justify-content:center sul menu */
.nav-inner > nav {
  flex: 1;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  flex-wrap: wrap;
}

.nav-item { position: relative; }

.nav-link {
  display: block;
  padding: .55rem .9rem;
  color: #FFFFFF;
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .02em;
  border-radius: 3px;
  transition: background .2s, color .2s;
}
.nav-link:hover,
.nav-link.active { background: #E30613; color: #FFF; text-decoration: none; }

/* Dropdown — hover solo desktop, mobile usa JS */
@media (min-width: 769px) {
  .nav-item:hover .dropdown { display: block; }
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #FFFFFF;
  border-top: 3px solid #E30613;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  border-radius: 0 0 4px 4px;
  z-index: 200;
}

.dropdown a {
  display: block;
  padding: .6rem 1.1rem;
  color: #1A1A1A;
  font-size: .87rem;
  border-bottom: 1px solid #F0F0F0;
  transition: background .15s, color .15s;
}
.dropdown a:last-child { border-bottom: none; }
.dropdown a:hover { background: #E30613; color: #FFF; text-decoration: none; }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
}
.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 26px;
  height: 2px;
  background: #FFF;
  transition: transform .3s;
}
.hamburger { position: relative; }
.hamburger::before,
.hamburger::after { content: ''; position: absolute; left: 0; }
.hamburger::before { top: -8px; }
.hamburger::after  { top:  8px; }

.nav-toggle.open .hamburger { background: transparent; }
.nav-toggle.open .hamburger::before { transform: rotate(45deg) translate(6px, 6px); }
.nav-toggle.open .hamburger::after  { transform: rotate(-45deg) translate(6px, -6px); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1A1A1A 0%, #2d2d2d 60%, #E30613 100%);
  color: #FFF;
  padding: 5rem 0;
  text-align: center;
}
.hero h1 { color: #FFF; margin-bottom: 1rem; }
.hero h1 span { color: #E30613; }
.hero p  { font-size: 1.1rem; max-width: 600px; margin: 0 auto 2rem; opacity: .9; }
.hero .btn-group { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Sezione Settori (Home) ───────────────────────────────── */
.settori-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.settore-card {
  display: flex;
  flex-direction: column;
  background: #FFF;
  border: 1px solid #E8E8E8;
  border-radius: 6px;
  padding: 2rem 1.5rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s, transform .2s;
  cursor: pointer;
}
.settore-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-3px); }

.settore-card .icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}
.settore-card h3 { margin-bottom: .5rem; }
.settore-card p  { color: #666; font-size: .9rem; margin-bottom: 1.25rem; }
.settore-link {
  display: inline-block;
  color: #E30613;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.settore-link:hover { border-bottom-color: #E30613; }

/* ── Pagine indice categoria ─────────────────────────────── */
.categoria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.categoria-card {
  display: flex;
  flex-direction: column;
  background: #FFF;
  border: 1px solid #E8E8E8;
  border-radius: 6px;
  padding: 2rem 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s, transform .2s;
}
.categoria-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  transform: translateY(-3px);
}
.categoria-card .categoria-img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  margin-bottom: 1.25rem;
  border-radius: 4px;
  background: #F5F5F5;
  padding: .5rem;
}
.categoria-card h3 {
  margin-bottom: .5rem;
  color: #1A1A1A;
}
.categoria-card p {
  color: #666;
  font-size: .9rem;
  flex: 1;
  margin-bottom: 1.25rem;
}
.categoria-card .categoria-link {
  color: #E30613;
  font-size: .875rem;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
  align-self: flex-start;
}
.categoria-card:hover .categoria-link { border-bottom-color: #E30613; }

/* ── Sezione Marchi (Home / Chi Siamo) ───────────────────── */
.marchi-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem 3rem;
  margin-top: 2rem;
}
.marchi-grid img {
  height: 50px;
  width: auto;
  filter: grayscale(100%);
  opacity: .65;
  transition: filter .2s, opacity .2s;
}
.marchi-grid img:hover { filter: none; opacity: 1; }

/* ── Titolo prodotto su due righe ────────────────────────── */
h3 .psub {
  display: block;
  font-size: .85rem;
  font-weight: 400;
  color: #666;
  font-style: italic;
  margin-top: .2rem;
  letter-spacing: 0;
}

/* ── Pagina Prodotto ──────────────────────────────────────── */
.page-hero {
  background: #1A1A1A;
  color: #FFF;
  padding: 3rem 0 2.5rem;
}
.page-hero h1 { color: #FFF; margin-bottom: .5rem; }
.page-hero .breadcrumb { font-size: .85rem; color: #aaa; }
.page-hero .breadcrumb a { color: #E30613; }

.product-intro {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2.5rem;
}
.product-intro .brand-logo { text-align: right; }
.product-intro .brand-logo img { max-height: 60px; margin-left: auto; }
.product-intro blockquote {
  border-left: 4px solid #E30613;
  padding-left: 1.25rem;
  color: #444;
  font-style: italic;
  font-size: .95rem;
  cursor: pointer;
  position: relative;
  transition: max-height .3s ease;
}
.product-intro blockquote.intro-collapsed {
  max-height: 4.5em;
  overflow: hidden;
}
.product-intro blockquote.intro-collapsed::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2em;
  background: linear-gradient(transparent, #FFF);
  pointer-events: none;
}
.intro-toggle {
  display: inline-block;
  margin-top: .4rem;
  font-size: .82rem;
  color: #E30613;
  cursor: pointer;
  user-select: none;
  font-style: normal;
}

/* Scheda prodotto */
.product-card {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid #E8E8E8;
  align-items: start;
}
.product-card:last-child { border-bottom: none; }

.product-card--reverse { direction: rtl; }
.product-card--reverse > * { direction: ltr; }

.product-img {
  border-radius: 6px;
  overflow: hidden;
  background: #F5F5F5;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 1rem;
}
.product-img img { max-height: 220px; object-fit: contain; }
.product-img .no-img {
  color: #bbb;
  font-size: .85rem;
  text-align: center;
}

.product-info h3 { margin-bottom: .25rem; }
.product-info .subtitle { color: #666; font-size: .9rem; margin-bottom: 1rem; font-style: italic; }

/* Back to top link per prodotto */
.back-to-top-link {
  display: block;
  text-align: right;
  margin-top: 1rem;
  font-size: .85rem;
  color: #E30613;
  text-decoration: none;
}
.back-to-top-link:hover { text-decoration: none; color: #b80010; }
.product-info p  { color: #333; font-size: .95rem; }

.feature-list { margin: 1rem 0; }
.feature-list h4 { margin-bottom: .5rem; font-size: .9rem; color: #888; text-transform: uppercase; letter-spacing: .05em; }
.feature-list ul { list-style: none; }
.feature-list li {
  padding: .3rem 0 .3rem 1.2rem;
  position: relative;
  font-size: .92rem;
  color: #333;
}
.feature-list li::before { content: '▸'; color: #E30613; position: absolute; left: 0; }

.product-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; }
.product-cta .link-brand { font-size: .85rem; color: #666; align-self: center; }
.product-cta .link-brand a { color: #E30613; }

/* ── Pagina Usato ─────────────────────────────────────────── */
.usato-filters {
  background: #F5F5F5;
  padding: 1.25rem;
  border-radius: 6px;
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.usato-filters label { font-weight: 600; font-size: .9rem; }
.usato-filters select {
  padding: .5rem .9rem;
  border: 1px solid #DDD;
  border-radius: 4px;
  font-family: inherit;
  font-size: .9rem;
}

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

.usato-card {
  border: 1px solid #E8E8E8;
  border-radius: 8px;
  overflow: hidden;
  background: #FFF;
  transition: box-shadow .2s;
}
.usato-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }

.usato-card-img {
  height: 200px;
  background: #F5F5F5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.usato-card-img img { width: 100%; height: 100%; object-fit: cover; }
.usato-card-img .no-foto { color: #bbb; font-size: .85rem; }

.usato-card-body { padding: 1.25rem; }
.usato-card-body .categoria {
  font-size: .78rem;
  color: #E30613;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .4rem;
}
.usato-card-body h3 { font-size: 1rem; margin-bottom: .5rem; }
.usato-card-body p  { font-size: .88rem; color: #555; margin-bottom: 1rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.usato-card-body .prezzo {
  font-size: 1.1rem; font-weight: 700; color: #1A1A1A; margin-bottom: .75rem;
}
.usato-card-body .prezzo.su-richiesta { color: #888; font-size: .9rem; font-weight: 400; font-style: italic; }

/* ── Sezione Contatti / Form ─────────────────────────────── */
.contatti-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-info p { margin-bottom: .75rem; display: flex; align-items: flex-start; gap: .6rem; }
.contact-info .label { font-weight: 600; min-width: 80px; }

.contact-form .form-group { margin-bottom: 1.25rem; }
.contact-form label { display: block; font-size: .9rem; font-weight: 500; margin-bottom: .4rem; }
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: .7rem 1rem;
  border: 1px solid #DDD;
  border-radius: 4px;
  font-family: inherit;
  font-size: .95rem;
  transition: border-color .2s;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus { outline: none; border-color: #E30613; }
.contact-form textarea { min-height: 140px; resize: vertical; }

.form-note { font-size: .8rem; color: #888; margin-top: .5rem; }
.form-success { background: #e6f4ea; color: #2e7d32; padding: 1rem; border-radius: 4px; display: none; }

/* ── Sezione Chi Siamo ───────────────────────────────────── */
.chisiamo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.chisiamo-text p { color: #444; }
.chisiamo-text p + p { margin-top: .5rem; }

.valori-list { margin-top: 1.5rem; }
.valori-list li {
  padding: .6rem 0;
  border-bottom: 1px solid #F0F0F0;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.valori-list li:last-child { border-bottom: none; }
.valori-list .v-icon { color: #E30613; font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }

/* ── Sezione Servizi ──────────────────────────────────────── */
.servizi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}
.servizio-card {
  background: #FFF;
  border: 1px solid #E8E8E8;
  border-radius: 6px;
  padding: 2rem 1.5rem;
  border-top: 4px solid #E30613;
}
.servizio-card h3 { margin-bottom: .75rem; }
.servizio-card p  { color: #555; font-size: .92rem; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: #1A1A1A;
  color: #CCC;
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-brand img  { height: 65px; margin-bottom: 1rem; filter: brightness(0) invert(1); }
.site-footer .marchi-grid { background: #FFF; padding: .75rem 1.25rem; border-radius: 6px; margin-top: 0; }
.footer-brand p    { font-size: .87rem; color: #999; }

.footer-col h4     { color: #FFF; font-size: .9rem; margin-bottom: 1rem; letter-spacing: .04em; }
.footer-col ul li  { margin-bottom: .5rem; }
.footer-col ul li a { color: #AAA; font-size: .87rem; }
.footer-col ul li a:hover { color: #E30613; text-decoration: none; }
.footer-col address { font-style: normal; font-size: .87rem; color: #999; line-height: 1.8; }

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .82rem;
  color: #777;
}

/* ── Sezione "Usato recente" su Home ─────────────────────── */
.usato-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* ── Prossimamente ────────────────────────────────────────── */
.coming-soon {
  text-align: center;
  padding: 5rem 1rem;
  color: #888;
}
.coming-soon h2 { color: #1A1A1A; margin-bottom: 1rem; }
.coming-soon p  { max-width: 480px; margin: 0 auto 2rem; }

/* ── Sezione intro con sezione titolo ────────────────────── */
.section-header { margin-bottom: 2.5rem; }
.section-header h2 { margin-bottom: .5rem; }
.section-header p  { color: #555; font-size: 1rem; max-width: 600px; }
.section-header .line {
  width: 48px; height: 4px; background: #E30613; margin-top: 1rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  /* Nav mobile */
  .nav-toggle { display: block; }

  .nav-inner > nav { flex: none; }

  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 84px;
    left: 0;
    right: 0;
    background: #1A1A1A;
    padding: .5rem 0 1rem;
    box-shadow: 0 8px 20px rgba(0,0,0,.3);
    z-index: 99;
  }
  .nav-menu.open { display: flex; }

  .nav-link { padding: .75rem 1.25rem; border-radius: 0; }
  .dropdown { position: static; border-top: none; box-shadow: none; background: #2a2a2a; display: none; }
  .nav-item.open .dropdown { display: block; }
  .dropdown a { color: #CCC; padding-left: 2rem; }
  .dropdown a:hover { background: #E30613; color: #FFF; }

  /* Prodotti */
  .product-card { grid-template-columns: 1fr; }
  .product-card--reverse { direction: ltr; }
  .product-intro { grid-template-columns: 1fr; }
  .product-intro .brand-logo { text-align: left; }
  .product-intro .brand-logo img { margin-left: 0; }

  /* Chi siamo / Contatti */
  .chisiamo-grid { grid-template-columns: 1fr; }
  .contatti-grid { grid-template-columns: 1fr; }
  .chisiamo-soci { grid-template-columns: 1fr !important; }
  .chisiamo-team { grid-template-columns: 1fr !important; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }

  .section { padding: 2.5rem 0; }
}

@media (max-width: 480px) {
  .hero { padding: 3rem 0; }
  .usato-grid { grid-template-columns: 1fr; }
  .settori-grid { grid-template-columns: 1fr; }
}
