.saw {
  width: 100%;
}

.saw-grid {
  display: flex;
  gap: 24px;
  align-items: stretch;
  height: 550px;
}

/* ordine colonne */
.saw.saw-swiper-right .saw-left {
  order: 1;
}
.saw.saw-swiper-right .saw-right {
  order: 2;
}
.saw.saw-swiper-left .saw-left {
  order: 2;
}
.saw.saw-swiper-left .saw-right {
  order: 1;
}

.saw-left,
.saw-right {
  flex: 1 1 0;
  min-width: 0;
}

/* panel accordion */
.saw-panel {
  background: #f7f1e8; /* crema */
  border-radius: 18px;
  padding: 28px;
  height: 100%;
  border: 6px solid var(--accent);
  overflow-y: auto;
}

.saw-title {
  margin: 0 0 50px 0;
  font-size: 29px;
  line-height: 32px;
  font-family: "Gopher Black";
  color: var(--accent);
}

/* accordion */
.saw-accordion {
  --saw-acc-h: auto; /* viene settato da JS */
}

.saw-acc-item:first-child {
  border-top: 0;
}

.saw-acc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-transform: uppercase;
  color: #5a1f2b;
}

.saw-acc-icon {
  display: inline-flex;
  width: 30px;
  height: 28px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

/* pannelli */
.saw-acc-panel {
  display: none;
}

.saw-acc-item.is-active .saw-acc-panel {
  display: block;
}

.saw-acc-content {
  padding: 6px 0 18px 0;
  color: #5a1f2b;
  font-size: 16px;
  line-height: 1.45;
}

.saw-acc-content ul {
  margin: 0;
  padding-left: 20px;
}

.saw-acc-content li {
  margin-bottom: 2px;
}

/* requisito: l'item aperto NON mostra il suo nome (nascondiamo proprio il trigger) */
.saw-acc-item.is-active .saw-acc-trigger {
  display: none;
}

/* requisito: quando apro il secondo item, prende la stessa altezza del primo
   -> applichiamo una min-height calcolata sul contenuto "Descrizione" */
.saw-acc-item.is-active .saw-acc-content {
  min-height: var(--saw-acc-h);
  overflow: auto;
}

/* CTA */
.saw-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #5a1f2b;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 13px;
  width: 100%;
}

.saw-cta.is-disabled {
  display: none !important;
}

/* swiper wrapper */
.saw-swiper-wrap {
  height: 100%;
}

.saw-swiper {
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 6px solid transparent;
}

.saw.saw-border-bordeaux .saw-swiper {
  border-color: #5a1f2b;
}

.saw.saw-border-white .saw-swiper {
  border-color: var(--light);
}

.saw-slide,
.saw-img {
  height: 100%;
}

.saw-img {
  width: 100%;
  height: 100% !important;
  display: block;
  object-fit: cover; /* riempie e taglia se necessario */
  object-position: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* arrows */
.saw-nav .swiper-button-prev,
.saw-nav .swiper-button-next {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
}

.saw-nav .swiper-button-prev:after,
.saw-nav .swiper-button-next:after {
  font-size: 16px;
  color: #5a1f2b;
}

.saw-left {
  flex: 0 0 30%;
  max-width: 30%;
  min-width: 0;
}

.saw-right {
  flex: 0 0 70%;
  max-width: 70%;
  min-width: 0;
}

/* responsive */
@media (max-width: 1024px) {
  .saw-grid {
    flex-direction: column;
    height: auto;
  }

  .saw-left,
  .saw-right {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .saw-title {
    font-size: 28px;
  }

  .saw-panel {
    padding: 20px;
    height: var(--saw-panel-h, auto);
    overflow-y: auto;
  }

  .saw-acc-item.is-active .saw-acc-content {
    min-height: 0;
    overflow: visible;
  }

  .saw-swiper-wrap,
  .saw-swiper {
    height: 380px;
  }

  .saw-swiper .swiper-wrapper,
  .saw-slide {
    height: 380px;
  }

  .saw-img {
    height: 380px !important;
  }

  .container-rooms {
    height: auto !important;
    overflow: visible !important;
  }
}

@media (max-width: 768px) {
  .saw-grid {
    gap: 16px;
  }

  .saw-title {
    font-size: 24px;
    line-height: 28px;
    margin-bottom: 20px;
  }

  .saw-panel {
    padding: 16px;
  }

  .saw-swiper,
  .saw-panel {
    border-width: 4px;
    border-radius: 12px;
  }

  .saw-swiper-wrap,
  .saw-swiper {
    height: 300px;
  }

  .saw-swiper .swiper-wrapper,
  .saw-slide {
    height: 300px;
  }

  .saw-img {
    height: 300px !important;
  }
}

/* trigger animabile (invece di display:none) */
.saw-acc-trigger {
  overflow: hidden;
  max-height: 80px;
  opacity: 1;
  transition:
    max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease,
    padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: max-height, opacity;
}

/* quando l'item è attivo, il "nome" sparisce in modo fluido */
.saw-acc-item.is-active .saw-acc-trigger {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

/* pannello sempre presente e animato */
.saw-acc-panel {
  display: block;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s cubic-bezier(0, 0, 0.2, 1) 0.08s;
  will-change: max-height, opacity;
}

/* apertura pannello */
.saw-acc-item.is-active .saw-acc-panel {
  max-height: var(--saw-open-h, 999px);
  opacity: 1;
}

/* requisito: l'item aperto prende la stessa altezza della descrizione */
.saw-acc-item.is-active .saw-acc-content {
  min-height: var(--saw-acc-h);
  overflow: auto;
}

/* (opzionale) rispettare preferenze accessibilità */
@media (prefers-reduced-motion: reduce) {
  .saw-acc-trigger,
  .saw-acc-panel {
    transition: none;
  }
}

.saw-acc-item {
  border-top: 3px solid rgba(90, 31, 43);
}
