/* =========================================================
   RESET E VARIABILI
   ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

:root{
  --space-1: clamp(8px, 1.6vw, 16px);
  --space-2: clamp(12px, 2vw, 24px);
  --space-3: clamp(16px, 3vw, 28px);
  --radius: clamp(12px, 2vw, 24px);

  --fs-xxl: clamp(1.25rem, 4.6vw, 2.2rem);
  --fs-xl:  clamp(1.05rem, 2.6vw, 1.35rem);
  --fs-md:  clamp(0.9rem,  2.1vw, 0.98rem);
  --fs-sm:  clamp(0.82rem, 1.8vw, 0.92rem);
}

/* =========================================================
   BASE
   ========================================================= */
body {
  background-color: #FEF1F6;
  font-family: "Georgia", serif;
  margin: 0;
}

/* =========================================================
   SLIDER: CONTAINER ESTERNO
   ========================================================= */
.image-shadow-box-container {
  width: min(95%, 1400px);
  display: flex;
  justify-content: center;
  margin: 0 auto 40px auto;
  padding: 0;
  border-radius: var(--radius);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}
.image-shadow-box { border-radius: inherit; }

/* =========================================================
   SLIDER: DEFAULT (verrà sovrascritto dai media query)
   ========================================================= */
.slider-box {
  width: 100%;
  height: clamp(300px, 55vh, 460px);
  border-radius: var(--radius);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
}
.slides { width: 100%; height: 100%; position: relative; }

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  border-radius: calc(var(--radius) - 5px);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  pointer-events: none;
}
.slide.active { opacity: 1; z-index: 1; pointer-events: auto; }

/* =========================================================
   OVERLAY TESTO (default sopra immagine, poi sovrascritto)
   ========================================================= */
.overlay-text {
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.85);
  padding: calc(var(--space-1) * 1) calc(var(--space-1) * 2.1);
  border-radius: 15px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  max-width: 88%;
  z-index: 2;
  color: #000;
  text-align: left;

  /* per titolo responsivo basato sul contenitore */
  container-type: inline-size;
  container-name: hero;
}

/* ===== Titolo + Prezzo: UNA SOLA RIGA e adattabile ===== */
.overlay-text h1{
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(4px, 1.5vw, 16px);
  margin: 0 0 8px 0;
  white-space: nowrap;
  line-height: 1.1;
  max-width: 100%;
  min-width: 0;
  font-size: clamp(0.82rem, 4.2vw, 2.2rem);
  text-align: center;
}
.overlay-text h1 span{
  margin-left: 0 !important;
  font-size: inherit;
}

/* Adattamenti in base alla larghezza reale dell'overlay */
@container hero (max-width: 520px){
  .overlay-text h1{
    font-size: clamp(0.72rem, 6.2cqw, 1.6rem);
    gap: clamp(2px, 1.2cqw, 10px);
    letter-spacing: -0.005em;
  }
  .overlay-text h1 span{ font-size: 0.95em; }
}
@container hero (max-width: 380px){
  .overlay-text h1{
    font-size: clamp(0.66rem, 7.5cqw, 1.3rem);
    letter-spacing: -0.01em;
  }
  .overlay-text h1 span{ font-size: 0.9em; }
}
@container hero (min-width: 1000px){
  .overlay-text h1{
    font-size: clamp(1.05rem, 2.2cqw, 2.4rem);
  }
}

/* Testo descrittivo overlay e bottoni */
.overlay-text p { font-size: var(--fs-md); margin: 0 0 16px 0; }
.overlay-text .buttons { display: flex; gap: 15px; margin-top: 10px; }
.buttons { padding-bottom: 10px; }
#prenota-btn { margin-top: 12px; }

.overlay-text .btn {
  padding: 10px 20px; border-radius: 25px; border: 1px solid #333;
  text-decoration: none; font-weight: bold; font-size: var(--fs-sm);
  transition: all 0.3s ease;
}
.overlay-text .btn.primary { background-color: #fff; color: #000; }
.overlay-text .btn.secondary { background-color: transparent; color: #000; }
.overlay-text .btn:hover { background-color: #000; color: #fff; }

/* Puntini slider */
.dots { position: absolute; bottom: 12px; right: 16px; display: flex; gap: 8px; z-index: 3; }
.dot  { width: 11px; height: 11px; background: #e06699; border-radius: 50%; cursor: pointer; transition: background 0.3s; box-shadow: 0 0 3px rgba(0,0,0,.2); }
.dot.active { background: #f7c3d5; }

/* =========================================================
   MAIN E SEZIONI
   ========================================================= */
main { display: flex; justify-content: center; width: 95%; margin: 0 auto; }

.box-1 {
  width: 100%;
  display: flex; flex-direction: column;
  gap: clamp(36px, 7.5vw, 90px);
  border-radius: var(--radius);
  box-shadow: inset 0 0 25px rgba(0,0,0,.20);
  padding: var(--space-3);
  background-color: #fdd9e6;
  margin: 36px;
}
.box-2 { position: relative; }

.box-bg {
  position: relative;
  padding: clamp(20px, 6.5vw, 110px) clamp(16px, 7.5vw, 120px);
  display: block; overflow: hidden;
}

/* desktop default: affiancati (poi override) */
.box-3 {
  display: flex; justify-content: center; align-items: center;
  gap: clamp(16px, 3vw, 28px);
  max-width: 1000px; width: 100%;
  position: relative; margin: 0 auto; text-align: left;
}
.box-3.reverse { flex-direction: row-reverse; justify-content: center; align-items: center; }

.box-img {
  flex: 1 1 auto; min-width: 100%; max-width: 100%;
  height: clamp(240px, 48vw, 540px);
  overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,.1);
}
.box-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.box-4 {
  flex: 0 0 38%; max-width: 38%;
  padding: 26px; background: #fff; box-shadow: 0 4px 8px rgba(0,0,0,.15);
  position: relative; z-index: 2; height: auto;
}
.box-4 h3 { margin: 0 0 8px 0; font-size: var(--fs-xl); font-weight: bold; color: #333; }
.box-4 p  { font-size: var(--fs-md); line-height: 1.55; color: #555; margin: 0; }

/* Decorazioni */
.decor-wrapper { position:absolute; inset:0; pointer-events:none; z-index:0; }
.decor { position:absolute; opacity:.4; width:100px; height:auto; }
.decor-1, .decor-1-2, .decor-1-3, .decor-1-4 { top:10px; left:-10px; transform:rotate(-25deg); width:35%; }
.decor-2, .decor-2-2, .decor-2-3, .decor-2-4 { bottom:3%; right:0%; width:35%; transform:rotate(50deg); }
.decor-3, .decor-3-2, .decor-3-3, .decor-3-4 { top:40%; left:25%; width:18%; transform:rotate(-85deg); }

/* Contatti */
#contatti-btns{
  opacity: 0; transition: opacity .5s ease;
  display:flex; flex-direction:row; justify-content:center; align-items:center; gap:16px; flex-wrap:wrap;
}
.wa-btn{ background:#25D366; color:#fff; padding:12px 22px; border-radius:8px; font-size:var(--fs-md); text-decoration:none; transition:background-color .3s; min-width:180px; text-align:center; }
.wa-btn:hover{ background:#000; }
.call-btn{ background:#fff; color:#000; border:2px solid #000; padding:12px 22px; border-radius:8px; font-size:var(--fs-md); text-decoration:none; transition:background-color .3s, color .3s; min-width:180px; text-align:center; }
.call-btn:hover{ background:#000; color:#fff; }

/* =========================================================
   MOBILE (640px) — contenitori più larghi e stack a colonna
   ========================================================= */
@media (max-width: 640px){
  .image-shadow-box-container{ width:100%; margin:0 0 12px 0; border-radius:12px; }
  main{ width:100%; }
  .box-1{ margin:10px 8px; padding: var(--space-2); border-radius:12px; gap: clamp(22px, 6.5vw, 44px); }
}

/* =========================================================
   SUB-DESKTOP UNIFICATO (1365px)
   - Overlay dello slider sotto immagine
   - Testi delle sezioni sotto immagini
   - Immagini grandi per evitare miniature/bande
   - Titolo+prezzo super adattbile
   ========================================================= */
@media (max-width: 1365px){

  /* Slider in modalità blocchi */
  .slider-box{ display:block; height:auto; overflow:visible; margin:0 auto; }
  .slides{ width:100%; height:auto; position:relative; }

  .slide{
    position: static; display:none; width:100%; height:auto;
    max-height: clamp(300px, 54vh, 680px);
    object-fit: cover;
    background:#fff; opacity:1; transition:none; border-radius:12px;
  }
  .slide.active{ display:block; }

  /* Overlay sotto immagine */
  .overlay-text{
    position: static; left:auto; top:auto; transform:none;
    max-width:100%;
    margin: var(--space-2) auto 0;
    padding: clamp(12px, 2.4vw, 18px);
    border-radius:12px; background: rgba(255,255,255,.96);
    text-align:center;
  }

  /* Titolo su riga singola con shrink aggressivo */
  .overlay-text h1{
    gap: clamp(2px, 1.2cqw, 14px);
    font-size: clamp(0.72rem, 3.6cqw, 2rem);
    letter-spacing: -0.005em;
  }
  .overlay-text h1 span{ margin-left:0 !important; font-size:0.95em; }

  .overlay-text .buttons{ justify-content:center; flex-direction: column; align-items: center; gap: 12px; }
  #prenota-btn{ margin-top: 16px; }
  .buttons{ padding-bottom: 10px; }

  /* Sezioni impilate: testo sotto immagine */
  .box-3{ display:block; margin-left:auto; margin-right:auto; text-align:center; }
  .box-3.reverse{ flex-direction: unset; }

  .box-img{
    height: clamp(300px, 54vh, 720px);
    border-radius:12px;
  }
  .box-img img{ object-fit: cover; background:#fff; }

  .box-4{
    max-width:100%; width:100%;
    margin: 18px auto 0;
    padding: clamp(12px, 2.2vw, 18px);
    box-shadow:0 2px 6px rgba(0,0,0,.12); text-align:center;
  }
  .box-4::after{
    content:""; display:block; width:60%; height:2px;
    margin: 22px auto 0;
    border-radius:2px; background:#000; opacity:.85;
  }
}

/* =========================================================
   iPAD AIR/PRO LANDSCAPE (touch) — immagini non tagliate
   ========================================================= */
@media (min-width: 1025px) and (max-width: 1365px) and (orientation: landscape) and (pointer: coarse){

  .box-img{ height: clamp(320px, 56vh, 760px); }
  .box-img img{ object-fit: contain; background:#fff; }

  .slide{
    max-height: clamp(320px, 56vh, 720px);
    object-fit: contain; background:#fff;
  }

  .overlay-text h1{
    gap: clamp(1px, 0.8cqw, 10px);
    font-size: clamp(0.64rem, 2.6cqw, 1.6rem);
    letter-spacing: -0.012em;
  }
  .overlay-text h1 span{ font-size: 0.9em; }
}

/* =========================================================
   DESKTOP NORMALE (1366px)
   - Applica lo stesso principio: overlay sotto immagine
   - Testi delle sezioni restano affiancati (layout desktop)
   ========================================================= */
@media (min-width: 1366px){

  /* Slider impilato, immagine sopra e overlay sotto */
  .slider-box{
    display: block;
    height: auto;
    overflow: visible;
    margin: 0 auto;
  }
  .slides{ height: auto; }

  .slide{
    position: static;
    display: none;
    width: 100%;
    height: auto;
    max-height: clamp(380px, 52vh, 720px);
    object-fit: cover;
    background: #fff;
    opacity: 1;
    transition: none;
    border-radius: 16px;
  }
  .slide.active{ display: block; }

  .overlay-text{
    position: static;
    left: auto; top: auto; transform: none;
    max-width: min(100%, 1100px);
    margin: 18px auto 0;
    padding: 16px 22px;
    border-radius: 14px;
    background: rgba(255,255,255,0.9);
    text-align: center;
  }

  /* Titolo + prezzo su una riga con scala morbida */
  .overlay-text h1{
    gap: clamp(8px, 1.2vw, 22px);
    margin: 0 0 12px 0;
    font-size: clamp(1rem, 1.6vw, 2rem);
    letter-spacing: 0;
  }
  .overlay-text h1 span{ margin-left: 0 !important; font-size: inherit; }

  .overlay-text .buttons{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
  }
  #prenota-btn{ margin-top: 8px; }
  .buttons{ padding-bottom: 8px; }
}

/* =========================================================
   ACCESSIBILITA'
   ========================================================= */
@media (prefers-reduced-motion: reduce){
  .slide{ transition: none !important; }
  .overlay-text .btn{ transition: none !important; }
}
