@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f0f4f8;
  color: #333;
  transform-origin: top left;
  overflow-x: hidden;
}

.header-container {
  display: flex;
  align-items: center;
  padding: 20px;
  position: absolute;
  top: 0;
  left: 20px;
  z-index: 2;
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

.azienda {
  font-size: 1.5rem;
  margin-left: 15px;
  font-weight: 600;
  color: #1c3d5a;
}

.hero {
  display: flex;
  align-items: center;
  height: 80vh;
  background-color: #e0e6ed;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.text-content {
  width: 50%;
  padding-left: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.text-content h1 {
  font-size: 3rem;
  color: #1c3d5a;
  margin-bottom: 20px;
}

.text-content p {
  font-size: 1.2rem;
  color: #52667a;
}

.hero-image {
  width: 50%;
  height: 80vh;
  overflow: hidden;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

section {
  padding: 60px 20px;
  text-align: center;
  background-color: #e5f1fb;
}

h2 {
  font-size: 2.5rem;
  color: #1c3d5a;
  margin-bottom: 40px;
}

.service-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 1024px) {
  .service-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .service-container { grid-template-columns: 1fr; }
}

.service {
  background-color: #ffffff;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
}

.prodotti .service img {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #fff;
  padding: 6px;
}
@media (max-width: 640px) {
  .prodotti .service img { padding: 4px; }
}

@media (hover: hover) {
  .service:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  }
}

.service h3 {
  font-size: 1.5rem;
  color: #1c3d5a;
  margin: 10px 0 0;
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.card-link h3 {
  text-decoration: underline;
}

#contatti {
  background-color: #f0f4f8;
  padding: 40px 20px;
  border-top: 2px solid #eee;
}

.contact-content {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  gap: 16px;
}

.contact-info {
  text-align: left;
  flex: 1;
}

.contact-info h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #1c3d5a;
}

.contact-info p {
  font-size: 1.2rem;
  color: #52667a;
  margin: 10px 0;
}

.contact-logo {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.logo-contatti {
  width: 100px;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.line {
  width: 100%;
  height: 3px;
  background-color: #1c3d5a;
  margin: 0;
}

.centered-title {
  margin-top: 40px;
  margin-bottom: 40px;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}

.prodotti-section {
  padding: 60px 20px;
  background-color: #e5f1fb;
}

.prodotti-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
}

.prodotto {
  width: 30%;
  background-color: #ffffff;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform;
}

@media screen and (max-width: 768px) {
  .hero {
    position: relative;
    height: 80vh;
    overflow: hidden;
  }
  .hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('foto/efficienza.png');
    background-size: cover;
    background-position: center;
    filter: blur(5px);
    z-index: 0;
  }
  .hero-image { display: none; }
  .text-content {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,0.7);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 90%;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: auto;
  }
  .text-content h1 { font-size: 1.7rem; margin-bottom: 10px; }
  .text-content p { color: #52667a; margin-bottom: 0; }
  .contact-info h2 { font-size: 1.7rem; }
  .contact-info p { font-size: 1.2rem; }
  .logo-contatti { width: 70px; }
  .centered-title { margin-top: 20px; margin-bottom: 20px; transform: translateY(-60%); }
  .title-servizi { font-size: 2rem; }
}

@media screen and (max-width: 480px) {
  .text-content h1 { font-size: 1.5rem; }
  .text-content p { font-size: 0.8rem; }
  .logo { width: 30px; height: 30px; }
  .service h3 { font-size: 1.2rem; }
  .contact-info h2 { font-size: 1.4rem; }
  .contact-info p { font-size: 0.8rem; }
  .logo-contatti { width: 60px; }
  .centered-title { margin-top: 20px; margin-bottom: 20px; transform: translateY(-60%); }
  .title-servizi { font-size: 2rem; }
}

.btn-contattaci {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 12px;
  background: #1c3d5a;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.btn-contattaci:hover { filter: brightness(1.05); }

/* ====== Contact page styles moved here ====== */
.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f4f8;
  padding-block: 24px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.card {
  width: 100%;
  max-width: 720px;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.card h1 { margin: 0 0 6px; color: #1c3d5a; }
.card p.sub { margin: 0 0 18px; color: #52667a; }

#contact-form .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
#contact-form .grid .full { grid-column: 1 / -1; }

#contact-form label {
  display: block;
  font-weight: 600;
  margin: 10px 0 6px;
  color: #1c3d5a;
}
#contact-form input,
#contact-form select,
#contact-form textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #d6dee6;
  font-size: 1rem;
  background: #fff;
}
#contact-form textarea { min-height: 160px; resize: vertical; }

#contact-form .hint { color: #52667a; font-size: .9rem; margin-top: 4px; }
#contact-form .req { color: #e11d48; white-space: nowrap; margin-left: 4px; }

#contact-form .actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
#contact-form button {
  appearance: none;
  border: 0;
  background: #1c3d5a;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 12px;
  border-radius: 10px;
  display: none;
}
.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 12px;
  border-radius: 10px;
  display: none;
}
.back { display: inline-block; margin-top: 16px; color: #1c3d5a; text-decoration: none; font-weight: 600; }

@media (max-width: 640px) {
  #contact-form .grid { grid-template-columns: 1fr; gap: 14px; }
  #contact-form .actions { flex-wrap: wrap; gap: 8px; }
  #contact-form button { width: 100%; }
}

#contact-form .consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
#contact-form .consent-row input[type="checkbox"] {
  flex: 0 0 auto;
  margin-top: 2px;
  width: auto;
  height: auto;
}
#contact-form .consent-row label {
  margin: 0;
  line-height: 1.35;
}

#contact-form *,
#contact-form *::before,
#contact-form *::after {
  box-sizing: border-box;
}

/* ====== Prodotti Banner (Homepage) ====== */
.prodotti-banner {
  background: linear-gradient(135deg, #e5f1fb 0%, #f0f4f8 100%);
  padding: 50px 20px;
}

.prodotti-banner-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.prodotti-banner-text h2 {
  font-size: 1.8rem;
  color: #1c3d5a;
  margin: 0 0 8px;
}

.prodotti-banner-text p {
  font-size: 1rem;
  color: #52667a;
  margin: 0;
}

.btn-prodotti {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 12px;
  background: #1c3d5a;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(28, 61, 90, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-prodotti:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(28, 61, 90, 0.35);
}

.btn-prodotti svg {
  transition: transform 0.2s ease;
}

.btn-prodotti:hover svg {
  transform: translateX(4px);
}

@media (max-width: 640px) {
  .prodotti-banner-text h2 {
    font-size: 1.5rem;
  }
}

/* ====== Prodotti Page ====== */
.prodotti-header {
  background: #e0e6ed;
  padding: 10px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.prodotti-header .header-container {
  position: relative;
  top: auto;
  left: auto;
}

.header-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.header-link:hover .azienda {
  color: #2a5a80;
}

.prodotti-page {
  min-height: calc(100vh - 160px);
  padding: 40px 20px;
  background: #f0f4f8;
}

.prodotti-intro {
  max-width: 900px;
  margin: 0 auto 40px;
  text-align: center;
}

.prodotti-intro h1 {
  font-size: 2.2rem;
  color: #1c3d5a;
  margin: 0 0 12px;
}

.prodotti-intro p {
  font-size: 1.1rem;
  color: #52667a;
  margin: 0;
}

.prodotti-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.prodotto-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.prodotto-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.prodotto-card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.prodotto-img {
  background: #fff;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.prodotto-img img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.prodotto-info {
  padding: 20px;
  border-top: 1px solid #eee;
}

.prodotto-info h3 {
  font-size: 1.3rem;
  color: #1c3d5a;
  margin: 0 0 8px;
}

.prodotto-desc {
  font-size: 0.95rem;
  color: #52667a;
  margin: 0 0 12px;
  line-height: 1.5;
}

.prodotto-cta {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1c3d5a;
  transition: color 0.2s ease;
}

.prodotto-card:hover .prodotto-cta {
  color: #ff9900;
}

.affiliate-disclaimer {
  max-width: 800px;
  margin: 40px auto 0;
  padding: 16px 20px;
  background: #e0e6ed;
  border-radius: 10px;
  text-align: center;
}

.affiliate-disclaimer p {
  font-size: 0.85rem;
  color: #52667a;
  margin: 0;
  line-height: 1.6;
}

.prodotti-footer {
  background: #e0e6ed;
  padding: 20px;
  text-align: center;
}

.prodotti-footer .back {
  margin: 0;
}

@media (max-width: 640px) {
  .prodotti-intro h1 {
    font-size: 1.7rem;
  }
  .prodotti-grid {
    grid-template-columns: 1fr;
  }
}

#contact-form input,
#contact-form select,
#contact-form textarea {
  width: 100%;
  max-width: 100%;
}
