/* ===== IG Carousel Modal ===== */
.igc {
	--igc-per-view: 3;
	--igc-gap: 12px;
	--igc-ratio: 1 / 1;
	--igc-accent: #3897f0;
	position: relative;
	width: 100%;
	box-sizing: border-box;
}
.igc *, .igc *::before, .igc *::after { box-sizing: border-box; }

.igc-empty {
	padding: 32px;
	text-align: center;
	border: 2px dashed #c7c7cc;
	border-radius: 6px;
	color: #6b6b72;
}

/* ---------- Carrusel ---------- */
.igc-viewport { position: relative; }

.igc-track {
	display: flex;
	gap: var(--igc-gap);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scroll-behavior: smooth;
	cursor: grab;
}
.igc-track::-webkit-scrollbar { display: none; }
.igc-track.is-dragging {
	scroll-snap-type: none;
	scroll-behavior: auto;
	cursor: grabbing;
	user-select: none;
}

.igc-item {
	flex: 0 0 calc((100% - (var(--igc-per-view) - 1) * var(--igc-gap)) / var(--igc-per-view));
	aspect-ratio: var(--igc-ratio);
	position: relative;
	overflow: hidden;
	scroll-snap-align: start;
	background: #e9e9ec;
	border-radius: 4px;
}

.igc .igc-slide {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: inherit;
	background: transparent;
	cursor: zoom-in;
	display: block;
	overflow: hidden;
	-webkit-tap-highlight-color: transparent;
}
.igc .igc-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	-webkit-user-drag: none;
	user-select: none;
	transition: transform .35s ease;
}
.igc .igc-slide:hover img,
.igc .igc-slide:focus-visible img { transform: scale(1.04); }

.igc-hover-icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: rgba(0, 0, 0, .28);
	opacity: 0;
	transition: opacity .2s ease;
	pointer-events: none;
}
.igc .igc-slide:hover .igc-hover-icon,
.igc .igc-slide:focus-visible .igc-hover-icon { opacity: 1; }
.igc--no-hover-icon .igc-hover-icon { display: none; }

.igc .igc-slide:focus-visible,
.igc-modal button:focus-visible {
	outline: 3px solid var(--igc-accent);
	outline-offset: -3px;
}

/* ---------- Flechas ---------- */
.igc .igc-arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: rgba(255, 255, 255, .92);
	color: #262626;
	box-shadow: 0 1px 6px rgba(0, 0, 0, .3);
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity .2s ease, background-color .2s ease;
}
.igc .igc-arrow:hover { background-color: #fff; }
.igc .igc-arrow--prev { left: 8px; }
.igc .igc-arrow--next { right: 8px; }
.igc .igc-arrow[disabled] { opacity: 0; pointer-events: none; }
.igc--no-arrows .igc-arrow,
.igc.is-static .igc-arrow { display: none; }

/* ---------- Puntos ---------- */
.igc-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 5px;
	padding-top: 12px;
	min-height: 24px;
}
.igc .igc-dot {
	width: 6px;
	height: 6px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: #c7c7cc;
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
}
.igc .igc-dot.is-active {
	background-color: var(--igc-accent);
	transform: scale(1.2);
}
.igc--no-dots .igc-dots,
.igc.is-static .igc-dots { display: none; }

@media (hover: none) {
	.igc .igc-arrow { display: none; }
}

/* ---------- Ventana modal ---------- */
html.igc-no-scroll { overflow: hidden; }

.igc-modal {
	--igc-overlay: rgba(0, 0, 0, .92);
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	flex-direction: column;
	color: #fff;
	background: var(--igc-overlay);
	-webkit-tap-highlight-color: transparent;
}
.igc-modal.is-open {
	display: flex;
	animation: igc-fade .2s ease;
}
@keyframes igc-fade { from { opacity: 0; } to { opacity: 1; } }

.igc-modal button {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.igc-modal__bar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 56px;
	padding: 8px 12px 8px 20px;
}
.igc-modal__counter { font-size: 14px; font-variant-numeric: tabular-nums; opacity: .85; }
.igc-modal .igc-modal__close {
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background-color .15s ease;
}
.igc-modal .igc-modal__close:hover { background: rgba(255, 255, 255, .15); }

.igc-modal__stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 64px;
	touch-action: pan-y;
}
.igc-modal__img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	opacity: 0;
	transition: opacity .2s ease;
	user-select: none;
	-webkit-user-drag: none;
}
.igc-modal__img.is-ready { opacity: 1; }

.igc-modal__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 36px;
	height: 36px;
	margin: -18px 0 0 -18px;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: #fff;
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
}
.igc-modal__stage.is-loading .igc-modal__spinner {
	opacity: 1;
	animation: igc-spin .8s linear infinite;
}
@keyframes igc-spin { to { transform: rotate(360deg); } }

.igc-modal .igc-modal__nav {
	position: absolute;
	top: 50%;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	transform: translateY(-50%);
	transition: background-color .15s ease, opacity .15s ease;
}
.igc-modal .igc-modal__nav:hover { background: rgba(255, 255, 255, .28); }
.igc-modal .igc-modal__nav--prev { left: 10px; }
.igc-modal .igc-modal__nav--next { right: 10px; }
.igc-modal .igc-modal__nav[disabled] { opacity: .25; cursor: default; }

.igc-modal__caption {
	flex: 0 0 auto;
	max-width: 720px;
	margin: 0 auto;
	padding: 12px 20px 0;
	text-align: center;
	font-size: 15px;
	line-height: 1.5;
}
.igc-modal__caption:empty { display: none; }

.igc-modal__thumbs {
	flex: 0 0 auto;
	display: flex;
	gap: 8px;
	justify-content: safe center;
	overflow-x: auto;
	padding: 14px 16px 16px;
	scrollbar-width: thin;
}
.igc-modal .igc-modal__thumb {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	border-radius: 4px;
	overflow: hidden;
	opacity: .5;
	outline: 2px solid transparent;
	outline-offset: -2px;
	transition: opacity .15s ease;
}
.igc-modal .igc-modal__thumb:hover { opacity: .85; }
.igc-modal .igc-modal__thumb.is-active { opacity: 1; outline-color: #fff; }
.igc-modal .igc-modal__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 640px) {
	.igc-modal__stage { padding: 0 8px; }
	.igc-modal .igc-modal__nav { width: 38px; height: 38px; background: rgba(0, 0, 0, .45); }
	.igc-modal .igc-modal__nav--prev { left: 6px; }
	.igc-modal .igc-modal__nav--next { right: 6px; }
	.igc-modal .igc-modal__thumb { width: 46px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
	.igc-track { scroll-behavior: auto; }
	.igc .igc-slide img, .igc-modal__img { transition: none; }
	.igc-modal.is-open { animation: none; }
}
