/* Evita que la página de fondo se desplace mientras el modal está visible.     */
body.modal-open {
  overflow: hidden !important;
  padding-right: var(--modal-scrollbar-width, 0px);
  position: fixed;
  width: 100%;
  top: var(--scroll-position, 0);
}

html.modal-open {
  overflow: hidden !important;
}

/* ── Capa exterior (solo fondo, sin scroll) ────────────────────────────────── */
.custom-modal-fullScreen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(255, 255, 255, 0.96);
  overflow: hidden;
}

.custom-modal-fullScreen.active {
  display: flex;
  flex-direction: column;
}

/* ── Zona de scroll (capa interior) ───────────────────────────────────────── */
.modal-scroll-area {
  position: relative;
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  width: 100%;
  outline: none;
  touch-action: pan-y;
}

/* ── Contenido interior ────────────────────────────────────────────────────── */
.custom-modal-fullScreen-content {
  width: 100%;
  max-width: 100vw;
  margin: 0 auto;
  padding: 80px 20px 30px;
  box-sizing: border-box;
}

#modal-fullScreen-content-inner {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* ── Estado de carga ───────────────────────────────────────────────────────── */
.modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  font-size: 18px;
  color: #555;
}

/* ── Estado de error ───────────────────────────────────────────────────────── */
.modal-error {
  padding: 80px 20px;
  text-align: center;
  color: #c0392b;
  font-size: 16px;
}

/* ── Overrides de componentes Nectar dentro del modal ──────────────────────── */
#modal-fullScreen-content-inner
  .nectar-split-heading[data-animation-type="line-reveal-by-space"]:not(
    .markup-generated
  ) {
  opacity: 1;
  font-size: 44px;
  letter-spacing: -1.32px;
  line-height: 1;
  text-align: center;
}

/* ── Toggle panels ─────────────────────────────────────────────────────────── */
#modal-fullScreen-content-inner .toggle .inner_content,
#modal-fullScreen-content-inner .nectar-toggle .inner_content {
  display: none;
}
#modal-fullScreen-content-inner .toggle.active .inner_content,
#modal-fullScreen-content-inner .nectar-toggle.active .inner_content {
  display: block;
}

#modal-fullScreen-content-inner .toggles .toggle h3.toggle-title ~ div {
  max-height: 0;
  overflow: hidden;
}

/* Carousel / slider */
#modal-fullScreen-content-inner .custom-slider-products-card img {
  height: 370px;
  max-width: 518px;
  width: 100%;
  min-width: 300px;
  object-fit: cover;
  object-position: center;
}

#modal-fullScreen-content-inner
  .nectar-flickity.nectar-carousel[data-format="default"]
  .flickity-slider
  .cell {
  padding: 0;
}

#modal-fullScreen-content-inner .flickity-viewport {
  width: 100% !important;
}

#modal-fullScreen-content-inner .vc_row-inner.full-width-content,
#modal-fullScreen-content-inner .row-column-wrap.full-width-content {
  width: 100% !important;
  left: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
}

#modal-fullScreen-content-inner .flickity-viewport {
  overflow: hidden;
  width: 100% !important;
  margin-top: 80px
}

/* --- Desktop (3 completas) --- */
@media only screen and (min-width: 1001px) {
  #modal-fullScreen-content-inner .nectar-flickity .cell {
    width: 28% !important; /* Aproximadamente 3.5 cards visibles */
    margin-right: 20px !important;
  }
}

/* --- Tablet (2 completas + 2 fragmentos) --- */
@media only screen and (max-width: 1000px) and (min-width: 691px) {
  #modal-fullScreen-content-inner .nectar-flickity .cell {
    width: 40% !important; /* Aproximadamente 2.5 cards visibles */
    margin-right: 15px !important;
  }
}

/* --- Mobile--- */
@media only screen and (max-width: 690px) {
  #modal-fullScreen-content-inner .nectar-flickity .cell {
    width: 100% !important;
  }
	
  #modal-fullScreen-content-inner .flickity-viewport {
    margin-top: 40px !important;
  }
}

#modal-fullScreen-content-inner .vc_row-inner.full-width-content,
#modal-fullScreen-content-inner .row-column-wrap.full-width-content {
  left: 0 !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#modal-fullScreen-content-inner .toggles .toggle.open {
  background-color: var(--c-white);
}

#modal-fullScreen-content-inner .toggles .toggle .toggle-title i {
  border-color: #000;
}

#modal-fullScreen-content-inner .toggles .toggle .toggle-title i::after,
#modal-fullScreen-content-inner .toggles .toggle .toggle-title i::before {
  background-color: #000;
}

#portfolio-extra {
  max-width: 800px;
}

/* ── Pagination Dots (Bullets) ────────────────────────────────────────── */
#modal-fullScreen-content-inner .nectar-flickity .flickity-page-dots {
  display: flex !important;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  padding: 0;
  list-style: none;
}

#modal-fullScreen-content-inner
  .nectar-flickity
  .flickity-page-dots:nth-of-type(n + 2) {
  display: none !important;
}

#modal-fullScreen-content-inner .nectar-flickity .flickity-page-dots .dot {
  width: 12px;
  height: 12px;
  margin: 0 6px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  outline: none;
}

#modal-fullScreen-content-inner
  .nectar-flickity
  .flickity-page-dots
  .dot.is-selected {
  background-color: #000;
  transform: scale(1.2);
}

#modal-fullScreen-content-inner
  .nectar-flickity
  .flickity-page-dots
  .dot:hover {
  background-color: rgba(0, 0, 0, 0.6);
}

#modal-fullScreen-content-inner
  .nectar-flickity[data-controls="pagination"]
  .flickity-button,
#modal-fullScreen-content-inner
  .nectar-flickity[data-control-style*="pagination"]
  .flickity-button {
  display: none !important;
}

#modal-fullScreen-content-inner .flickity-page-dots {
  position: relative !important;
  margin-block: 44px !important;
  bottom: auto !important;
}

#modal-fullScreen-content-inner .flickity-page-dots .dot {
  background-color: transparent !important;
  border: none !important;
  background-color: transparent !important;
  border: 1px solid #000 !important;
}

#modal-fullScreen-content-inner .flickity-page-dots .dot {
  box-shadow: inset 0px 0px 0px 5px #000000 !important;
  opacity: 0.35 !important;
}

#modal-fullScreen-content-inner .flickity-page-dots .dot.is-selected {
  background-color: transparent !important;
  border: 1px solid #000 !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

#modal-fullScreen-content-inner .flickity-page-dots .dot::before {
  content: none !important;
}

/* ── Botón de cierre (X) ───────────────────────────────────────────────── */
.modal-close-button {
  position: fixed;
  top: 40px;
  right: 40px;
  z-index: 100000;
  width: 44px;
  height: 44px;
  background-color: transparent !important;
  border: none !important;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-close-button:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
}

.modal-close-button:active {
  transform: scale(0.95);
}

.modal-close-button svg {
  width: 20px;
  height: 20px;
  color: #000;
  transition: color 0.3s ease;
}

.modal-close-button:hover svg {
  color: #000;
}

.custom-toggle {
  display: flex;
  justify-content: center;
}

.custom-toggle .toggle-title a {
  font-size: 24px !important;
  color: #000 !important;
}

.custom-toggle .toggle-title {
  text-align: left !important;
}

@media only screen and (max-width: 768px) {
  .modal-close-button {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
  }

  .modal-close-button svg {
    width: 18px;
    height: 18px;
  }
}
