/*
 * Maison Shariqa commerce layer.
 * Version: 1.0.2
 * Loaded only on WooCommerce catalog and single-product routes.
 */

/* Catalog controls: keep Glozin's filter form, remove only the two unrelated
 * WordPress block widgets that duplicate Archives/Catégories. */
.woocommerce .catalog-filters-horizontal #filter-sidebar-panel .sidebar__content > .widget_block:has(.wp-block-archives),
.woocommerce .catalog-filters-horizontal #filter-sidebar-panel .sidebar__content > .widget_block:has(.wp-block-categories) {
	display: none !important;
}

.woocommerce .catalog-filters-horizontal,
.woocommerce .catalog-toolbar,
.woocommerce .catalog-toolbar__toolbar,
.woocommerce .catalog-toolbar__item,
.woocommerce .catalog-toolbar__orderby-form,
.woocommerce #glozin-shop-content {
	min-width: 0;
	max-width: 100%;
}

.woocommerce .catalog-toolbar__result-count,
.woocommerce .catalog-toolbar__orderby-default,
.woocommerce .catalog-toolbar__orderby-button {
	white-space: normal;
}

/* Direct catalog cards are the only children targeted; quick-view clones are
 * rendered outside this list and keep their vendor layout. */
.woocommerce #glozin-shop-content > ul.products {
	justify-content: flex-start;
}

/* Product short description: render as a normal left-aligned paragraph. Some
 * imported descriptions contain long runs of spaces that otherwise spread the
 * two items to both edges and collide when they wrap on small screens. */
.single-product .short-description__content,
.single-product .short-description__content p,
.single-product .woocommerce-product-details__short-description,
.single-product .woocommerce-product-details__short-description p {
	white-space: normal !important;
	text-align: left !important;
	word-break: normal !important;
	overflow-wrap: anywhere;
}

.woocommerce #glozin-shop-content > ul.products > li.product {
	min-width: 0;
	margin-inline: 0;
}

/* Recently viewed uses the same product-card markup, but its carousel may
 * contain only one or two items. Center the sparse set without changing its
 * image, price, or variation content. */
.single-product .recently-viewed-products .products {
	justify-content: center;
}

.single-product .recently-viewed-products .products > li.product {
	min-width: 0;
}

.single-product .recently-viewed-products__title {
	color: var(--alsq-ink);
}

.alsq-commerce-progress {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	max-width: 100%;
	gap: 0.25rem;
}

/* Fast checkout: calm Maison surface, with the vendor form and submission
 * behavior left intact. */
.single-product #utopia-fast-checkout {
	width: 100%;
	max-width: 100%;
	margin-block: 1rem 1.5rem;
	border: 1px solid var(--alsq-border) !important;
	border-radius: var(--alsq-radius-md) !important;
	background: var(--alsq-surface) !important;
	box-shadow: var(--alsq-shadow-soft) !important;
	font-family: var(--alsq-body-font) !important;
	animation: none !important;
}

.single-product #utopia-fast-checkout h3 {
	margin: 0;
	border-radius: var(--alsq-radius-md) var(--alsq-radius-md) 0 0;
	background: var(--ufc-header-color, var(--alsq-brand)) !important;
	color: var(--alsq-ivory) !important;
	font-family: var(--alsq-body-font) !important;
	letter-spacing: 0.06em;
}

.single-product #fast-checkout-form {
	min-width: 0;
	max-width: 100%;
}

.single-product #utopia-fast-checkout .form-input-box {
	min-width: 0;
}

.single-product #utopia-fast-checkout .form-input-box p {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.single-product #utopia-fast-checkout .alsq-fast-label {
	color: var(--alsq-ink);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.25;
}

.single-product #utopia-fast-checkout .form-input-box p input,
.single-product #utopia-fast-checkout .form-input-box p select {
	min-width: 0;
	font-family: var(--alsq-body-font) !important;
	border-color: var(--alsq-border) !important;
	background: var(--alsq-surface-muted) !important;
	color: var(--alsq-ink) !important;
}

.single-product #utopia-fast-checkout .form-input-box p input:focus,
.single-product #utopia-fast-checkout .form-input-box p select:focus {
	border-color: var(--alsq-brand) !important;
	box-shadow: var(--alsq-shadow-focus) !important;
}

.single-product #utopia-fast-checkout .order-summary {
	border-color: var(--alsq-border);
	background: var(--alsq-surface-muted);
}

.single-product #utopia-fast-checkout .order-line.total {
	border-top-color: var(--alsq-brand);
}

.single-product #utopia-fast-checkout .utopia-fast-bottom-set {
	min-width: 0;
	align-items: stretch;
}

.single-product #utopia-fast-checkout .quantity-box {
	border-color: var(--alsq-border);
	background: var(--alsq-surface);
}

.single-product #utopia-fast-checkout .quantity-box span {
	min-width: 42px;
	min-height: 44px;
	color: var(--alsq-brand);
}

.single-product #utopia-fast-checkout .quantity-box span:focus-visible,
.single-product #utopia-fast-checkout .utopia-fast-bottom-set button:focus-visible {
	outline: 3px solid var(--alsq-bronze);
	outline-offset: 2px;
}

.single-product #utopia-fast-checkout .utopia-fast-bottom-set button.button.alt {
	min-width: 0;
	background: var(--ufc-btn-color, var(--alsq-brand)) !important;
	font-family: var(--alsq-body-font) !important;
	box-shadow: 0 5px 16px rgba(107, 14, 44, 0.18);
	animation: none !important;
}

.single-product #utopia-fast-checkout .utopia-fast-bottom-set button.button.alt:hover,
.single-product #utopia-fast-checkout .utopia-fast-bottom-set button.button.alt:focus-visible {
	background: var(--ufc-btn-hover-color, var(--alsq-bronze)) !important;
	box-shadow: 0 7px 20px rgba(107, 14, 44, 0.22);
}

.single-product #utopia-fast-checkout .fast-checkout-message {
	min-width: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
}

/* Standard WooCommerce add-to-cart remains available, but reads as the
 * secondary action beside the primary quick-order path. */
.single-product .summary form.variations_form .single_add_to_cart_button {
	width: 100% !important;
	min-width: 0;
	position: relative !important;
	left: auto !important;
	bottom: auto !important;
	margin-top: 0.75rem !important;
	border: 1px solid var(--alsq-brand) !important;
	border-radius: var(--alsq-radius-sm) !important;
	background: transparent !important;
	color: var(--alsq-brand) !important;
	box-shadow: none !important;
}

.single-product .summary form.variations_form .single_add_to_cart_button:hover:not(:disabled):not(.disabled),
.single-product .summary form.variations_form .single_add_to_cart_button:focus-visible:not(:disabled):not(.disabled) {
	background: var(--alsq-ivory) !important;
	color: var(--alsq-brand) !important;
}

.single-product .summary form.variations_form .single_add_to_cart_button.disabled,
.single-product .summary form.variations_form .single_add_to_cart_button:disabled {
	opacity: 0.58;
	cursor: not-allowed !important;
}

/* Filtered shipping promotions contain text only; keep the three neutral
 * items legible at every catalog width. */
.single-product .shipping-promotions-information {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	min-width: 0;
	max-width: 100%;
	background: var(--alsq-surface-muted);
	border-color: var(--alsq-border) !important;
}

.single-product .shipping-promotions-information__item {
	min-width: 0;
	max-width: 100%;
	border-color: var(--alsq-border);
}

.single-product .shipping-promotions-information__item img {
	display: none !important;
}

.single-product .shipping-promotions-information__description {
	max-width: 100%;
	color: var(--alsq-ink);
	overflow-wrap: anywhere;
}

.single-product .shipping-promotions-information__description a {
	color: var(--alsq-bronze);
	font-weight: 600;
}

@media (min-width: 768px) {
	.woocommerce #glozin-shop-content > ul.products > li.product {
		margin-inline: 0;
	}
}

@media (max-width: 767px) {
	/* The catalog is locked to two columns on small screens, so the view
	 * switcher is redundant. Give Filter and Sort equal, full-width tracks. */
	.woocommerce .catalog-toolbar__toolbar {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 10px;
		width: 100%;
		max-width: 100%;
	}

	.woocommerce .catalog-toolbar__left,
	.woocommerce .catalog-toolbar__right {
		width: auto;
		min-width: 0;
		flex: none;
		justify-content: stretch;
	}

	.woocommerce .catalog-toolbar__center,
	.woocommerce #glozin-toolbar-view {
		display: none !important;
	}

	.woocommerce .catalog-toolbar__filter-button,
	.woocommerce .catalog-toolbar__orderby-button {
		display: flex !important;
		align-items: center;
		justify-content: center;
		width: 100%;
		min-width: 0;
		min-height: 44px;
		margin: 0;
		white-space: normal;
	}

	.woocommerce #glozin-shop-content > ul.products {
		justify-content: flex-start;
		column-gap: 15px;
		row-gap: 30px;
	}

	.woocommerce #glozin-shop-content > ul.products > li.product {
		flex: 0 1 calc(50% - 7.5px);
		width: calc(50% - 7.5px);
		max-width: calc(50% - 7.5px);
	}

	.single-product #utopia-fast-checkout .utopia-fast-bottom-set {
		gap: 8px;
	}

	.single-product #utopia-fast-checkout .quantity-box {
		width: 110px;
	}

	.single-product .shipping-promotions-information {
		grid-template-columns: 1fr;
	}

	.single-product .shipping-promotions-information__item {
		min-height: 56px;
		padding-block: 0.75rem;
	}

	.single-product .recently-viewed-products .products {
		column-gap: 15px;
	}
}

/* ============================================================
 * Refonte catalog cards — match the homepage product treatment
 * store-wide (shop, category, search, related, recently viewed).
 * ============================================================ */
.woocommerce ul.products li.product .product-thumbnail {
	border-radius: var(--alsq-radius-md);
	background: #ffffff;
	box-shadow: 0 10px 28px rgba(77, 8, 31, 0.07);
	overflow: hidden;
}

.woocommerce ul.products li.product .product-thumbnail > a.gz-ratio {
	position: relative !important;
	display: block !important;
	height: auto !important;
	padding-top: 0 !important;
	aspect-ratio: 3 / 4;
}

.woocommerce ul.products li.product .product-thumbnail > a.gz-ratio > img {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	object-fit: cover !important;
}

/* Keep only the bottom slide-up quick-add; hide the hover icon column. */
.woocommerce ul.products li.product .product-featured-icons--primary {
	display: none !important;
}

.woocommerce ul.products li.product .product-featured-icons--second {
	inset: auto 0 0 0;
	padding: 0;
	gap: 0;
}

.woocommerce ul.products li.product .product-featured-icons--second .product-loop-button,
.woocommerce ul.products li.product .product-featured-icons--second a.button {
	width: 100%;
	min-height: 46px;
	border: 0 !important;
	border-radius: 0 !important;
	background: var(--alsq-brand) !important;
	color: var(--alsq-ivory) !important;
	font-family: var(--alsq-body-font) !important;
	font-size: 0.72rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.14em !important;
	text-transform: uppercase !important;
}

.woocommerce ul.products li.product .product-featured-icons--second .product-loop-button:hover,
.woocommerce ul.products li.product .product-featured-icons--second a.button:hover {
	background: var(--alsq-brand-deep) !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--alsq-display-font) !important;
	font-size: 1.12rem !important;
	font-weight: 600;
	line-height: 1.3;
}

.woocommerce ul.products li.product .woocommerce-badge {
	min-width: 0;
	padding: 0.4rem 0.7rem;
	border-radius: 999px;
	box-shadow: none;
	font-size: 0.72rem;
	font-weight: 700;
}

.woocommerce ul.products li.product .woocommerce-badge.new {
	background: var(--alsq-brand) !important;
	color: var(--alsq-ivory) !important;
}

.woocommerce ul.products li.product .product-summary {
	margin-top: 1rem !important;
}

.woocommerce ul.products li.product .price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 0.35rem;
	font-weight: 700;
}

.woocommerce ul.products li.product .price del {
	opacity: 0.68;
}

.woocommerce ul.products li.product .price ins {
	text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
	.single-product #utopia-fast-checkout,
	.single-product #utopia-fast-checkout * {
		animation: none !important;
		transition-duration: 0.01ms !important;
	}
}
