/* ─────────────────────────────────────────
   MODAL
───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: hsl(var(--background) / 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  position: relative;
}

.modal-header {
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-desc {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius);
  line-height: 1;
  font-size: 1.125rem;
  transition: color 0.15s, background 0.15s;
}
.modal-close:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--accent));
}

.modal-form { display: flex; flex-direction: column; gap: 0.75rem; }

.file-input-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s;
  text-align: center;
}
.file-input-wrap:hover { border-color: hsl(var(--foreground) / 0.4); }

.file-input-wrap label {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}

.file-input-wrap label span {
  color: hsl(var(--foreground));
  font-weight: 500;
}

.file-input-wrap input[type="file"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

/* ─────────────────────────────────────────
   GALERÍA — MINIMAL
───────────────────────────────────────── */
.modal-overlay--gallery {
  background: hsl(var(--background) / 0.97);
  backdrop-filter: blur(12px);
  padding: 2rem 1.5rem;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

.gallery-shell {
  position: relative;
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.gallery-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 101;
  background: none;
  border: none;
  padding: 0;
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: color 0.2s;
}

.gallery-close:hover {
  color: hsl(var(--foreground));
}

.scouting-galeria-swiper {
  width: 100%;
  --swiper-navigation-size: 1rem;
  --swiper-theme-color: hsl(var(--foreground));
}

.scouting-galeria-swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(75vh, 640px);
}

.scouting-galeria-swiper .swiper-slide img {
  display: block;
  max-width: 100%;
  max-height: min(75vh, 640px);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.scouting-galeria-swiper .swiper-button-prev,
.scouting-galeria-swiper .swiper-button-next {
  width: auto;
  height: auto;
  margin-top: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  box-shadow: none;
  color: hsl(var(--muted-foreground));
  opacity: 0.35;
  transition: opacity 0.2s;
}

.scouting-galeria-swiper .swiper-button-prev:hover,
.scouting-galeria-swiper .swiper-button-next:hover {
  opacity: 1;
  transform: translateY(-50%);
}

.scouting-galeria-swiper .swiper-button-prev::after,
.scouting-galeria-swiper .swiper-button-next::after {
  font-size: 1.125rem;
  font-weight: 300;
}

.scouting-galeria-swiper .swiper-button-disabled {
  opacity: 0;
  pointer-events: none;
}

.gallery-index {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .modal-overlay--gallery {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  .gallery-shell {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    min-height: 100svh;
    gap: 0;
    justify-content: space-between;
    padding:
      calc(0.5rem + env(safe-area-inset-top, 0px))
      calc(0.5rem + env(safe-area-inset-right, 0px))
      calc(0.75rem + env(safe-area-inset-bottom, 0px))
      calc(0.5rem + env(safe-area-inset-left, 0px));
    box-sizing: border-box;
  }

  .gallery-close {
    top: calc(0.625rem + env(safe-area-inset-top, 0px));
    right: calc(0.625rem + env(safe-area-inset-right, 0px));
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.625rem;
  }

  .scouting-galeria-swiper {
    flex: 1;
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
  }

  .scouting-galeria-swiper .swiper-wrapper {
    align-items: center;
  }

  .scouting-galeria-swiper .swiper-slide {
    min-height: 0;
    height: auto;
    padding: 2.75rem 0 0.5rem;
    box-sizing: border-box;
  }

  .scouting-galeria-swiper .swiper-slide img {
    max-width: 100%;
    max-height: calc(
      100dvh
      - env(safe-area-inset-top, 0px)
      - env(safe-area-inset-bottom, 0px)
      - 4.75rem
    );
    max-height: calc(
      100svh
      - env(safe-area-inset-top, 0px)
      - env(safe-area-inset-bottom, 0px)
      - 4.75rem
    );
    width: auto;
    margin: 0 auto;
  }

  .scouting-galeria-swiper .swiper-button-prev,
  .scouting-galeria-swiper .swiper-button-next {
    display: none;
  }

  .gallery-index {
    flex-shrink: 0;
    padding-top: 0.625rem;
    text-align: center;
  }
}

@media (max-width: 768px) and (hover: hover) and (pointer: fine) {
  .scouting-galeria-swiper .swiper-button-prev,
  .scouting-galeria-swiper .swiper-button-next {
    display: flex;
  }

  .scouting-galeria-swiper .swiper-button-prev {
    left: 0.25rem;
  }

  .scouting-galeria-swiper .swiper-button-next {
    right: 0.25rem;
  }
}
