/* ========================================
   AUTOLAVAGGIO CALANDRA — STILI COMUNI
   ======================================== */

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: #1A1A2E; background: #fff; overflow-x: hidden; }

/* Preloader */
#preloader { position: fixed; inset: 0; z-index: 9999; background: #fff; display: flex; align-items: center; justify-content: center; transition: opacity 0.5s ease, visibility 0.5s ease; }
#preloader.hidden { opacity: 0; visibility: hidden; }
.loader-ring { width: 50px; height: 50px; border: 3px solid #EBF2F7; border-top-color: #1375B2; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========================================
   HEADER
   ======================================== */
#site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease; padding: 20px 0; }
#site-header.header-transparent { background: transparent; }
#site-header.header-solid { background: rgba(26,26,46,0.97); box-shadow: 0 2px 20px rgba(0,0,0,0.08); backdrop-filter: blur(10px); }
#site-header.scrolled { padding: 12px 0; }

.header-logo { height: 36px; width: auto; transition: height 0.3s ease; display: block; }
#site-header.scrolled .header-logo { height: 36px; }

/* Header transparent: link bianchi, logo bianco */
#site-header.header-transparent .nav-link { color: rgba(255,255,255,0.9); }
#site-header.header-transparent .nav-link:hover,
#site-header.header-transparent .nav-link.active { color: #fff; }
#site-header.header-transparent .logo-text { color: #fff; }
#site-header.header-transparent .logo-sub { color: rgba(255,255,255,0.7); }
#site-header.header-transparent .header-cta { background: rgba(255,255,255,0.15); backdrop-filter: blur(4px); color: #fff; }
#site-header.header-transparent .header-cta:hover { background: #1375B2; color: #fff; }
#site-header.header-transparent #hamburger span { background: #fff; }

/* Header transparent: diventa scuro allo scroll */
#site-header.header-transparent.scrolled { background: rgba(255,255,255,0.97); box-shadow: 0 2px 20px rgba(0,0,0,0.08); }
#site-header.header-transparent.scrolled .nav-link { color: #1A1A2E; }
#site-header.header-transparent.scrolled .nav-link:hover,
#site-header.header-transparent.scrolled .nav-link.active { color: #1375B2; }
#site-header.header-transparent.scrolled .logo-text { color: #1A1A2E; }
#site-header.header-transparent.scrolled .logo-sub { color: #1375B2; }
#site-header.header-transparent.scrolled .header-cta { background: #1375B2; color: #fff; }
#site-header.header-transparent.scrolled #hamburger span { background: #1A1A2E; }

/* Header solid: link chiari (pagine interne) */
#site-header.header-solid .nav-link { color: rgba(255,255,255,0.7); }
#site-header.header-solid .nav-link:hover,
#site-header.header-solid .nav-link.active { color: #fff; }
#site-header.header-solid .logo-text { color: #fff; }
#site-header.header-solid .logo-sub { color: #1375B2; }
#site-header.header-solid .header-cta { background: #1375B2; color: #fff; }
#site-header.header-solid .header-cta:hover { background: #0D5A8A; }
#site-header.header-solid #hamburger span { background: #fff; }

/* Nav links */
.nav-link { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; transition: color 0.3s; position: relative; padding: 4px 0; text-decoration: none; display: inline-block; }
.nav-link::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px; background: #1375B2; transition: width 0.3s ease; }
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* Mobile menu */
#mobile-menu { position: fixed; top: 0; right: -100%; width: 85%; max-width: 380px; height: 100vh; background: #1A1A2E; z-index: 1100; transition: right 0.4s cubic-bezier(0.25,0.8,0.25,1); padding: 80px 30px 30px; overflow-y: auto; }
#mobile-menu.open { right: 0; }
#menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1050; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
#menu-overlay.open { opacity: 1; visibility: visible; }
.mobile-nav-link { display: block; color: rgba(255,255,255,0.8); font-size: 15px; font-weight: 500; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.08); transition: all 0.3s; text-transform: uppercase; letter-spacing: 0.05em; text-decoration: none; }
.mobile-nav-link:hover,
.mobile-nav-link.active { color: #fff; padding-left: 10px; }

/* Hamburger */
#hamburger { flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; z-index: 1200; background: none; border: none; display: none; }
#hamburger span { display: block; width: 24px; height: 2px; transition: all 0.3s ease; border-radius: 2px; }
#hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
#hamburger.open span:nth-child(2) { opacity: 0; }
#hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

#site-header.scrolled .header-logo {
  height: 26px;
}

/* ========================================
   HERO
   ======================================== */
.hero-section { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero-overlay { position: absolute; inset: 0; }
.hero-content { position: relative; z-index: 10; text-align: center; max-width: 1000px; padding: 0 20px; }
.hero-home { min-height: 100vh; }
.hero-internal { min-height: 80vh; padding-top: 100px; }

/* Water drops (solo home) */
.water-drop { position: absolute; width: 6px; height: 6px; background: rgba(255,255,255,0.3); border-radius: 50%; animation: dropFall linear infinite; }
@keyframes dropFall { 0% { transform: translateY(-20px) scale(1); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(100vh) scale(0.5); opacity: 0; } }

/* Scroll indicator (solo home) */
.scroll-indicator { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 2px; color: rgba(255,255,255,0.5); }
.scroll-indicator span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.scroll-dot { width: 5px; height: 8px; background: rgba(255,255,255,0.5); border-radius: 50%; animation: floatY 1.5s ease-in-out infinite; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ========================================
   ANIMAZIONI SCROLL REVEAL
   ======================================== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-left.revealed { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-right.revealed { opacity: 1; transform: translateX(0); }
.reveal-scale { opacity: 0; transform: scale(0.9); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal-scale.revealed { opacity: 1; transform: scale(1); }

/* ========================================
   COMPONENTI
   ======================================== */

/* Badge */
.badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(19,117,178,0.1); color: #1375B2; padding: 6px 16px; border-radius: 50px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.badge-hero { background: rgba(19,117,178,0.1); border: 1px solid rgba(19,117,178,0.3); color: #93c5fd; }

/* Service Card */
.service-card { background: #fff; border-radius: 16px; padding: 40px 30px; text-align: center; transition: all 0.4s ease; border: 1px solid rgba(19,117,178,0.08); position: relative; overflow: hidden; }
.service-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #1375B2, #1A1A2E); transform: scaleX(0); transition: transform 0.4s ease; transform-origin: left; }
.service-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(19,117,178,0.12); }
.service-card:hover::before { transform: scaleX(1); }

/* Treatment Card */
.treatment-card { border-radius: 20px; overflow: hidden; position: relative; min-height: 320px; display: flex; flex-direction: column; justify-content: flex-end; padding: 35px; transition: all 0.4s ease; }
.treatment-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.15); }

/* Feature Box */
.feature-box { background: #fff; border-radius: 12px; padding: 30px; transition: all 0.3s ease; border: 1px solid #EBF2F7; }
.feature-box:hover { border-color: #1375B2; box-shadow: 0 8px 25px rgba(19,117,178,0.1); }

/* Image Box */
.img-box { border-radius: 16px; overflow: hidden; position: relative; }
.img-box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.img-box:hover img { transform: scale(1.05); }

/* Gallery Grid */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gallery-item { border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; cursor: pointer; position: relative; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(26,26,46,0.4), transparent); opacity: 0; transition: opacity 0.3s; }
.gallery-item:hover::after { opacity: 1; }

/* Review Card */
.review-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); transition: all 0.3s ease; border: 1px solid #EBF2F7; }
.review-card:hover { box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.stars { color: #F59E0B; font-size: 16px; letter-spacing: 2px; }

/* Form */
.form-input { width: 100%; padding: 14px 18px; border: 1px solid #ddd; border-radius: 10px; font-family: 'Inter', sans-serif; font-size: 14px; transition: all 0.3s ease; background: #fff; outline: none; }
.form-input:focus { border-color: #1375B2; box-shadow: 0 0 0 3px rgba(19,117,178,0.1); }

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary { display: inline-flex; align-items: center; gap: 8px; background: #1375B2; color: #fff; padding: 14px 32px; border-radius: 50px; font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; transition: all 0.3s ease; border: none; cursor: pointer; text-decoration: none; overflow: hidden; font-family: 'Inter', sans-serif; }
.btn-primary:hover { background: #0D5A8A; transform: translateY(-2px); box-shadow: 0 8px 25px rgba(19,117,178,0.35); }
.btn-primary:active { transform: translateY(0); }

.btn-outline { display: inline-flex; align-items: center; gap: 8px; border: 2px solid #fff; color: #fff; padding: 12px 30px; border-radius: 50px; font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; transition: all 0.3s ease; cursor: pointer; text-decoration: none; background: transparent; font-family: 'Inter', sans-serif; }
.btn-outline:hover { background: #fff; color: #1A1A2E; }

.btn-dark { display: inline-flex; align-items: center; gap: 8px; background: #1A1A2E; color: #fff; padding: 14px 32px; border-radius: 50px; font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; transition: all 0.3s ease; border: none; cursor: pointer; text-decoration: none; font-family: 'Inter', sans-serif; }
.btn-dark:hover { background: #1375B2; transform: translateY(-2px); box-shadow: 0 8px 25px rgba(26,26,46,0.3); }

/* ========================================
   ELEMENTI FISSI
   ======================================== */
#backToTop { position: fixed; bottom: 90px; right: 20px; width: 48px; height: 48px; background: #1375B2; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 900; border: none; box-shadow: 0 4px 15px rgba(19,117,178,0.3); }
#backToTop.visible { opacity: 1; visibility: visible; }
#backToTop:hover { background: #0D5A8A; transform: translateY(-3px); }

#floatingPhone { position: fixed; bottom: 25px; right: 20px; width: 56px; height: 56px; background: #25D366; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 900; box-shadow: 0 4px 20px rgba(37,211,102,0.4); transition: all 0.3s ease; text-decoration: none; }
#floatingPhone:hover { transform: scale(1.1); box-shadow: 0 6px 25px rgba(37,211,102,0.5); }

/* Toast */
.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1A1A2E; color: #fff; padding: 14px 28px; border-radius: 12px; font-size: 14px; font-weight: 500; z-index: 9999; opacity: 0; transition: all 0.4s ease; pointer-events: none; box-shadow: 0 8px 30px rgba(0,0,0,0.2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========================================
   FOOTER
   ======================================== */
footer a { transition: color 0.3s ease; }
.footer-logo { height: 30px; width: auto; display: block; }



/* ========================================
   BEFORE / AFTER SLIDER
   ======================================== */
.before-after {
  --ba-pos: 50%;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  cursor: ew-resize;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  user-select: none;
  -webkit-user-select: none;
}
.before-after .ba-after { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.before-after .ba-before { clip-path: inset(0 calc(100% - var(--ba-pos)) 0 0); width: 100% !important; overflow: visible; position: absolute; top: 0; left: 0; height: 100%; z-index: 2; }
.before-after .ba-before img { width: 100% !important; min-width: 100% !important; max-width: none !important; position: relative !important; height: 100%; object-fit: cover; }
.before-after .ba-slider { position: absolute; top: 0; bottom: 0; left: var(--ba-pos); width: 4px; background: #fff; z-index: 10; transform: translateX(-50%); cursor: ew-resize; box-shadow: 0 0 12px rgba(0,0,0,0.3); }
.before-after .ba-handle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 2px; box-shadow: 0 2px 12px rgba(0,0,0,0.25); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.before-after .ba-handle:hover { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.before-after .ba-handle svg { color: #1A1A2E; flex-shrink: 0; }
.before-after .ba-labels { position: absolute; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-between; padding: 16px 20px; pointer-events: none; }
.before-after .ba-label { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; padding: 6px 16px; border-radius: 50px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.before-after .ba-label-before { background: rgba(180,60,60,0.8); }
.before-after .ba-label-after { background: rgba(22,163,74,0.8); }
.ba-hint-text { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; color: #1375B2; font-weight: 500; opacity: 0.8; }

/* ========================================
   GALLERIA 3 COLONNE
   ======================================== */
.gallery-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gallery-3col-item { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; cursor: pointer; box-shadow: 0 4px 20px rgba(0,0,0,0.08); transition: transform 0.4s ease, box-shadow 0.4s ease; }
.gallery-3col-item:hover { transform: translateY(-6px); box-shadow: 0 12px 35px rgba(0,0,0,0.15); }
.gallery-3col-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.gallery-3col-item:hover img { transform: scale(1.08); }
.gallery-3col-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(26,26,46,0.7) 0%, rgba(26,26,46,0) 55%); display: flex; align-items: flex-end; padding: 24px; opacity: 0; transition: opacity 0.4s ease; }
.gallery-3col-item:hover .gallery-3col-overlay { opacity: 1; }
.gallery-3col-overlay span { color: #fff; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; transform: translateY(10px); transition: transform 0.4s ease; }
.gallery-3col-item:hover .gallery-3col-overlay span { transform: translateY(0); }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .hero-home { min-height: 90vh; }
  .hero-internal { min-height: 70vh; padding-top: 90px; }
  .hero-content h1 { font-size: 2rem !important; }
  .treatment-card { min-height: 250px; }
  .nav-desktop { display: none !important; }
  #hamburger { display: flex !important; }
  .gallery-3col { grid-template-columns: 1fr; gap: 16px; }
  .gallery-3col-item { aspect-ratio: 16 / 10; }
  .before-after .ba-handle { width: 38px; height: 38px; }
  .before-after .ba-handle svg { width: 12px; height: 12px; }
  .before-after .ba-label { font-size: 10px; padding: 5px 12px; }
  .before-after .ba-labels { padding: 12px 14px; }
  .text-lg {font-size: .9rem;}
}
@media (min-width: 769px) {
  #hamburger { display: none !important; }
  #mobile-menu, #menu-overlay { display: none !important; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .gallery-3col { gap: 16px; }
}