/* === RESET & BASE === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #03356f;
  --primary-light: #0a5c9e;
  --accent: #00b4d8;
  --accent-hover: #0096b4;
  --bg-light: #ffffff;
  --bg-gray: #f4f7fc;
  --text-dark: #1a1a2e;
  --text-light: #ffffff;
  --font: 'Inter', -apple-system, sans-serif;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.14);
  --transition: all 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

/* === NAVBAR === */
.navbar {
  padding: 12px 0;
  transition: var(--transition);
  background: transparent;
}

.navbar.scrolled {
  background: var(--primary);
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
  padding: 8px 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-light);
  font-weight: 700;
  font-size: 1.2rem;
}

.nav-logo img {
  height: 44px;
  width: auto;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-link {
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.9;
  transition: var(--transition);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  opacity: 1;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
}

/* === HEADER FIXED (navbar + banner) === */
.header-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

/* === HOLIDAY BANNER === */
.holiday-banner {
  position: relative;
  background: #e74c3c;
  color: white;
  text-align: center;
  padding: 10px 40px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  transition: transform 0.4s ease, max-height 0.4s ease;
}

.holiday-banner.hidden {
  transform: translateY(-100%);
  max-height: 0;
  padding: 0;
  overflow: hidden;
}

.holiday-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.8;
  line-height: 1;
  padding: 4px 8px;
}

.holiday-close:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .holiday-banner {
    font-size: 0.8rem;
    padding: 8px 36px 8px 12px;
  }
}

/* === HERO === */
/* IMMAGINE PRINCIPALE DEL SITO: per cambiarla sostituisci qui sotto solo il nome del file (es. img/nomefile.jpg) */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: url('../img/img-20210127-94210-2000x1500.jpg') center/cover no-repeat fixed;
  padding-top: 110px;
}

@media (max-width: 768px) {
  .hero {
    padding-top: 90px;
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(3,53,111,0.92) 0%, rgba(10,92,158,0.8) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--text-light);
  max-width: 800px;
}

.hero-title {
  font-size: clamp(1.8rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s ease forwards;
}

.hero-text {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: 36px;
  line-height: 1.8;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s ease 0.2s forwards;
}

.btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-light);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s ease 0.4s forwards;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,180,216,0.35);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: white;
}

/* === SECTIONS === */
.section {
  padding: 100px 0;
}

.section-dark {
  background: linear-gradient(135deg, var(--primary) 0%, #021f40 100%);
  color: var(--text-light);
}

.section-gray {
  background: var(--bg-gray);
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
}

.section-subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 56px;
  font-size: 1.05rem;
}

.section-dark .section-subtitle {
  color: rgba(255,255,255,0.7);
}

/* === GRID === */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

@media (max-width: 768px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === SERVICE CARDS === */
.service-card {
  background: var(--bg-light);
  padding: 40px 28px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: var(--transition);
  border: 1px solid rgba(0,0,0,0.04);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.service-icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary);
}

.service-card p {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.7;
}

/* === CERT === */
.cert-card {
  text-align: center;
  padding: 36px 20px;
  background: rgba(255,255,255,0.08);
  border-radius: 20px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.12);
  transition: var(--transition);
}

.cert-card:hover {
  background: rgba(255,255,255,0.14);
  transform: translateY(-4px);
}

.cert-icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.cert-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.cert-link {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cert-logos-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.cert-logos-inline img {
  height: 40px;
  width: auto;
  opacity: 0.9;
  transition: var(--transition);
  background: white;
  padding: 6px 12px;
  border-radius: 6px;
}

.cert-logos-inline img:hover {
  opacity: 1;
}

/* === GALLERY === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

.gallery-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.gallery-img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-hover);
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #6b7280;
  padding: 24px 0;
}

/* === BONUS === */
.bonus-card {
  display: flex;
  gap: 40px;
  align-items: center;
  background: white;
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow);
}

@media (max-width: 768px) {
  .bonus-card {
    flex-direction: column;
    padding: 24px;
  }
}

.bonus-card img {
  width: 300px;
  border-radius: 16px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .bonus-card img {
    width: 100%;
  }
}

.bonus-content p {
  font-size: 1rem;
  line-height: 1.7;
  color: #555;
  margin-bottom: 20px;
}

/* === MAP === */
.section-map iframe {
  width: 100%;
  height: 400px;
  display: block;
  border: none;
}

/* === FOOTER === */
.footer {
  background: var(--primary);
  color: var(--text-light);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 40px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.footer h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent);
}

.footer p {
  font-size: 0.95rem;
  line-height: 1.8;
  opacity: 0.85;
}

.footer-link {
  color: var(--text-light);
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 24px 0;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* === WHATSAPP === */
.whatsapp-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1600;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  transition: var(--transition);
}

.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(37,211,102,0.5);
}

.whatsapp-panel {
  position: fixed;
  bottom: 92px;
  left: 24px;
  z-index: 1600;
  width: min(340px, calc(100vw - 32px));
  background: #e5ddd5;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
}

.whatsapp-panel[hidden] {
  display: none;
}

.whatsapp-panel:not([hidden]) {
  animation: whatsappApri 0.3s ease;
}

@keyframes whatsappApri {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.whatsapp-panel-header {
  background: #39847a;
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.whatsapp-panel-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.whatsapp-panel-body {
  padding: 16px;
}

.whatsapp-msg {
  margin: 0;
  background: #ffffff;
  color: var(--text-dark);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.whatsapp-panel-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #ffffff;
}

.whatsapp-panel-input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  min-width: 0;
}

.whatsapp-panel-send {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: #39847a;
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  .whatsapp-panel {
    left: 16px;
    bottom: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-panel:not([hidden]) {
    animation: none;
  }
}

/* === LIGHTBOX === */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 36px;
  font-size: 3rem;
  color: white;
  cursor: pointer;
  transition: var(--transition);
}

.lightbox-close:hover {
  color: var(--accent);
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .nav-menu {
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

/* === COOKIE BANNER (gestione consensi) === */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 1500;
  max-width: 720px;
  margin: 0 auto;
  background: #ffffff;
  color: var(--text-dark);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.25);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.cookie-banner.hidden {
  transform: translateY(200%);
  opacity: 0;
  pointer-events: none;
}

.cookie-banner-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.9rem;
}

/* === MODALE PREFERENZE === */
.cookie-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2001;
  background: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cookie-modal.active {
  display: flex;
}

.cookie-modal-box {
  background: #fff;
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  padding: 28px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  color: var(--text-dark);
}

.cookie-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #888;
  line-height: 1;
}

.cookie-modal h3 {
  margin-bottom: 8px;
  color: var(--primary);
}

.cookie-modal-intro {
  font-size: 0.92rem;
  color: #666;
  margin-bottom: 20px;
}

.cookie-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}

.cookie-category-info {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #555;
}

.cookie-category-info strong {
  color: var(--text-dark);
}

.cookie-salva {
  margin-top: 20px;
  width: 100%;
}

/* === SWITCH === */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 26px;
  transition: background 0.3s ease;
}

.switch .slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.switch input:checked + .slider {
  background: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

.switch input:disabled + .slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* === SEGNAPOSTO MAPPA === */
.map-placeholder {
  height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  background: var(--bg-gray);
  color: var(--text-dark);
  padding: 20px;
}

.map-placeholder p {
  font-size: 0.95rem;
  color: #666;
  max-width: 420px;
}

/* === LINK GESTIONE COOKIE NEL FOOTER === */
.footer-cookie-link {
  background: none;
  border: none;
  padding: 0;
  color: rgba(255,255,255,0.85);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 0.85rem;
}

.footer-cookie-link:hover {
  color: var(--accent);
}
