/* Lego — lightbox galería (casi pantalla completa, marca CCO) */

.cco-gallery-modal,
.cco-gallery-modal.vr-gallery-modal {
  /* Encima del header (9999), menú móvil y WhatsApp flotante */
  z-index: 100100;
}

.cco-gallery-modal {
  padding: 0.35rem;
}

.cco-gallery-modal__backdrop {
  background: rgba(78, 11, 29, 0.9);
  backdrop-filter: blur(10px);
}

.cco-gallery-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: min(100%, calc(100vw - 0.7rem));
  max-width: 1440px;
  height: calc(100vh - 0.7rem);
  max-height: calc(100vh - 0.7rem);
  padding: 0.75rem 0.85rem 0.75rem;
  background: linear-gradient(135deg, var(--cco-vino) 0%, var(--cco-vino-dk) 48%, var(--cco-vino-xdk) 100%);
  border: 1px solid rgba(189, 176, 70, 0.28);
  border-radius: 16px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

.cco-gallery-modal__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(circle at 78% 42%, rgba(189, 176, 70, 0.14) 0%, transparent 52%);
  pointer-events: none;
}

.cco-gallery-modal__mark {
  position: absolute;
  right: -4%;
  top: 50%;
  z-index: 0;
  width: min(42vw, 420px);
  opacity: 0.1;
  transform: translateY(-50%);
  pointer-events: none;
}

.cco-gallery-modal__mark img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.cco-gallery-modal__panel > :not(.cco-gallery-modal__mark) {
  position: relative;
  z-index: 1;
}

.cco-gallery-modal__head {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  min-height: 2.5rem;
}

.cco-gallery-modal__title {
  margin: 0;
  text-align: left;
  font-family: var(--cco-font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cco-gold-lt);
  line-height: 1.35;
}

.cco-gallery-modal__title:empty {
  display: block;
  min-height: 1em;
}

/* Cerrar — siempre arriba a la derecha */
.cco-gallery-modal__close,
.cco-gallery-modal .vr-gallery-modal__close {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  color: var(--cco-gold-lt);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(189, 176, 70, 0.35);
  cursor: pointer;
  flex-shrink: 0;
}

.cco-gallery-modal__close svg {
  width: 1.15rem;
  height: 1.15rem;
}

.cco-gallery-modal__close:hover {
  background: var(--cco-gold);
  color: var(--cco-vino-xdk);
  border-color: var(--cco-gold);
}

.cco-gallery-modal__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cco-gallery-modal__viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
}

.cco-gallery-modal__stage {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(189, 176, 70, 0.18);
  border-radius: 12px;
  overflow: hidden;
}

.cco-gallery-modal__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  margin: 0 auto;
  opacity: 1;
  transition: opacity 0.22s ease;
}

.cco-gallery-modal__img.is-fading {
  opacity: 0;
}

/* Flechas izquierda / derecha — siempre visibles */
.cco-gallery-modal__arrow,
.cco-gallery-modal .vr-gallery-modal__arrow {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  z-index: 3;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(189, 176, 70, 0.4);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: var(--cco-gold-lt);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
}

.cco-gallery-modal__arrow svg {
  width: 1.25rem;
  height: 1.25rem;
}

.cco-gallery-modal__arrow:hover:not(:disabled) {
  background: var(--cco-gold);
  border-color: var(--cco-gold);
  color: var(--cco-vino-xdk);
  transform: none !important;
}

.cco-gallery-modal__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Pie de foto — debajo de la foto */
.cco-gallery-modal__caption {
  flex-shrink: 0;
  margin: 0;
  padding: 0.7rem 0.95rem;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  font-family: var(--cco-font-article);
  font-size: 0.875rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  color: var(--cco-vino);
}

.cco-gallery-modal__caption::before {
  content: none;
  display: none;
}

.cco-gallery-modal__caption:empty {
  display: none;
}

.cco-gallery-modal__footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(189, 176, 70, 0.18);
}

.cco-gallery-modal__counter {
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--cco-font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cco-gallery-modal__dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cco-gallery-modal__dot {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
}

.cco-gallery-modal__dot.is-active {
  background: var(--cco-gold);
  box-shadow: none;
  transform: scale(1.15);
}

@media (min-width: 768px) {
  .cco-gallery-modal__panel {
    padding: 0.9rem 1.15rem 0.9rem;
  }

  .cco-gallery-modal__arrow,
  .cco-gallery-modal .vr-gallery-modal__arrow {
    width: 3rem;
    height: 3rem;
  }
}

@media (max-width: 640px) {
  .cco-gallery-modal__panel {
    height: calc(100vh - 0.5rem);
    max-height: calc(100vh - 0.5rem);
    border-radius: 12px;
    padding: 0.65rem 0.65rem 0.7rem;
  }

  .cco-gallery-modal__mark {
    width: min(56vw, 280px);
    right: -8%;
    opacity: 0.08;
  }

  .cco-gallery-modal__viewport {
    gap: 0.35rem;
  }

  .cco-gallery-modal__arrow,
  .cco-gallery-modal .vr-gallery-modal__arrow {
    width: 2.35rem;
    height: 2.35rem;
  }

  .cco-gallery-modal__title {
    font-size: 0.6875rem;
  }

  .cco-gallery-modal__caption {
    font-size: 0.8125rem;
    padding: 0.6rem 0.75rem;
  }
}
