/* Glimbyte Product Showcase */

.gbps {
	--gbps-cols: 5;
	--gbps-visible: 2.4;
	--gbps-gap: 22px;
	--gbps-row-gap: 36px;
	--gbps-qv-offset: 12px;
	--gbps-qv-height: 32px;
	--gbps-scroll-space: 12px;
	--gbps-sb-size: 8px;
	--gbps-sb-thumb: #8f8f8f;
	--gbps-sb-track: transparent;
	width: 100%;
}

/* Grid (fallback before Elementor CSS loads; Elementor controls override per device) */
.gbps-grid {
	display: grid;
	grid-template-columns: repeat(var(--gbps-cols), minmax(0, 1fr));
	column-gap: var(--gbps-gap);
	row-gap: var(--gbps-row-gap);
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--gbps-sb-thumb) var(--gbps-sb-track);
}

@media (max-width: 767px) {
	.gbps-grid {
		grid-auto-flow: column;
		grid-template-columns: none;
		grid-auto-columns: calc((100% - (var(--gbps-visible) - 1) * var(--gbps-gap)) / var(--gbps-visible));
		overflow-x: auto;
		padding-bottom: var(--gbps-scroll-space);
	}
}

.gbps-grid::-webkit-scrollbar { height: var(--gbps-sb-size); }
.gbps-grid::-webkit-scrollbar-track { background: var(--gbps-sb-track); }
.gbps-grid::-webkit-scrollbar-thumb { background: var(--gbps-sb-thumb); border-radius: 10px; }

.gbps-scrollbar- .gbps-grid { scrollbar-width: none; }
.gbps-scrollbar- .gbps-grid::-webkit-scrollbar { display: none; }

.gbps-snap-yes .gbps-grid { scroll-snap-type: x mandatory; }
.gbps-item { scroll-snap-align: start; min-width: 0; }

/* Image box */
.gbps-media {
	position: relative;
	aspect-ratio: 1 / 1.5;
	background-color: #f3f4f7;
	overflow: hidden;
}

.gbps-media-link {
	position: absolute;
	inset: 0;
	display: block;
	box-sizing: border-box;
}

.gbps-img-wrap {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
}

.gbps .gbps-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: contain;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transition: opacity .35s ease, transform .6s ease;
}

.gbps .gbps-img--hover { opacity: 0; }

@media (hover: hover) {
	.gbps--hover-zoom .gbps-item:hover .gbps-img { transform: scale(1.06); }
	.gbps--hover-swap .gbps-item:hover .gbps-media--swap .gbps-img--main { opacity: 0; }
	.gbps--hover-swap .gbps-item:hover .gbps-img--hover { opacity: 1; }
}

/* Quick view button */
.gbps .gbps-qv-btn {
	position: absolute;
	left: var(--gbps-qv-offset);
	right: var(--gbps-qv-offset);
	bottom: var(--gbps-qv-offset);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: auto;
	height: var(--gbps-qv-height);
	min-height: 0;
	margin: 0;
	padding: 0 12px;
	border: 0;
	border-radius: 0;
	background-color: #ead6e1;
	color: #4b4b4b;
	font-family: inherit;
	font-size: 13px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: .02em;
	text-transform: none;
	text-decoration: none;
	box-shadow: none;
	cursor: pointer;
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity .25s ease, transform .25s ease, background-color .2s ease, color .2s ease;
}

.gbps .gbps-qv-btn:hover { background-color: #e0c6d4; color: #2f2f2f; }

@media (hover: hover) {
	.gbps--qv-hover .gbps-item:hover .gbps-qv-btn {
		opacity: 1;
		transform: none;
		pointer-events: auto;
	}
}

.gbps--qv-always .gbps-qv-btn,
.gbps .gbps-item:focus-within .gbps-qv-btn,
.gbps .gbps-qv-btn:focus-visible {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

@media (hover: none) {
	.gbps--qv-touch-hide .gbps-qv-btn { display: none; }
	.gbps--qv-touch-show .gbps-qv-btn {
		opacity: 1;
		transform: none;
		pointer-events: auto;
	}
}

/* Badge */
.gbps-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	padding: 4px 8px;
	background: #fff;
	color: #333;
	font-size: 11px;
	line-height: 1.2;
	letter-spacing: .08em;
	text-transform: uppercase;
}

/* Info */
.gbps-info {
	padding-top: 14px;
	text-align: center;
}

.gbps .gbps-title {
	margin: 0 0 4px;
	padding: 0;
	color: #333;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: .16em;
	text-transform: uppercase;
	word-break: break-word;
}

.gbps .gbps-title a {
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.gbps-rating { display: flex; justify-content: center; margin: 2px 0 4px; }
.gbps-rating .star-rating { margin: 0; float: none; }

.gbps-price {
	color: #555;
	font-size: 13px;
	letter-spacing: .02em;
}

.gbps-price del { opacity: .6; margin-right: 6px; }
.gbps-price ins { text-decoration: none; background: none; }

.gbps-empty {
	padding: 24px;
	border: 1px dashed #c9c9c9;
	color: #666;
	text-align: center;
	font-size: 14px;
}

/* ----------------------------------------------------------------------- *
 * Quick view modal
 * ----------------------------------------------------------------------- */

html.gbps-modal-open { overflow: hidden; }

.gbps-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.gbps-modal.is-open { display: flex; }

.gbps-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 20, 26, .55);
	animation: gbps-fade .2s ease;
}

.gbps-modal__dialog {
	position: relative;
	width: min(960px, 100%);
	max-height: calc(100vh - 48px);
	overflow: auto;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
	outline: none;
	animation: gbps-rise .25s ease;
}

.gbps-modal .gbps-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 5;
	width: 38px;
	height: 38px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #333;
	font-size: 26px;
	line-height: 38px;
	text-align: center;
	cursor: pointer;
	box-shadow: none;
}

.gbps-modal .gbps-modal__close:hover { background: #f3f4f7; color: #000; }

.gbps-modal__body { min-height: 240px; }

.gbps-modal.is-loading .gbps-modal__body::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 34px;
	height: 34px;
	margin: -17px 0 0 -17px;
	border: 3px solid #e6e6e6;
	border-top-color: #555;
	border-radius: 50%;
	animation: gbps-spin .8s linear infinite;
}

.gbps-modal__error { padding: 60px 30px; text-align: center; color: #555; }

.gbps-modal .gbps-qv.product {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 36px;
	margin: 0;
	padding: 36px;
}

/* Neutralise WooCommerce single product floats/widths inside the modal */
.gbps-modal .gbps-qv.product .gbps-qv__gallery.images,
.gbps-modal .gbps-qv.product .gbps-qv__summary.summary {
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
}

.gbps-modal .gbps-qv__main {
	position: relative;
	aspect-ratio: 1 / 1.15;
	background: #f3f4f7;
	overflow: hidden;
}

.gbps-modal .gbps-qv__main img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain;
}

.gbps-modal .gbps-qv__thumbs {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	overflow-x: auto;
}

.gbps-modal .gbps-qv__thumb {
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 0;
	background: #f3f4f7;
	cursor: pointer;
	box-shadow: none;
}

.gbps-modal .gbps-qv__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gbps-modal .gbps-qv__thumb.is-active { border-color: #333; }

.gbps-modal .gbps-qv__title {
	margin: 0 0 12px;
	padding-right: 40px;
	color: #222;
	font-size: 20px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.gbps-modal .gbps-qv__price {
	margin: 0 0 18px;
	color: #444;
	font-size: 18px;
}

.gbps-modal .gbps-qv__price del { opacity: .6; margin-right: 8px; }
.gbps-modal .gbps-qv__price ins { text-decoration: none; }

.gbps-modal .gbps-qv__excerpt {
	margin: 0 0 20px;
	color: #555;
	font-size: 14px;
	line-height: 1.6;
}

.gbps-modal .gbps-qv__excerpt p:last-child { margin-bottom: 0; }

.gbps-modal .gbps-qv form.cart { margin: 0 0 12px; }

.gbps-modal .gbps-qv form.cart:not(.variations_form):not(.grouped_form),
.gbps-modal .gbps-qv .woocommerce-variation-add-to-cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.gbps-modal .gbps-qv form.cart .quantity { margin: 0; float: none; }
.gbps-modal .gbps-qv form.cart .button { float: none; margin: 0; }
.gbps-modal .gbps-qv table.variations { width: 100%; margin: 0 0 12px; border: 0; }
.gbps-modal .gbps-qv table.variations th,
.gbps-modal .gbps-qv table.variations td { padding: 4px 0; border: 0; background: none; text-align: left; vertical-align: middle; }
.gbps-modal .gbps-qv table.variations select { width: 100%; max-width: 320px; }

.gbps-modal .gbps-qv__notice:empty { display: none; }
.gbps-modal .gbps-qv__notice {
	margin: 0 0 12px;
	padding: 10px 12px;
	background: #f1f7f1;
	color: #2d5a2d;
	font-size: 14px;
}
.gbps-modal .gbps-qv__notice a { color: inherit; text-decoration: underline; margin-left: 4px; }

.gbps-modal .gbps-qv__link {
	display: inline-block;
	margin-top: 6px;
	color: #333;
	font-size: 13px;
	letter-spacing: .08em;
	text-transform: uppercase;
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (max-width: 767px) {
	.gbps-modal { padding: 0; align-items: flex-end; }
	.gbps-modal__dialog {
		width: 100%;
		max-height: 92vh;
		border-radius: 14px 14px 0 0;
		animation: gbps-sheet .28s ease;
	}
	.gbps-modal .gbps-qv.product {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
		padding: 20px;
	}
	.gbps-modal .gbps-qv__main { aspect-ratio: 1 / 1; }
	.gbps-modal .gbps-qv__title { font-size: 16px; }
}

@keyframes gbps-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gbps-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes gbps-sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes gbps-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.gbps *, .gbps-modal, .gbps-modal * { animation: none !important; transition: none !important; }
}
