/* Hound's Tales Product Extras – front end.
   Colours and fonts come from CSS variables printed from the settings page (WooCommerce → Product Extras). */

.htpe, .htpe *, .htpe *::before, .htpe *::after { box-sizing: border-box; }
.htpe {
	color: var(--htpe-main, #1B494E);
	font-family: var(--htpe-font-body, inherit);
}
.htpe button { font-family: var(--htpe-font-body, inherit); }
.htpe-error { padding: 10px 14px; background: #fff8e1; border-left: 4px solid #f0b429; }

/* ---------------------------------------------------------------- labels */
.htpe-labels, .htpe-g-labels { display: flex; flex-wrap: wrap; gap: 6px; }
.htpe-label {
	display: inline-block;
	padding: 4px 11px;
	background: var(--htpe-label-bg, #CFE8D3);
	color: var(--htpe-label-text, #1B494E);
	font-family: var(--htpe-font-body, inherit);
	font-size: 11px;
	line-height: 1.4;
	letter-spacing: .12em;
	text-transform: uppercase;
	border-radius: 0;
}

/* labels over product cards (shop / category / lists) */
.htpe-labels--overlay { position: absolute; top: 10px; left: 10px; z-index: 5; flex-direction: column; align-items: flex-start; gap: 5px; pointer-events: none; }
.htpe-labels--overlay.htpe-pos-tr { left: auto; right: 10px; align-items: flex-end; }
.woocommerce ul.products li.product, .elementor-widget-woocommerce-products ul.products li.product, .elementor-products-grid ul.products li.product { position: relative; }
.htpe-labels--archive .htpe-label { text-decoration: none; }

/* ------------------------------------------------------------- accordion */
.htpe-accordion, .htpe-sets { border-top: 1px solid var(--htpe-line, #D9DFE0); }
.htpe-acc { border-bottom: 1px solid var(--htpe-line, #D9DFE0); }
.htpe-acc > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 2px;
	cursor: pointer;
	list-style: none;
	color: var(--htpe-main, #1B494E);
	-webkit-tap-highlight-color: transparent;
}
.htpe-acc > summary::-webkit-details-marker { display: none; }
.htpe-acc > summary::marker { content: ''; }
.htpe-acc > summary:focus-visible { outline: 2px solid var(--htpe-accent, #23656C); outline-offset: 2px; }
.htpe-acc-title {
	font-family: var(--htpe-font-heading, inherit);
	font-weight: 400;
	font-size: 22px;
	line-height: 1.2;
}
.htpe-caret { flex: 0 0 auto; transition: transform .2s ease; }
.htpe-acc[open] > summary .htpe-caret { transform: rotate(180deg); }
.htpe-acc-body {
	padding: 0 2px 22px;
	font-size: 15px;
	line-height: 1.7;
}
.htpe-acc-body > :first-child { margin-top: 0; }
.htpe-acc-body > :last-child { margin-bottom: 0; }
.htpe-acc-body ul, .htpe-acc-body ol { padding-left: 1.25em; }
.htpe-acc-body a { color: var(--htpe-accent, #23656C); text-decoration: underline; }
.htpe-acc-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.htpe-acc-body th, .htpe-acc-body td { padding: 8px 10px; border: 1px solid var(--htpe-line, #D9DFE0); text-align: left; }
.htpe-acc-body img { max-width: 100%; height: auto; }

/* ------------------------------------------------------------------ sets */
.htpe-set-list { list-style: none; margin: 0; padding: 0 0 20px; display: grid; gap: 10px; }
.htpe-set-list li { margin: 0; padding: 0; }
.htpe-set {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px;
	border: 1px solid var(--htpe-line, #D9DFE0);
	background: #fff;
	color: var(--htpe-main, #1B494E);
	text-decoration: none;
	border-radius: 0;
	transition: border-color .15s;
}
.htpe-set:hover, .htpe-set:focus-visible { border-color: var(--htpe-main, #1B494E); }
.htpe-set-img { flex: 0 0 76px; width: 76px; height: 76px; background: #f3f6f6; overflow: hidden; }
.htpe-set-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.htpe-set-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.htpe-set-name { font-family: var(--htpe-font-body, inherit); font-size: 15px; line-height: 1.35; }
.htpe-set-price { font-family: var(--htpe-font-body, inherit); font-size: 14px; color: #5f7578; }
.htpe-set-price del { opacity: .6; }
.htpe-set-price ins { text-decoration: none; }
.htpe-set-go { flex: 0 0 auto; color: var(--htpe-accent, #23656C); }

/* --------------------------------------------------------------- gallery */
.htpe-gallery {
	display: grid;
	grid-template-columns: 92px minmax(0, 1fr);
	gap: 14px;
	align-items: stretch;
	width: 100%;
}
.htpe-gallery.is-single { grid-template-columns: minmax(0, 1fr); }

/* thumbnails column: as tall as the main image, scrolls inside */
.htpe-g-thumbs { position: relative; min-height: 0; }
.htpe-g-thumbs-inner { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; }
.htpe-g-list {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	overflow-y: auto;
	scrollbar-width: none;
}
.htpe-g-list::-webkit-scrollbar { display: none; }
.htpe-g-thumb {
	flex: 0 0 auto;
	display: block;
	width: 100%;
	aspect-ratio: var(--htpe-ratio, 1/1);
	padding: 0;
	border: 1px solid transparent;
	border-radius: 0;
	background: #f3f6f6;
	cursor: pointer;
	opacity: .6;
	overflow: hidden;
	transition: opacity .15s, border-color .15s;
}
.htpe-g-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.htpe-g-thumb:hover { opacity: 1; }
.htpe-g-thumb.is-active { opacity: 1; border-color: var(--htpe-main, #1B494E); }
.htpe-g-thumb:focus-visible { outline: 2px solid var(--htpe-accent, #23656C); outline-offset: 1px; }
.htpe-g-tnav {
	display: none;
	flex: 0 0 28px;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 28px;
	padding: 0;
	border: 1px solid var(--htpe-line, #D9DFE0);
	border-radius: 0;
	background: #fff;
	color: var(--htpe-main, #1B494E);
	cursor: pointer;
}
.htpe-gallery.has-thumb-nav .htpe-g-tnav { display: flex; }
.htpe-g-tnav:disabled { opacity: .35; cursor: default; }

/* main image */
.htpe-g-main {
	position: relative;
	min-width: 0;
	aspect-ratio: var(--htpe-ratio, 1/1);
	background: #f3f6f6;
	overflow: hidden;
}
.htpe-g-track {
	display: flex;
	width: 100%;
	height: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	outline: none;
}
.htpe-g-track::-webkit-scrollbar { display: none; }
.htpe-g-track:focus-visible { box-shadow: inset 0 0 0 2px var(--htpe-accent, #23656C); }
.htpe-g-slide { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; cursor: zoom-in; }
.htpe-g-img { width: 100%; height: 100%; object-fit: var(--htpe-fit, cover); display: block; user-select: none; -webkit-user-drag: none; }

.htpe-g-labels { position: absolute; top: 12px; left: 12px; z-index: 2; pointer-events: none; }

.htpe-g-arrow, .htpe-g-zoom {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: rgba(255, 255, 255, .92);
	color: var(--htpe-main, #1B494E);
	cursor: pointer;
	transition: opacity .2s, background .15s;
}
.htpe-g-arrow:hover, .htpe-g-zoom:hover { background: #fff; }
.htpe-g-arrow:focus-visible, .htpe-g-zoom:focus-visible { outline: 2px solid var(--htpe-accent, #23656C); outline-offset: 2px; }
.htpe-g-prev { top: 50%; left: 0; transform: translateY(-50%); }
.htpe-g-next { top: 50%; right: 0; transform: translateY(-50%); }
.htpe-g-zoom { top: 12px; right: 12px; width: 40px; height: 40px; }
.htpe-g-count {
	position: absolute;
	z-index: 2;
	right: 12px;
	bottom: 12px;
	padding: 3px 10px;
	background: rgba(255, 255, 255, .92);
	color: var(--htpe-main, #1B494E);
	font-family: var(--htpe-font-body, inherit);
	font-size: 12px;
	letter-spacing: .06em;
}
.htpe-g-dots { position: absolute; z-index: 2; left: 0; right: 0; bottom: 12px; display: none; justify-content: center; gap: 7px; pointer-events: none; }
.htpe-g-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 1px solid var(--htpe-main, #1B494E);
	border-radius: 50%;
	background: rgba(255, 255, 255, .85);
	pointer-events: auto;
	cursor: pointer;
}
.htpe-g-dot.is-active { background: var(--htpe-main, #1B494E); }

/* arrows fade in on hover for mouse users, always shown on touch screens */
@media (hover: hover) and (min-width: 861px) {
	.htpe-g-arrow { opacity: 0; }
	.htpe-g-main:hover .htpe-g-arrow, .htpe-g-main:focus-within .htpe-g-arrow { opacity: 1; }
}
.htpe-g-main .htpe-g-count { display: none; }
@media (min-width: 861px) {
	.htpe-g-main .htpe-g-count { display: block; }
}

/* phones and small tablets: full-width swipe gallery, no thumbnail column */
@media (max-width: 860px) {
	.htpe-gallery { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.htpe-g-thumbs { display: none; }
	.htpe-g-arrow { width: 38px; height: 38px; background: rgba(255, 255, 255, .85); }
	.htpe-g-zoom { top: 10px; right: 10px; width: 36px; height: 36px; }
	.htpe-g-labels { top: 10px; left: 10px; }
	.htpe-g-dots { display: flex; }
	.htpe-gallery[data-many="1"] .htpe-g-dots { display: none; }
	.htpe-gallery[data-many="1"] .htpe-g-main .htpe-g-count { display: block; }
}

/* ----------------------------------------------------------- lightbox */
.htpe-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	background: rgba(14, 38, 41, .96);
	color: #fff;
	font-family: var(--htpe-font-body, inherit);
	animation: htpe-fade .18s ease-out;
}
@keyframes htpe-fade { from { opacity: 0; } to { opacity: 1; } }
.htpe-lb *, .htpe-lb *::before, .htpe-lb *::after { box-sizing: border-box; }
.htpe-lb-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 18px; font-size: 13px; letter-spacing: .08em; }
.htpe-lb-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
}
.htpe-lb-btn:hover { background: rgba(255, 255, 255, .12); }
.htpe-lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.htpe-lb-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; overflow: auto; }
.htpe-lb-img { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; user-select: none; }
.htpe-lb.is-zoomed .htpe-lb-img { max-width: none; max-height: none; width: 220%; cursor: zoom-out; }
.htpe-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: rgba(14, 38, 41, .55); }
.htpe-lb-prev { left: 8px; }
.htpe-lb-next { right: 8px; }
.htpe-lb.is-zoomed .htpe-lb-nav { display: none; }

@media (prefers-reduced-motion: reduce) {
	.htpe-lb { animation: none; }
	.htpe-caret, .htpe-g-thumb { transition: none; }
}

/* ----------------------------------------------------------------------
   Button states. Many themes colour EVERY button on hover/focus (often white text on a coloured
   background). That made the arrows' icons vanish after a tap. These rules pin colours in every state
   (normal, hover, focus, active) so the theme cannot change them.
   ---------------------------------------------------------------------- */
.htpe .htpe-g-arrow, .htpe .htpe-g-arrow:hover, .htpe .htpe-g-arrow:focus, .htpe .htpe-g-arrow:active,
.htpe .htpe-g-zoom,  .htpe .htpe-g-zoom:hover,  .htpe .htpe-g-zoom:focus,  .htpe .htpe-g-zoom:active {
	color: var(--htpe-main, #1B494E);
	background-color: rgba(255, 255, 255, .92);
	border: 0;
	box-shadow: none;
	text-shadow: none;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
}
.htpe .htpe-g-arrow:hover, .htpe .htpe-g-zoom:hover { background-color: #fff; }
.htpe .htpe-g-arrow:focus-visible, .htpe .htpe-g-zoom:focus-visible { outline: 2px solid var(--htpe-accent, #23656C); outline-offset: 2px; }
.htpe .htpe-g-arrow svg, .htpe .htpe-g-zoom svg, .htpe .htpe-g-tnav svg { stroke: currentColor; }

.htpe .htpe-g-tnav, .htpe .htpe-g-tnav:hover, .htpe .htpe-g-tnav:focus, .htpe .htpe-g-tnav:active {
	color: var(--htpe-main, #1B494E);
	background-color: #fff;
	border: 1px solid var(--htpe-line, #D9DFE0);
	box-shadow: none;
}
.htpe .htpe-g-tnav:hover:not(:disabled) { border-color: var(--htpe-main, #1B494E); }

.htpe .htpe-g-thumb, .htpe .htpe-g-thumb:hover, .htpe .htpe-g-thumb:focus, .htpe .htpe-g-thumb:active {
	background-color: #f3f6f6;
	color: var(--htpe-main, #1B494E);
	box-shadow: none;
}

.htpe .htpe-g-dot, .htpe .htpe-g-dot:hover, .htpe .htpe-g-dot:focus, .htpe .htpe-g-dot:active {
	background-color: rgba(255, 255, 255, .85);
	border: 1px solid var(--htpe-main, #1B494E);
	box-shadow: none;
	min-width: 0;
	min-height: 0;
}
.htpe .htpe-g-dot.is-active, .htpe .htpe-g-dot.is-active:hover, .htpe .htpe-g-dot.is-active:focus { background-color: var(--htpe-main, #1B494E); }

/* fullscreen viewer */
.htpe-lb .htpe-lb-btn, .htpe-lb .htpe-lb-btn:hover, .htpe-lb .htpe-lb-btn:focus, .htpe-lb .htpe-lb-btn:active {
	color: #fff;
	background-color: transparent;
	border: 0;
	box-shadow: none;
	text-decoration: none;
}
.htpe-lb .htpe-lb-btn:hover { background-color: rgba(255, 255, 255, .14); }
.htpe-lb .htpe-lb-nav, .htpe-lb .htpe-lb-nav:focus, .htpe-lb .htpe-lb-nav:active { background-color: rgba(14, 38, 41, .55); }
.htpe-lb .htpe-lb-nav:hover { background-color: rgba(14, 38, 41, .8); }
.htpe-lb .htpe-lb-btn svg { stroke: currentColor; }
