/* Goldtop — Product slider for [goldtop_products]
 *
 * Self-contained, isolated from banner-carousel.css. Card visuals are
 * intentionally duplicated from polish.css section 10 (under the
 * .gt-ps scope) so this feature doesn't touch the archive selector.
 */

.gt-ps {
	display: block;
	max-width: 100%;
	margin: 2em 0;
}

.gt-ps *,
.gt-ps *::before,
.gt-ps *::after {
	box-sizing: border-box;
}

.gt-ps__title {
	font-size: 2em;
	font-weight: 700;
	letter-spacing: -0.015em;
	color: var(--gt-text, #1c2430);
	margin: 0 0 1em;
	padding-bottom: 0.4em;
	text-align: center;
	position: relative;
}

.gt-ps__title::after {
	content: "";
	display: block;
	width: 60px;
	height: 2px;
	background: var(--gt-accent, #f35b04);
	margin: 0.5em auto 0;
}

/* Carousel container — positioning anchor for arrows. No padding here:
   cards span the container's full width, and arrows are translated
   outside so they don't overlap any product. */
.gt-ps__carousel {
	position: relative;
	width: 100%;
	max-width: 100%;
}

/* Viewport — horizontal scroll with snap. No scroll-behavior here
   so JS direct scrollLeft assignments stay instant (same lesson learned
   from the banner-carousel fix). */
.gt-ps__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.gt-ps__viewport::-webkit-scrollbar {
	display: none;
}

/* High-specificity selectors (ul.gt-ps__track.products) defeat Astra's
   WC-grid compat rule (ul.products { display: grid; ... }) which has
   element+class specificity (0,0,1,1) and otherwise wins where it's
   loaded — even on pages where it's loaded by other plugins/blocks. */
.gt-ps ul.gt-ps__track.products {
	display: flex;
	gap: 24px;
	align-items: stretch; /* each card fills the row height */
	list-style: none;
	margin: 0;
	padding: 0;
}

.gt-ps ul.gt-ps__track.products > li.product {
	flex: 0 0 calc((100% - 5 * 24px) / 6);
	scroll-snap-align: start;
	height: auto; /* override any explicit height set by Astra */
	align-self: stretch; /* belt-and-braces: ensure stretch even if a parent rule sets align-self */
}

/* Arrows — circular floaters at left/right edges of the carousel */
.gt-ps__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	color: #1c2430;
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	transition: background-color 0.18s ease, opacity 0.18s ease;
}

/* Hover: keep the same semi-opaque background (so the arrow doesn't flash
   pure white), just tint the chevron with the brand accent + a touch more
   shadow. The signal is colour, not lightness. */
.gt-ps__arrow:hover {
	color: var(--gt-accent, #f35b04);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.gt-ps__arrow svg {
	width: 22px;
	height: 22px;
}

/* Arrows positioned outside the carousel with breathing room — translate
   by 100% of their width (= flush against the edge) plus 14px so there's
   a visible gap between the arrow and the first/last product. */
.gt-ps__arrow--prev { left: 0;  transform: translate(calc(-100% - 14px), -50%); }
.gt-ps__arrow--next { right: 0; transform: translate(calc(100%  + 14px), -50%); }

.gt-ps__arrow[disabled],
.gt-ps__arrow[hidden] {
	opacity: 0;
	pointer-events: none;
}

.gt-ps__arrow[hidden] {
	display: none;
}

/* ---------- Product cards — flat (no box treatment), equal-height column
              so the button always aligns at the bottom regardless of title
              length. ---------- */

.gt-ps ul.gt-ps__track.products > li.product {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

/* Thumbnail area has a baseline height (min-height) so every LI has a
   real natural size — without it, flex:1 1 0 collapses the image to 0
   when align-items:stretch can't find anything to stretch. With a
   baseline of 200px, the image area then GROWS for cards whose summary
   is shorter (because align-items:stretch equalises LI heights and the
   thumbnail flex-grow absorbs the extra). */
.gt-ps ul.gt-ps__track.products > li.product .astra-shop-thumbnail-wrap {
	position: relative;
	flex: 1 1 auto;
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--gt-radius-md, 6px);
	overflow: hidden;
	margin: 0 0 1em;
}

/* The image-link wrapper inside fills the thumbnail container and centers
   the image. Using max-width/max-height + width/height auto lets the
   image render at its natural size, capped to the container — preserves
   aspect ratio without object-fit doing the work, which is more robust
   across Astra's nested anchor markup. */
.gt-ps ul.gt-ps__track.products > li.product .astra-shop-thumbnail-wrap > a:first-child {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.gt-ps ul.gt-ps__track.products > li.product .astra-shop-thumbnail-wrap img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	transition: transform 450ms ease;
}

.gt-ps ul.gt-ps__track.products > li.product:hover .astra-shop-thumbnail-wrap img {
	transform: scale(1.03);
}

.gt-ps ul.gt-ps__track.products > li.product .ast-woo-product-category {
	display: block;
	font-size: 0.72em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--gt-text-muted, #6b7280);
	margin: 0;
}

.gt-ps ul.gt-ps__track.products > li.product .ast-loop-product__link {
	text-decoration: none;
	color: inherit;
	margin: 0;
	display: block;
}

.gt-ps ul.gt-ps__track.products > li.product .woocommerce-loop-product__title {
	font-size: 0.98em;
	font-weight: 500;
	line-height: 1.4;
	color: var(--gt-text, #1c2430);
	margin: 0;
	padding: 0;
}

.gt-ps ul.gt-ps__track.products > li.product .price {
	display: block;
	font-size: 1.15em;
	font-weight: 700;
	color: var(--gt-text, #1c2430);
	margin: 0;
}

.gt-ps ul.gt-ps__track.products > li.product .price del {
	opacity: 0.55;
	font-weight: 400;
	margin-right: 6px;
}

/* Summary wrap = natural content height, anchored at the bottom of the LI.
   The image takes the rest. Across all cards in a row the buttons, prices
   and title-bottoms therefore align at the same y; the image area is what
   stretches/shrinks to absorb the difference. */
.gt-ps ul.gt-ps__track.products > li.product > .astra-shop-summary-wrap {
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
	gap: 0.6em;
	padding-top: 0.8em;
}

.gt-ps ul.gt-ps__track.products > li.product > .astra-shop-summary-wrap > a.button {
	text-align: center;
	padding: 8px 18px;
	font-size: 0.85em;
}
