/* Tees Island Revamp – product page: gallery carousel, swatches, lightbox. Loaded on product pages only. */

/* ---------- Gallery ---------- */
.tir-gallery { position: relative; margin-bottom: 24px; min-width: 0; }
.tir-g-main {
	position: relative; overflow: hidden;
	border-radius: var(--tir-r-card, 16px); background: #fff;
	border: 1px solid var(--tir-line, #E6E8EC);
}
.tir-g-track {
	display: flex; overflow-x: auto; overflow-y: hidden;
	scroll-snap-type: x mandatory; scroll-behavior: auto;
	scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior-x: contain;
	outline: none;
}
.tir-g-track::-webkit-scrollbar { display: none; }
.tir-g-track:focus-visible { box-shadow: inset 0 0 0 2px var(--tir-accent, #0E6EDC); }
.tir-g-slide {
	flex: 0 0 100%; margin: 0; aspect-ratio: 4 / 5;
	scroll-snap-align: start; scroll-snap-stop: always;
	display: flex; align-items: center; justify-content: center;
}
.tir-g-slide[hidden] { display: none; }
.tir-g-zoom { display: block; width: 100%; height: 100%; cursor: zoom-in; }
body.tir-on .tir-g-slide .tir-g-img {
	width: 100%; height: 100%; object-fit: contain; display: block;
	border-radius: 0 !important; margin: 0 !important;
}

.tir-g-nav {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
	width: 44px; height: 44px; padding: 0; border-radius: 50%;
	display: grid; place-items: center;
	background: #fff; color: var(--tir-ink, #0A0A0A); border: 1px solid var(--tir-line, #E6E8EC);
	box-shadow: 0 8px 20px -10px rgba(0,0,0,.35); cursor: pointer;
	transition: opacity .2s ease, background-color .2s ease, color .2s ease;
}
.tir-g-nav:hover { background: var(--tir-ink, #0A0A0A); color: #fff; border-color: var(--tir-ink, #0A0A0A); }
.tir-g-nav:disabled { opacity: 0; pointer-events: none; }
.tir-g-prev { left: 14px; }
.tir-g-next { right: 14px; }
.tir-g-count {
	position: absolute; left: 14px; bottom: 14px; z-index: 2;
	padding: 6px 12px; border-radius: 999px;
	background: rgba(10,10,10,.72); color: #fff; font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
	pointer-events: none;
}
.tir-gallery.is-single .tir-g-nav,
.tir-gallery.is-single .tir-g-count,
.tir-gallery.is-single .tir-g-thumbs { display: none; }

.tir-g-thumbs {
	display: flex; gap: 10px; margin-top: 12px; padding: 2px;
	overflow-x: auto; scrollbar-width: none;
}
.tir-g-thumbs::-webkit-scrollbar { display: none; }
.tir-g-thumb {
	flex: 0 0 76px; width: 76px; height: 76px; padding: 0;
	border: 2px solid transparent; border-radius: var(--tir-r-sm, 12px);
	background: #fff; overflow: hidden; cursor: pointer;
	box-shadow: inset 0 0 0 1px var(--tir-line, #E6E8EC);
	opacity: .65; transition: opacity .2s ease, border-color .2s ease;
}
.tir-g-thumb[hidden] { display: none; }
.tir-g-thumb:hover { opacity: 1; }
.tir-g-thumb.is-active { opacity: 1; border-color: var(--tir-ink, #0A0A0A); }
body.tir-on .tir-g-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0 !important; }

/* Before the script runs: show the default two images only (no jump) */
.tir-gallery:not(.is-ready) .tir-g-thumb:nth-child(n+3),
.tir-gallery:not(.is-ready) .tir-g-count { visibility: hidden; }

/* ---------- Swatches ---------- */
.tir-sw-wrap select { display: none !important; }
.tir-sw-group { display: flex; flex-wrap: wrap; gap: 10px; margin: 2px 0 4px; }
.tir-sw {
	position: relative; margin: 0; cursor: pointer;
	font-family: var(--tir-font, Poppins, sans-serif);
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease, opacity .15s ease;
}
.tir-sw:focus-visible { outline: 2px solid var(--tir-accent, #0E6EDC); outline-offset: 3px; }

/* Colour boxes */
.tir-sw-color {
	width: 44px; height: 44px; padding: 4px;
	border: 1px solid var(--tir-line-2, #D5D9DF); border-radius: var(--tir-r-sm, 12px);
	background: #fff;
}
.tir-sw-chip { display: block; width: 100%; height: 100%; border-radius: 8px; background: var(--sw, #ccc); }
.tir-sw-color.is-light .tir-sw-chip { box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }
.tir-sw-color:hover { border-color: var(--tir-ink, #0A0A0A); }
.tir-sw-color.is-selected { border-color: var(--tir-ink, #0A0A0A); box-shadow: 0 0 0 1px var(--tir-ink, #0A0A0A); }
.tir-sw-color.no-hex { width: auto; padding: 0 14px; }
.tir-sw-color.no-hex .tir-sw-chip { display: none; }
.tir-sw-name { font-size: 14px; font-weight: 600; color: var(--tir-ink, #0A0A0A); }

/* Size / text boxes */
.tir-sw-text {
	min-width: 54px; height: 44px; padding: 0 14px;
	border: 1px solid var(--tir-line-2, #D5D9DF); border-radius: var(--tir-r-sm, 12px);
	background: #fff; color: var(--tir-ink, #0A0A0A);
	font-size: 14px; font-weight: 600; letter-spacing: .02em; line-height: 1;
}
.tir-sw-text:hover { border-color: var(--tir-ink, #0A0A0A); }
.tir-sw-text.is-selected { background: var(--tir-ink, #0A0A0A); border-color: var(--tir-ink, #0A0A0A); color: #fff; }

/* Unavailable with the current selection: still clickable (it switches the other choice) */
.tir-sw.is-disabled { opacity: .4; }
.tir-sw.is-disabled::after {
	content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 1.5px;
	background: var(--tir-ink, #0A0A0A); transform: rotate(-35deg); pointer-events: none;
}
.tir-sw-text.is-disabled { text-decoration: line-through; }
.tir-sw-text.is-disabled::after { display: none; }

.tir-sw-current { font-weight: 500; color: var(--tir-muted, #5A606B); }
body.tir-on.single-product table.variations td.value { position: relative; }
body.tir-on.single-product .reset_variations {
	display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 500;
	color: var(--tir-muted, #5A606B) !important; text-decoration: underline; text-underline-offset: 3px;
}
body.tir-on.single-product .reset_variations:hover { color: var(--tir-accent, #0E6EDC) !important; }

/* ---------- Lightbox ---------- */
.tir-lb {
	position: fixed; inset: 0; z-index: 100000;
	display: flex; align-items: center; justify-content: center;
	background: rgba(10,10,10,.94);
}
.tir-lb[hidden] { display: none; }
.tir-lb img { max-width: min(92vw, 1100px); max-height: 86vh; object-fit: contain; border-radius: var(--tir-r-card, 16px); background: #fff; }
.tir-lb-close, .tir-lb-nav {
	position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; padding: 0;
	display: grid; place-items: center; cursor: pointer;
	background: rgba(255,255,255,.12); color: #fff; font-size: 30px; line-height: 1;
	transition: background-color .2s ease;
}
.tir-lb-close:hover, .tir-lb-nav:hover { background: rgba(255,255,255,.25); }
.tir-lb-close { top: 18px; right: 18px; }
.tir-lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.tir-lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.tir-lb-count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; font-weight: 600; opacity: .8; }
.tir-lb.is-single .tir-lb-nav, .tir-lb.is-single .tir-lb-count { display: none; }

/* ---------- Responsive ---------- */
@media (hover: none) {
	.tir-g-nav { display: none; }
}
@media (max-width: 767px) {
	.tir-gallery { margin-bottom: 18px; }
	.tir-g-thumb { flex-basis: 62px; width: 62px; height: 62px; }
	.tir-sw-color { width: 42px; height: 42px; }
	.tir-sw-text { min-width: 50px; height: 42px; }
	.tir-lb-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.tir-g-nav, .tir-g-thumb, .tir-sw { transition: none; }
}
