/**
 * Video preview player + grid badge.
 *
 * Scoped under .gis-scope so it inherits the design-system tokens without
 * leaking into the theme.
 */

.gis-video {
	position: relative;
	width: 100%;
	margin: 0 0 16px;
}

.gis-video__player {
	display: block;
	width: 100%;
	height: auto;
	max-height: 70vh;
	background: #0f141b;
	border-radius: var(--gis-r, 10px);
	outline: none;
}

/* Inherit + dim rather than a fixed grey: the player is often placed on a dark
   popup where var(--gis-muted) is barely readable. */
.gis-video__hint,
.gis-video__notice {
	margin: 6px 0 0;
	font-size: .78rem;
	line-height: 1.45;
	color: inherit;
	opacity: .62;
}

/* Poster-only fallback: an older upload, or a browser that couldn't record. */
.gis-video--poster {
	display: block;
}

.gis-video--poster img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--gis-r, 10px);
}

.gis-video--empty {
	padding: 24px;
	text-align: center;
	background: var(--gis-surface-2, #f4f6f8);
	border-radius: var(--gis-r, 10px);
}

/* Play badge for album grid cards.

   Inline by default so it is safe to drop anywhere in a listing. Add
   overlay="yes" to float it over the thumbnail — gis-media.js then makes the
   surrounding card position:relative so it has something to anchor to. */
.gis-video-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	color: #fff;
	background: rgba(15, 20, 27, 0.72);
	border-radius: 50%;
	pointer-events: none;
	backdrop-filter: blur(2px);
	vertical-align: middle;
}

.gis-video-badge--overlay {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
}

.gis-video--poster {
	position: relative;
}

.gis-video--poster .gis-video-badge--overlay {
	top: 12px;
	left: 12px;
}

.gis-video-wrap {
	margin-bottom: 20px;
}

/* ---------------------------------------------------------------------------
 * [gis_media_card] — the grid tile
 *
 * The three-widget approach (image + heart + archive add-to-cart) produced rows
 * of mismatched heights because each source image kept its own proportions.
 * Every tile here crops to one ratio, so the grid reads as a grid.
 * ------------------------------------------------------------------------ */

.gis-scope.gis-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: 100%;
}

.gis-card__frame {
	position: relative;
	overflow: hidden;
	background: rgba(127, 137, 150, .12);
	border-radius: var(--gis-r, 10px);
}

/* Fallback for browsers without aspect-ratio; the inline style wins elsewhere. */
@supports not (aspect-ratio: 4 / 3) {
	.gis-card__frame::before {
		display: block;
		padding-top: 75%;
		content: "";
	}
}

.gis-card__link {
	position: absolute;
	inset: 0;
	display: block;
}

.gis-scope .gis-card__img {
	width: 100% !important;
	height: 100% !important;
	/* The one line that makes the grid even: crop instead of letterbox. */
	object-fit: cover;
	object-position: center;
	border-radius: 0;
	transition: transform .45s cubic-bezier(.2, .7, .3, 1);
}

.gis-card:hover .gis-card__img {
	transform: scale(1.045);
}

/* Play badge — centred, so it reads as "this tile is a video" rather than
   competing with the heart in a corner. */
.gis-card__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	padding-left: 3px; /* optically centres the triangle */
	color: #fff;
	background: rgba(15, 20, 27, .55);
	border-radius: 50%;
	transform: translate(-50%, -50%);
	backdrop-filter: blur(3px);
	pointer-events: none;
	transition: background-color var(--gis-fast, .15s) var(--gis-ease, ease);
}

.gis-card:hover .gis-card__play {
	background: rgba(15, 20, 27, .78);
}

/* A slow expanding ring rather than a blinking icon: it draws the eye without
   turning a wall of thumbnails into a strobe. */
.gis-card__play-ring {
	position: absolute;
	inset: 0;
	border: 2px solid rgba(255, 255, 255, .85);
	border-radius: 50%;
	animation: gis-play-pulse 2.4s cubic-bezier(.3, .1, .3, 1) infinite;
}

@keyframes gis-play-pulse {
	0%   { opacity: .85; transform: scale(1); }
	70%  { opacity: 0;   transform: scale(1.55); }
	100% { opacity: 0;   transform: scale(1.55); }
}

@media (prefers-reduced-motion: reduce) {
	.gis-card__play-ring {
		animation: none;
	}

	.gis-scope .gis-card__img,
	.gis-card:hover .gis-card__img {
		transition: none;
		transform: none;
	}
}

/* Heart: a circle floating on the image, not a white block sitting on top. */
.gis-card__fav {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
}

.gis-card__fav .gis-fav-wrap,
.gis-card__fav .gis-fav-wrap--inline {
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	box-shadow: none;
}

/* The default heart is a white rounded square, which on a photo reads as a
   floating box. Over an image a dark translucent circle disappears into the
   picture and stays legible on any subject. */
.gis-scope .gis-card__fav .gis-fav-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 36px !important;
	height: 36px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	padding: 0 !important;
	color: #fff !important;
	background: rgba(15, 20, 27, .5) !important;
	border: 0 !important;
	border-radius: 50% !important;
	box-shadow: none !important;
	backdrop-filter: blur(3px);
}

.gis-scope .gis-card__fav .gis-fav-btn:hover {
	color: #fff !important;
	background: rgba(15, 20, 27, .72) !important;
	transform: scale(1.08);
}

.gis-scope .gis-card__fav .gis-fav-btn.is-active {
	color: var(--gis-fav, #e5484d) !important;
	background: rgba(255, 255, 255, .92) !important;
}

.gis-scope .gis-card__fav .gis-fav-btn.is-active .gis-fav-btn__icon svg {
	fill: var(--gis-fav, #e5484d);
	stroke: var(--gis-fav, #e5484d);
}

.gis-card__foot {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
}

.gis-card__title {
	margin: 0;
	font-size: .92rem;
	font-weight: 600;
	line-height: 1.35;
	color: inherit;
}

.gis-scope .gis-card__title a {
	display: -webkit-box;
	overflow: hidden;
	color: inherit;
	text-decoration: none;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.gis-scope .gis-card__title a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gis-card__buy {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto; /* pins the buy row to the bottom on uneven titles */
}

.gis-card__price {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	color: inherit;
	white-space: nowrap;
}

.gis-card__price del {
	margin-right: 4px;
	font-size: .82em;
	font-weight: 400;
	opacity: .55;
}

.gis-card__price ins {
	text-decoration: none;
}

.gis-scope .gis-cta--sm {
	flex: 0 0 auto;
	min-height: 38px;
	padding: 9px 16px;
	font-size: .85rem;
}

/* ---------------------------------------------------------------------------
 * [gis_product_card] — media + price + CTA, built for a popup
 * ------------------------------------------------------------------------ */

.gis-scope.gis-product-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	/* Requested cap: without it a large source is stretched across a wide popup
	   and looks soft. Photos are never upscaled past their natural size. */
	max-width: 750px !important;
	margin-inline: auto;
}

.gis-product-card__media .gis-video {
	margin-bottom: 0;
}

.gis-scope .gis-product-card__media img,
.gis-scope .gis-product-card__media video {
	max-width: 100% !important;
	max-height: 70vh;
	margin: 0 auto;
}

.gis-photo img,
.gis-product-card__img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--gis-r, 10px);
}

.gis-product-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Text inherits its colour instead of hardcoding the design-system ink.
   The card is meant to live in a popup whose background the site owner chooses,
   and on a dark one a fixed #1f2733 title is effectively invisible. Secondary
   text is dimmed with opacity, which reads correctly on light and dark alike. */
.gis-product-card__title {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.35;
	color: inherit;
}

.gis-scope .gis-product-card__title a {
	color: inherit;
	text-decoration: none;
}

.gis-scope .gis-product-card__title a:hover,
.gis-scope .gis-product-card__title a:focus {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gis-product-card__price {
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.2;
	color: inherit;
}

.gis-product-card__price del {
	margin-right: 6px;
	font-size: .85em;
	font-weight: 400;
	opacity: .55;
}

.gis-product-card__price ins {
	text-decoration: none;
}

/* What the buyer gets. Answers the "am I paying for the watermarked one?"
   question the preview inevitably raises. */
.gis-facts {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
}

.gis-facts__item {
	display: flex;
	align-items: flex-start;
	gap: 7px;
	margin: 0;
	font-size: .82rem;
	line-height: 1.45;
	color: inherit;
	opacity: .78;
}

.gis-facts__mark {
	display: inline-flex;
	flex: 0 0 auto;
	margin-top: 1px;
	color: var(--gis-success, #1a7f4b);
	opacity: .95;
}

.gis-product-card__actions {
	display: flex;
	flex-wrap: wrap; /* lets the vendor-only hint drop to its own row */
	align-items: center;
	gap: 10px;
	margin-top: 4px;
}

/* The CTA. Deliberately heavier than the theme's loop button: in a popup it is
   the single action the visitor is there to take.

   Every colour rule below is written as `.gis-scope a.gis-cta…` on purpose. A
   plain `.gis-cta` loses to ordinary theme/Elementor link rules like
   `.elementor-widget-container a`, which is exactly how this button ended up
   rendering as white-with-red-text instead of a solid accent button. */
.gis-scope .gis-cta {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex: 1 1 auto;
	min-height: 48px;
	padding: 13px 22px !important;
	font-family: inherit;
	font-size: .95rem;
	font-weight: 600;
	line-height: 1 !important;
	text-align: center;
	text-decoration: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	border: 1px solid transparent;
	border-radius: var(--gis-r, 10px) !important;
	box-shadow: none;
	cursor: pointer;
	transition: background-color var(--gis-fast, .15s) var(--gis-ease, ease),
		box-shadow var(--gis-fast, .15s) var(--gis-ease, ease),
		transform var(--gis-fast, .15s) var(--gis-ease, ease);
}

/* !important throughout because Elementor styles buttons and links through
   several high-specificity selectors (and its own kit variables), which is how
   this CTA previously rendered as a white box with red text. */
.gis-scope a.gis-cta--add,
.gis-scope a.gis-cta--add:visited {
	color: #fff !important;
	background: var(--gis-accent, #2f6df6) !important;
	border-color: var(--gis-accent, #2f6df6) !important;
	box-shadow: var(--gis-shadow-sm, 0 1px 2px rgba(16, 24, 40, .08));
}

.gis-scope a.gis-cta--add:hover,
.gis-scope a.gis-cta--add:focus {
	color: #fff !important;
	background: var(--gis-accent-ink, #2657c9) !important;
	border-color: var(--gis-accent-ink, #2657c9) !important;
	box-shadow: var(--gis-shadow, 0 4px 12px rgba(16, 24, 40, .12));
	transform: translateY(-1px);
}

.gis-scope a.gis-cta--add:active {
	transform: translateY(0);
}

.gis-scope .gis-cta.is-loading {
	pointer-events: none;
	opacity: .72;
}

.gis-scope a.gis-cta--in-cart,
.gis-scope a.gis-cta--in-cart:visited {
	color: #fff !important;
	background: var(--gis-success, #1a7f4b) !important;
	border-color: var(--gis-success, #1a7f4b) !important;
}

.gis-scope a.gis-cta--in-cart:hover,
.gis-scope a.gis-cta--in-cart:focus {
	color: #fff !important;
	background: #14663c !important;
	border-color: #14663c !important;
}

.gis-cta__check {
	font-size: 1rem;
	line-height: 1;
}

/* Translucent rather than a fixed light grey, so the unavailable state stays
   legible whether the popup is light or dark. */
.gis-scope a.gis-cta--muted,
.gis-scope a.gis-cta--muted:visited {
	color: inherit !important;
	background: rgba(127, 137, 150, .16) !important;
	border-color: rgba(127, 137, 150, .34) !important;
	opacity: .92;
}

.gis-scope a.gis-cta--muted:hover,
.gis-scope a.gis-cta--muted:focus {
	color: inherit !important;
	background: rgba(127, 137, 150, .26) !important;
	opacity: 1;
}

.gis-scope .gis-cta:focus-visible {
	outline: 2px solid var(--gis-accent, #2f6df6);
	outline-offset: 2px;
}

/* Only rendered for users who can edit the product. */
.gis-cta-hint {
	flex: 1 0 100%;
	margin: 8px 0 0;
	padding: 8px 10px;
	font-size: .78rem;
	line-height: 1.45;
	color: var(--gis-warn, #a15c07);
	background: var(--gis-warn-bg, #fdf4e3);
	border-radius: var(--gis-r-sm, 6px);
}

/* Keep the heart from stretching alongside the flexible CTA. */
.gis-product-card__actions .gis-fav-wrap {
	flex: 0 0 auto;
}

/* WooCommerce injects a "View cart" link after its AJAX add; the CTA already
   says so, and in a popup the extra link just pushes the layout around. */
.gis-product-card__actions .added_to_cart {
	display: none;
}

@media (max-width: 480px) {
	.gis-cta {
		width: 100%;
	}
}

@media (max-width: 640px) {
	.gis-video__player {
		max-height: 56vh;
	}
}
