/* ================================================================
   MATCHING SEATS WIDGETS — CSS unificato
   v2.0 — pulito, senza duplicati
================================================================ */

/* ════════════════════════════════════════════════════════════════
   DESTINAZIONI
════════════════════════════════════════════════════════════════ */

#ms-dest {
  --ms-active-size:   clamp(2rem, 4.5vw, 4rem);
  --ms-inactive-size: clamp(1.1rem, 2.4vw, 2.125rem);
  --ms-sub-size:      clamp(0.8rem, 1vw, 0.9rem);
  --ms-color-active:  #B51924;
  --ms-color-text:    #121212;
  --ms-color-divider: rgba(18,18,18,0.12);
  --ms-gap:           clamp(2rem, 5vw, 5rem);
  --ms-img-radius:    16px;
  --ms-transition:    0.35s ease;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ms-gap);
  align-items: center;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* ── Immagine ── */
.ms-dest__media {
  position: sticky;
  top: clamp(80px, 10vh, 120px);
}

.ms-dest__img-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--ms-img-radius);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #e8e4df;
}

#ms-dest .ms-dest__img-wrap {
  position: relative !important;
  width: 100% !important;
  height: 70vh !important;
  aspect-ratio: unset !important;
  overflow: hidden !important;
  border-radius: var(--ms-img-radius) !important;
  background: #e8e4df !important;
  display: block !important;
}

/* Slide: tutte assolute, fade in/out */
#ms-dest .ms-dest__slide {
  position: absolute !important;
  inset: 0 !important;
  opacity: 0 !important;
  transition: opacity 0.8s ease !important;
  display: none !important;
}

#ms-dest .ms-dest__slide.ms-dest__img--active {
  display: block !important;
  opacity: 1 !important;
}

#ms-dest .ms-dest__slide img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  max-width: none !important;
  max-height: none !important;
}

/* Overlay dentro ogni slide */
#ms-dest .ms-dest__slide .ms-dest__overlay {
  position: absolute !important;
  bottom: 24px !important;
  left: 24px !important;
  z-index: 2 !important;
  pointer-events: none !important;
}

/* ── Overlay ── */
.ms-dest__overlay {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 2;
  color: #fff;
  pointer-events: none;
}

.ms-dest__overlay-name {
  display: block;
  font-family: 'TT Commons Pro', 'TT Commons', sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0,0,0,0.45);
}

.ms-dest__overlay-coords {
  display: block;
  font-family: 'Raleway', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  opacity: 0.88;
  margin-top: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}

/* ── Lista ── */
.ms-dest__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ms-dest__item {
  border-top: 1px solid var(--ms-color-divider);
  padding: clamp(16px, 2.5vw, 28px) 0;
  cursor: pointer;
}

.ms-dest__item:last-child {
  border-bottom: 1px solid var(--ms-color-divider);
}

/* ── Row: titolo + icona sulla stessa riga ── */
.ms-dest__row {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  overflow: hidden;
}

/* ── Titolo ── */
.ms-dest__title {
  font-family: 'TT Commons Pro', 'TT Commons', sans-serif;
  font-size: var(--ms-inactive-size);
  font-weight: 500;
  color: var(--ms-color-text);
  line-height: 1.1;
  transition: font-size var(--ms-transition), font-weight var(--ms-transition), color var(--ms-transition);
  text-decoration: none;
  flex: 1 !important;
  min-width: 0 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.ms-dest__item--active .ms-dest__title {
  font-size: var(--ms-active-size);
  font-weight: 700;
  color: var(--ms-color-active);
  text-decoration: underline;
  text-decoration-color: var(--ms-color-active);
  text-underline-offset: 8px;
  text-decoration-thickness: 2px;
}

.ms-dest__item:not(.ms-dest__item--active):hover .ms-dest__title {
  color: #B51924;
  opacity: 0.7;
}

/* ── Icona/link ── */
.ms-dest__link-btn {
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none;
}

/* Nascondi icona mobile di default — visibile solo su mobile via media query */
.ms-dest__link-btn--mobile {
  display: none !important;
}

.ms-dest__link-btn img,
.ms-dest__link-icon {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  object-fit: contain !important;
  display: block !important;
}

/* ── Sottotitolo ── */
.ms-dest__sub {
  font-family: 'Raleway', sans-serif;
  font-size: var(--ms-sub-size);
  color: var(--ms-color-text);
  line-height: 1.55;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
}

.ms-dest__item--active .ms-dest__sub {
  max-height: 200px;
  opacity: 0.72;
  margin-top: 12px;
}

.ms-dest__item--active .ms-dest__link-btn--mobile .ms-dest__link-icon {
  filter: brightness(0) invert(1);
}

/* ── MOBILE ── */
@media (max-width: 900px) {

  /* Layout: colonna unica, l'immagine desktop sparisce */
  #ms-dest {
    grid-template-columns: 1fr;
    grid-template-areas: "list";
    gap: 0;
    --ms-active-size:   clamp(1.6rem, 6vw, 2.2rem);
    --ms-inactive-size: clamp(1.1rem, 4.5vw, 1.5rem);
  }

  /* Immagine desktop nascosta — ogni item ha la sua card */
  .ms-dest__media { display: none; }
  .ms-dest__list  { grid-area: list; }

  /* Ogni item diventa una card */
  .ms-dest__item {
    border: none;
    padding: 0;
    margin-bottom: 4px;
  }

  .ms-dest__item:last-child { border-bottom: none; }

  /* ── ITEM ATTIVO: card con immagine ── */
  .ms-dest__item--active {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    min-height: 260px;
  }

  /* Overlay scuro sulla card attiva */
  .ms-dest__item--active::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1;
    border-radius: 16px;
  }

  /* Immagine: iniettata come background inline dal JS */
  .ms-dest__item--active {
    background-size: cover !important;
    background-position: center !important;
  }

  /* Icona desktop nascosta su mobile */
  .ms-dest__item--active .ms-dest__link-btn--desktop {
    display: none !important;
  }

  /* Contenuto card attiva: in basso a sinistra */
  .ms-dest__item--active .ms-dest__row {
    position: relative;
    z-index: 2;
    padding: 20px 20px 0;
    align-items: flex-end;
  }

  /* Titolo bianco solo su mobile (sopra immagine) */
  #ms-dest .ms-dest__item--active .ms-dest__title {
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: var(--ms-active-size);
  }

  /* Icona mobile in basso a destra */
  .ms-dest__item--active .ms-dest__link-btn--mobile {
    position: absolute !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 3;
    display: flex !important;
  }

  .ms-dest__item--active .ms-dest__sub {
    position: relative;
    z-index: 2;
    color: #ffffff !important;
    opacity: 0.9 !important;
    max-height: 200px !important;
    margin: 8px 20px 20px !important;
    padding-bottom: 48px;
  }

  /* ── ITEM INATTIVO: solo riga testo ── */
  .ms-dest__item:not(.ms-dest__item--active) {
    border-top: 1px solid var(--ms-color-divider);
    padding: 16px 0;
    background: none;
    border-radius: 0;
    overflow: visible;
  }

  .ms-dest__item:not(.ms-dest__item--active) .ms-dest__row {
    padding: 0;
  }

  .ms-dest__item:not(.ms-dest__item--active) .ms-dest__sub {
    max-height: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
  }

  .ms-dest__item:last-child {
    border-bottom: 1px solid var(--ms-color-divider);
  }
}

/* ── TABLET ── */
@media (min-width: 769px) and (max-width: 1024px) {
  #ms-dest {
    --ms-active-size:   clamp(1.8rem, 3.5vw, 2.8rem);
    --ms-inactive-size: clamp(1rem, 2vw, 1.6rem);
    gap: 2.5rem;
  }
}

/* ════════════════════════════════════════════════════════════════
   ACCORDION — METODO
════════════════════════════════════════════════════════════════ */

#ms-acc {
  --acc-collapsed:  75px;
  --acc-expanded:   420px;
  --acc-radius:     16px;
  --acc-title-size: clamp(1.5rem, 3.3vw, 3rem);
  --acc-desc-size:  clamp(0.85rem, 1.1vw, 1rem);
  --acc-icon-size:  75px;
  --acc-gap:        2px;
  --acc-transition: cubic-bezier(0.16, 1, 0.3, 1);
  --acc-duration:   0.75s;
  --acc-color-text: #ffffff;
  --acc-gradient:   linear-gradient(to right,
                      rgba(0,0,0,0.68) 0%,
                      rgba(0,0,0,0.22) 55%,
                      rgba(0,0,0,0.06) 100%);

  display: flex;
  flex-direction: column;
  gap: var(--acc-gap);
  width: 100%;
  user-select: none;
}

.ms-acc__item {
  position: relative;
  height: var(--acc-collapsed);
  border-radius: 8px;
  border-top-right-radius: clamp(80px, 15vw, 280px);
  overflow: hidden;
  cursor: pointer;
  transition: height var(--acc-duration) var(--acc-transition);
  will-change: height;
}

.ms-acc__item--active {
  height: var(--acc-expanded);
}

.ms-acc__item + .ms-acc__item .ms-acc__header {
  border-top: 1px solid rgba(18,18,18,0.12);
}

.ms-acc__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #1a1a1a;
}

.ms-acc__bg-img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  transform: scale(1.06);
  transition: transform var(--acc-duration) var(--acc-transition);
  will-change: transform;
}

.ms-acc__item--active .ms-acc__bg-img {
  transform: scale(1);
}

.ms-acc__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--acc-gradient);
  z-index: 1;
}

.ms-acc__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: clamp(20px, 3vw, 40px);
  color: var(--acc-color-text);
}

.ms-acc__header {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  height: var(--acc-collapsed);
  padding: 0 clamp(16px, 3vw, 32px);
  flex-shrink: 0;
}

/* Numero / icona */
.ms-acc__icon {
  font-family: 'TT Commons Pro', 'TT Commons', sans-serif;
  font-size: var(--acc-title-size);
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
  display: inline !important;
  width: auto !important;
  height: auto !important;
  transition: color var(--acc-duration) var(--acc-transition),
              opacity var(--acc-duration) var(--acc-transition);
}

.ms-acc__item:not(.ms-acc__item--active) .ms-acc__icon {
  color: #121212;
  opacity: 0.38;
  filter: none;
}

.ms-acc__item--active .ms-acc__icon {
  color: #ffffff;
  opacity: 0.7;
  filter: none;
}

/* Titolo */
.ms-acc__title {
  font-family: 'TT Commons Pro', 'TT Commons', sans-serif;
  font-size: var(--acc-title-size);
  font-weight: 500;
  line-height: 1.05;
  transition: color var(--acc-duration) var(--acc-transition),
              opacity var(--acc-duration) var(--acc-transition);
}

.ms-acc__item:not(.ms-acc__item--active) .ms-acc__title {
  color: #121212;
  opacity: 0.38;
}

.ms-acc__item--active .ms-acc__title {
  color: #ffffff;
  opacity: 1;
}

/* Descrizione */
.ms-acc__desc {
  font-family: 'Raleway', sans-serif;
  font-size: var(--acc-desc-size);
  line-height: 1.6;
  color: var(--acc-color-text);
  max-width: 70%;
  padding: 0 clamp(16px, 3vw, 32px) 0;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}

/* Nascondi foto su item inattivi */
.ms-acc__item:not(.ms-acc__item--active) .ms-acc__bg {
  opacity: 0;
  transition: opacity var(--acc-duration) var(--acc-transition);
}

.ms-acc__item--active .ms-acc__bg {
  opacity: 1;
  transition: opacity var(--acc-duration) var(--acc-transition);
}

/* Sfondo neutro esplicito su item inattivi */
.ms-acc__item:not(.ms-acc__item--active) {
  background: transparent;
}

.ms-acc__item--active .ms-acc__desc {
  opacity: 0.85;
  transform: translateX(0);
  transition: opacity 0.3s ease 0.18s, transform 0.3s ease 0.18s;
  pointer-events: auto;
}

/* Scroll reveal */
.ms-acc__item {
  opacity: 0;
  transform: translateY(24px);
  transition:
    height    var(--acc-duration) var(--acc-transition),
    opacity   0.5s ease,
    transform 0.6s cubic-bezier(0.28, 0.32, 0.09, 1);
}

.ms-acc__item.ms-acc--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── TABLET ── */
@media (max-width: 1024px) {
  #ms-acc {
    --acc-expanded:  340px;
    --acc-collapsed: 70px;
  }
}

/* ── MOBILE ── */
@media (max-width: 767px) {
  #ms-acc {
    --acc-expanded:  280px;
    --acc-collapsed: 64px;
    --acc-gap:       3px;
  }

  .ms-acc__title {
    font-size: clamp(1.1rem, 5vw, 1.5rem) !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   COMPARISON TABLE
════════════════════════════════════════════════════════════════ */

#ms-cmp {
  --cmp-brand:       #B51924;
  --cmp-dark:        #091B20;
  --cmp-bg:          #F4F1EC;
  --cmp-divider:     rgba(9,27,32,0.1);
  --cmp-label-col:   rgba(9,27,32,0.5);
  --cmp-cell-size:   clamp(0.8rem, 1.05vw, 1rem);
  --cmp-header-size: clamp(0.85rem, 1.2vw, 1.1rem);
  --cmp-label-size:  clamp(0.6rem, 0.85vw, 0.7rem);
  --cmp-radius:      8px;
  --cmp-gap:         12px;
  --cmp-font:        'TT Commons Pro', 'TT Commons', sans-serif;
  --cmp-body:        'Raleway', sans-serif;
  width: 100%;
}

.ms-cmp__mobile  { display: none; }
.ms-cmp__desktop { display: block; }

.ms-cmp__grid {
  display: grid;
  grid-template-columns: minmax(100px, 0.85fr) 1.5fr 1.5fr 1.5fr;
  column-gap: var(--cmp-gap);
  row-gap: 0;
  align-items: stretch;
}

.ms-cmp__cell--empty { background: transparent; }

.ms-cmp__col-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  text-align: center;
  border-radius: var(--cmp-radius) var(--cmp-radius) 0 0;
}

.ms-cmp__col-header--dark { background: #091B20; }
.ms-cmp__col-header--mid  { background: #091B20; }

.ms-cmp__col-header--brand {
  background: var(--cmp-brand);
  flex-direction: row;
  justify-content: center;
  gap: 12px;
  text-align: left;
  padding: 20px 16px;
}

.ms-cmp__col-title {
  font-family: var(--cmp-font);
  font-size: var(--cmp-header-size);
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.ms-cmp__logo {
  width:  clamp(32px, 3.5vw, 48px) !important;
  height: clamp(32px, 3.5vw, 48px) !important;
  object-fit: contain !important;
  flex-shrink: 0;
  opacity: 0.9;
}

.ms-cmp__row-label {
  font-family: var(--cmp-font);
  font-size: var(--cmp-label-size);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cmp-label-col);
  padding: 0 12px;
  display: flex;
  align-items: center;
  background: transparent;
  line-height: 1.4;
  min-height: 88px;
  border-top: 1px solid var(--cmp-divider);
}

.ms-cmp__row-label:first-of-type { border-top: none; }

.ms-cmp__cell {
  font-family: var(--cmp-body);
  font-size: var(--cmp-cell-size);
  color: var(--cmp-dark);
  padding: 24px 16px;
  text-align: center;
  line-height: 1.5;
  background: var(--cmp-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  min-height: 88px;
  border-top: 1px solid var(--cmp-divider);
}

.ms-cmp__col-body--std .ms-cmp__cell:first-child { border-top: none; }

.ms-cmp__col-body {
  border-radius: 0 0 var(--cmp-radius) var(--cmp-radius);
  overflow: hidden;
  box-shadow: 0 1px 20px 0 rgba(0,0,0,0.1);
}

.ms-cmp__cell--brand {
  background: var(--cmp-bg);
  color: var(--cmp-dark);
  border-top: 1px solid var(--cmp-divider);
}

.ms-cmp__cell--brand:first-child { border-top: none; }

.ms-cmp__cell--brand strong {
  font-weight: 700;
  color: var(--cmp-dark);
  display: block;
}

.ms-cmp__cell--brand em {
  font-style: italic;
  font-weight: 500;
  color: var(--cmp-dark);
  font-size: 0.92em;
}

.ms-cmp__col-body--brand {
  border: 1px solid var(--cmp-brand);
  border-top: none;
  border-radius: 0 0 var(--cmp-radius) var(--cmp-radius);
  overflow: hidden;
  box-shadow: 0 1px 20px 0 rgba(181,25,36,0.1);
}

.ms-cmp__col-header--brand-wrap {
  border: 1px solid var(--cmp-brand);
  border-bottom: none;
  border-radius: var(--cmp-radius) var(--cmp-radius) 0 0;
  overflow: hidden;
}

.ms-cmp__footer {
  display: grid;
  grid-template-columns: minmax(100px, 0.85fr) 1.5fr 1.5fr 1.5fr;
  column-gap: var(--cmp-gap);
}

.ms-cmp__footer-spacer { grid-column: 1 / 4; }

.ms-cmp__footer-inner {
  background: var(--cmp-brand);
  color: #fff;
  font-family: var(--cmp-body);
  font-size: clamp(0.7rem, 0.95vw, 0.8rem);
  font-weight: 600;
  text-align: center;
  padding: 12px 16px;
  margin: 0 12px;
  border-radius: 0 0 var(--cmp-radius) var(--cmp-radius);
  border: 1px solid var(--cmp-brand);
  border-top: 1px solid rgba(255,255,255,0.2);
  line-height: 1.5;
}

.ms-cmp__footer-inner em { font-style: italic; font-weight: 500; }

/* ── MOBILE ── */
@media (max-width: 767px) {
  .ms-cmp__desktop { display: none; }
  .ms-cmp__mobile  { display: block; }

  .ms-cmp__tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }

  .ms-cmp__tab {
    font-family: var(--cmp-font);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--cmp-dark);
    background: transparent;
    border: 1.5px solid var(--cmp-divider);
    border-radius: 100px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
  }

  .ms-cmp__tab--brand { border-color: var(--cmp-brand); color: var(--cmp-brand); }
  .ms-cmp__tab--active { background: var(--cmp-brand); border-color: var(--cmp-brand); color: #fff; }

  .ms-cmp__panel {
    display: none;
    border-radius: var(--cmp-radius);
    overflow: hidden;
    box-shadow: 0 1px 20px 0 rgba(0,0,0,0.1);
  }

  .ms-cmp__panel--brand { border: 1px solid var(--cmp-brand); box-shadow: 0 1px 20px 0 rgba(181,25,36,0.1); }
  .ms-cmp__panel--active { display: block; }

  .ms-cmp__panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
  }

  .ms-cmp__panel-header--dark  { background: #091B20; }
  .ms-cmp__panel-header--mid   { background: #091B20; }
  .ms-cmp__panel-header--brand { background: var(--cmp-brand); }
  .ms-cmp__panel-header .ms-cmp__col-title { font-size: 1rem; }

  .ms-cmp__panel-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border-top: 1px solid var(--cmp-divider);
    background: var(--cmp-bg);
  }

  .ms-cmp__panel-label {
    font-family: var(--cmp-font);
    font-size: 0.62rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cmp-label-col);
  }

  .ms-cmp__panel-value {
    font-family: var(--cmp-body);
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--cmp-dark);
  }

  .ms-cmp__panel-value strong { font-weight: 700; }
  .ms-cmp__panel-value em     { font-style: italic; font-weight: 500; }

  .ms-cmp__panel-footer {
    background: var(--cmp-brand);
    color: #fff;
    font-family: var(--cmp-body);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.2);
  }

  .ms-cmp__panel-footer em { font-style: italic; font-weight: 500; }
}