/* =========================================================
 * Maradigma Boat Gallery (slider sizing fix + grid + native lightbox)
 * ========================================================= */

.maradigma-boat-gallery{
  --swiper-theme-color: rgba(0,0,0,.85);

  /* Gallery sizing vars (can be overridden inline from shortcode/widget) */
  --md-gallery-gap: 10px;
  --md-gallery-radius: 10px;
  --md-gallery-cols: 3;

  /* ✅ ratio stable (you can override with: style="--md-gallery-ratio: 4 / 3;" ) */
  --md-gallery-ratio: 16 / 9;
}

/* =========================================================
 * GRID (same sizing contract)
 * ========================================================= */

.maradigma-boat-gallery--grid{
  display: grid;
  gap: var(--md-gallery-gap, 10px);
  grid-template-columns: repeat(var(--md-gallery-cols, 3), minmax(0, 1fr));
}

@media (max-width: 768px){
  .maradigma-boat-gallery--grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px){
  .maradigma-boat-gallery--grid{
    grid-template-columns: 1fr;
  }
}

.maradigma-boat-gallery--grid .maradigma-boat-gallery__item{
  margin: 0;
  overflow: hidden;
  border-radius: var(--md-gallery-radius, 10px);
  aspect-ratio: var(--md-gallery-ratio, 16 / 9);
}

.maradigma-boat-gallery--grid .maradigma-boat-gallery__item > a{
  display: block;
  width: 100%;
  height: 100%;
}

/* =========================================================
 * SLIDER (Swiper sizing fix)
 * ========================================================= */

/* 1) The viewport defines height by ratio */
.maradigma-boat-gallery--slider .maradigma-swiper{
  width: 100%;
  aspect-ratio: var(--md-gallery-ratio, 16 / 9);
  overflow: hidden;
}

/* 2) Swiper elements fill the viewport height */
.maradigma-boat-gallery--slider .swiper,
.maradigma-boat-gallery--slider .swiper-wrapper,
.maradigma-boat-gallery--slider .swiper-slide{
  height: 100%;
}

/* 3) Stretch slide content */
.maradigma-boat-gallery--slider .swiper-slide{
  display: flex;
  align-items: stretch;
}

/* 4) Anchor fills slide */
.maradigma-boat-gallery--slider .swiper-slide > a{
  display: block;
  width: 100%;
  height: 100%;
}

/* =========================================================
 * IMG (common) - stable cover + full height
 * ========================================================= */

.maradigma-boat-gallery__img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover; /* 🔥 KEY */
  border-radius: var(--md-gallery-radius, 10px);
}

/* If any theme forces img auto height, enforce it inside slider/grid */
.maradigma-boat-gallery--grid .maradigma-boat-gallery__img,
.maradigma-boat-gallery--slider .maradigma-boat-gallery__img{
  height: 100% !important;
}

/* Optional: reduce “weird” spacing from figure defaults */
.maradigma-boat-gallery__item{
  margin: 0;
}

/* =========================================================
 * Swiper arrows/dots (optional cosmetics)
 * ========================================================= */

.maradigma-boat-gallery--slider .swiper-button-prev,
.maradigma-boat-gallery--slider .swiper-button-next{
  color: var(--swiper-theme-color);
}

.maradigma-boat-gallery--slider .swiper-pagination-bullet{
  background: var(--swiper-theme-color);
  opacity: .35;
}

.maradigma-boat-gallery--slider .swiper-pagination-bullet-active{
  opacity: 1;
}

/* =========================================================
 * Native Lightbox (Maradigma) - works without Elementor
 * (JS adds: .md-lightbox--open)
 * ========================================================= */

.md-lightbox{
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
}

.md-lightbox--open{
  display: block;
}

.md-lightbox__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.85);
}

.md-lightbox__panel{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.md-lightbox__img{
  max-width: min(1200px, 92vw);
  max-height: 86vh;
  border-radius: 10px;
  display: block;
}

.md-lightbox__btn{
  position: absolute;
  top: 16px;
  background: rgba(0,0,0,.35);
  border: 0;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 26px;
  line-height: 40px;
  text-align: center;
}

.md-lightbox__btn--close{ right: 16px; }
.md-lightbox__btn--prev{ left: 16px; top: 50%; transform: translateY(-50%); }
.md-lightbox__btn--next{ right: 16px; top: 50%; transform: translateY(-50%); }

.md-lightbox__counter{
  position: absolute;
  left: 16px;
  top: 16px;
  color: rgba(255,255,255,.9);
  font-size: 13px;
  background: rgba(0,0,0,.35);
  padding: 6px 10px;
  border-radius: 999px;
}

/* =========================================================
 * Maradigma Boat Specs
 * ========================================================= */

.maradigma-boat-specs{
  width: 100%;
}

.maradigma-boat-specs__dl{
  margin: 0;
  padding: 0;
}

.maradigma-boat-specs__row{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.maradigma-boat-specs__row:last-child{
  border-bottom: 0;
}

.maradigma-boat-specs__icon{
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  margin-top: 2px;
  color: rgba(0,0,0,.65);
}

.maradigma-boat-specs__icon--empty{
  opacity: 0;
}

.maradigma-boat-specs__svg{
  width: 16px;
  height: 16px;
  display: block;
}

.maradigma-boat-specs__content{
  min-width: 0;
  flex: 1;
}

.maradigma-boat-specs__dt{
  margin: 0;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  color: rgba(0,0,0,.75);
}

.maradigma-boat-specs__dd{
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  color: rgba(0,0,0,.9);
}

/* When labels are hidden, keep spacing nice */
.maradigma-boat-specs--no-icons .maradigma-boat-specs__row{
  gap: 0;
}

/* =========================================================
 * Layout: two_cols
 * ========================================================= */

.maradigma-boat-specs--two_cols .maradigma-boat-specs__dl{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}

.maradigma-boat-specs--two_cols .maradigma-boat-specs__row{
  border-bottom: 1px solid rgba(0,0,0,.08);
  padding: 10px 0;
}

@media (max-width: 768px){
  .maradigma-boat-specs--two_cols .maradigma-boat-specs__dl{
    grid-template-columns: 1fr;
  }
}

/* =========================================================
 * Layout: list
 * ========================================================= */

.maradigma-boat-specs--list .maradigma-boat-specs__dl{
  display: block;
}

.maradigma-boat-specs--list .maradigma-boat-specs__row{
  display: flex;
}

/* Optional: list style where label and value are inline */
.maradigma-boat-specs--list .maradigma-boat-specs__dt{
  display: inline;
}

.maradigma-boat-specs--list .maradigma-boat-specs__dd{
  display: inline;
}

.maradigma-boat-specs--list .maradigma-boat-specs__dd:before{
  content: " ";
}

/* =========================================================
 * EQUIPAMIENTOS
 * ========================================================= */
.maradigma-boat-equipments{
  /* Blindaje por si el theme/Elementor mete text-align:center */
  text-align: left;
}

.maradigma-boat-equipments__list{
  list-style: none;
  margin: 0;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 20px;
}

@media (max-width: 1024px){
  .maradigma-boat-equipments__list{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px){
  .maradigma-boat-equipments__list{ grid-template-columns: 1fr; }
}

.maradigma-boat-equipments__item{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;

  /* ✅ FIX: necesario en grid/flex para que el texto se “encaje” */
  min-width: 0;
}

/* icono configurable (si lo activas) */
.maradigma-boat-equipments__icon{
  line-height: 1.2;
  flex: 0 0 auto;
}

/* label */
.maradigma-boat-equipments__label{
  flex: 1 1 auto;

  /* ✅ FIX: evita que herede centrado y permite wrap correcto */
  min-width: 0;
  text-align: left;
  line-height: 1.25;

  /* ✅ FIX: palabras largas (alemán, etc.) */
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

/* =========================================================
 * INCLUIDOS
 * ========================================================= */
.maradigma-boat-included{
  /* Blindaje por si el theme/Elementor mete text-align:center */
  text-align: left;
}

.maradigma-boat-included__list{
  list-style: none;
  margin: 0;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 20px;
}

@media (max-width: 1024px){
  .maradigma-boat-included__list{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px){
  .maradigma-boat-included__list{ grid-template-columns: 1fr; }
}

.maradigma-boat-included__item{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;

  /* ✅ FIX */
  min-width: 0;
}

.maradigma-boat-included__tick{
  line-height: 1.2;
  flex: 0 0 auto;
}

.maradigma-boat-included__label{
  flex: 1 1 auto;

  /* ✅ FIX */
  min-width: 0;
  text-align: left;
  line-height: 1.25;

  /* ✅ FIX palabras largas */
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

/* =========================================================
 * NO INCLUIDOS
 * ========================================================= */
.maradigma-boat-not-included{
  /* Blindaje por si el theme/Elementor mete text-align:center */
  text-align: left;
}

.maradigma-boat-not-included__list{
  list-style: none;
  margin: 0;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 20px;
}

@media (max-width: 1024px){
  .maradigma-boat-not-included__list{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px){
  .maradigma-boat-not-included__list{
    grid-template-columns: 1fr;
  }
}

.maradigma-boat-not-included__item{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;

  /* ✅ FIX */
  min-width: 0;
}

.maradigma-boat-not-included__cross{
  line-height: 1.2;
  flex: 0 0 auto;
}

.maradigma-boat-not-included__label{
  flex: 1 1 auto;

  /* ✅ FIX */
  min-width: 0;
  text-align: left;
  line-height: 1.25;

  /* ✅ FIX palabras largas */
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

/* =========================================================
 * PRICES (BoatPriceWidget)
 * - layout="blocks" => fila horizontal con wrap si no cabe
 * ========================================================= */

/* Wrapper principal (por si hereda centrado) */
.maradigma-boat-prices{
  text-align: left;
}

/* Contenedor de bloques */
.maradigma-boat-prices__blocks{
  display: flex;
  flex-wrap: wrap; /* ✅ misma línea si cabe, baja si no */
  gap: var(--maradigma-prices-gap, 8px);
  align-items: stretch;
}

/* Bloque individual */
.maradigma-boat-prices__block{
  flex: 1 1 140px;   /* ✅ base ~140px, crece/encoge según espacio */
  min-width: 120px;  /* ✅ evita que se aplaste */
  max-width: 220px;  /* opcional: evita que se haga enorme */

  text-align: center;

  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 8px;
  background: #fff;

  /* ✅ FIX en flex/grid para que el texto no rompa layouts raros */
  min-width: 0;
}

/* Título de temporada (MAY/JUNE o rango) */
.maradigma-boat-prices__block .maradigma-boat-prices__season{
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
  opacity: .75;
}

/* Precio */
.maradigma-boat-prices__block .maradigma-boat-prices__value{
  display: inline-block;
  font-weight: 800;
  font-size: 16px;
  white-space: nowrap; /* ✅ no partir “1500,00 €” */
}

/* VAT */
.maradigma-boat-prices__block .maradigma-boat-prices__vat{
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  opacity: .7;
}

/* Opcional: en móvil, mejor fila única con scroll horizontal */
@media (max-width: 575.98px){
  .maradigma-boat-prices__blocks{
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .maradigma-boat-prices__block{
    flex: 0 0 180px; /* ancho fijo para scroll */
    max-width: none;
  }
}