/*
 * NeoGrow Genz Electro Child - single-product layout.
 *
 * Everything is scoped under `body.ng-single-product`, so shop archives,
 * category pages, cart, checkout and account templates are untouched.
 * Box offsets use logical properties (inline/block) so the same file serves
 * English and Arabic without a second RTL stylesheet.
 */

body.ng-single-product {
	/* Genz Mobile design tokens. Also read by the plugin stylesheet. */
	--ng-primary: #34dde4;
	--ng-primary-dark: #259da2;
	--ng-deep: #0f4f52;
	--ng-dark: #101718;
	--ng-text: #35484b;
	--ng-muted: #6f8285;
	--ng-line: #e3eaec;
	--ng-surface: #f7fafb;
	--ng-success: #168a55;
	--ng-sale: #d63f44;
	--ng-radius: 10px;
	--ng-gutter: clamp(14px, 2.4vw, 34px);
	--ng-max: 1520px;

	background: #fff;
}

/* -------------------------------------------------------------------------
 * Full-width shell
 *
 * Electro's header opens a Bootstrap container that would otherwise cap the
 * page width. The single-product template never calls
 * `woocommerce_before_main_content`, so the narrow content column and the
 * sidebar are already gone; these rules release the remaining wrapper.
 * ---------------------------------------------------------------------- */

body.ng-single-product #content > .container,
body.ng-single-product .site-content > .container,
body.ng-single-product .site-content,
body.ng-single-product #content,
body.ng-single-product .ng-shell,
body.ng-single-product .ng-shell__main {
	width: 100%;
	max-width: none;
	padding-inline: 0;
	margin-inline: 0;
	float: none;
}

body.ng-single-product #secondary,
body.ng-single-product .sidebar,
body.ng-single-product .widget-area,
body.ng-single-product .sidebar-shop,
body.ng-single-product .shop-sidebar {
	display: none;
}

body.ng-single-product .ng-product,
body.ng-single-product .ng-product *,
body.ng-single-product .ng-product *::before,
body.ng-single-product .ng-product *::after {
	box-sizing: border-box;
}

body.ng-single-product .ng-product {
	width: min(var(--ng-max), 100% - (var(--ng-gutter) * 2));
	margin-inline: auto;
	padding-block: 14px 60px;
	color: var(--ng-text);
	/*
	 * No overflow value here on purpose: this element is an ancestor of the
	 * sticky purchase column. Horizontal clipping happens on
	 * .ng-product-long-content instead, which is not an ancestor of it.
	 */
}

body.ng-single-product .ng-product__hooked:empty {
	display: none;
}

/* -------------------------------------------------------------------------
 * Breadcrumb
 * ---------------------------------------------------------------------- */

body.ng-single-product .ng-product__breadcrumb {
	max-width: 100%;
	margin-block-end: 14px;
	overflow-x: auto;
	scrollbar-width: thin;
}

body.ng-single-product .ng-product__breadcrumb .woocommerce-breadcrumb {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	color: var(--ng-muted);
	font-size: 12px;
	line-height: 1.6;
	white-space: nowrap;
}

body.ng-single-product .ng-product__breadcrumb a {
	color: var(--ng-text);
	text-decoration: none;
}

body.ng-single-product .ng-product__breadcrumb a:hover {
	color: var(--ng-primary-dark);
	text-decoration: underline;
}

body.ng-single-product .ng-product__breadcrumb-sep {
	color: #b6c3c5;
}

/* -------------------------------------------------------------------------
 * Purchase card media slot
 *
 * The gallery component brings its own frame, so the slot is a bare wrapper.
 * ---------------------------------------------------------------------- */

body.ng-single-product .ng-product__media {
	min-width: 0;
}

body.ng-single-product .ng-product__buy {
	min-width: 0;
}

/* -------------------------------------------------------------------------
 * Legacy gallery safety net
 *
 * The NeoGrow gallery component owns the media column. These two rules only
 * matter when the engine plugin is inactive and WooCommerce renders its own
 * gallery as the documented fallback.
 * ---------------------------------------------------------------------- */

body.ng-single-product.ng-no-engine .ng-product__media .woocommerce-product-gallery {
	width: 100%;
	margin: 0;
	opacity: 1 !important;
}

body.ng-single-product.ng-no-engine .ng-product__media .woocommerce-product-gallery__image img {
	display: block;
	width: 100%;
	height: auto;
	max-height: min(60vh, 560px);
	margin-inline: auto;
	object-fit: contain;
}
/* -------------------------------------------------------------------------
 * Purchase column
 * ---------------------------------------------------------------------- */

body.ng-single-product .ng-product__buy .summary {
	width: 100%;
	margin: 0;
	padding: 0;
	float: none;
}

body.ng-single-product .ng-product__buy .product_title {
	margin: 0 0 8px;
	color: var(--ng-dark);
	font-size: clamp(22px, 2vw, 32px);
	font-weight: 700;
	line-height: 1.25;
}

body.ng-single-product .ng-product__buy .woocommerce-product-rating {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 6px;
	font-size: 12px;
}

body.ng-single-product .ng-product__buy .star-rating {
	color: #efa920;
	font-size: 13px;
}

body.ng-single-product .ng-product__buy .woocommerce-review-link {
	color: var(--ng-muted);
	text-decoration: none;
}

body.ng-single-product .ng-product__buy .product_meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin: 0 0 12px;
	padding: 0 0 12px;
	border-block-end: 1px solid var(--ng-line);
	color: var(--ng-muted);
	font-size: 12px;
	line-height: 1.6;
}

body.ng-single-product .ng-product__buy .product_meta > span {
	margin: 0;
}

body.ng-single-product .ng-product__buy .product_meta a {
	color: var(--ng-primary-dark);
	text-decoration: none;
}

body.ng-single-product .ng-product__buy .price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
	margin: 0 0 4px;
	color: var(--ng-sale);
	font-size: clamp(24px, 2.2vw, 34px);
	font-weight: 800;
	line-height: 1.2;
}

body.ng-single-product .ng-product__buy .price del {
	color: var(--ng-muted);
	font-size: 0.52em;
	font-weight: 500;
	opacity: 1;
}

body.ng-single-product .ng-product__buy .price ins {
	background: none;
	text-decoration: none;
}

body.ng-single-product .ng-product__saving {
	display: inline-block;
	margin: 0 0 10px;
	padding: 4px 9px;
	border-radius: 6px;
	background: rgba(214, 63, 68, 0.1);
	color: var(--ng-sale);
	font-size: 12px;
	font-weight: 700;
}

body.ng-single-product .ng-product__buy .stock {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0 0 12px;
	padding: 6px 11px;
	border-radius: 7px;
	font-size: 12px;
	font-weight: 700;
}

body.ng-single-product .ng-product__buy .stock::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}

body.ng-single-product .ng-product__buy .stock.in-stock,
body.ng-single-product .ng-product__buy .stock.available-on-backorder {
	background: rgba(22, 138, 85, 0.1);
	color: var(--ng-success);
}

body.ng-single-product .ng-product__buy .stock.out-of-stock {
	background: rgba(214, 63, 68, 0.1);
	color: var(--ng-sale);
}

/* Cart form */

body.ng-single-product .ng-product__buy form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 4px;
}

body.ng-single-product .ng-product__buy form.cart::before,
body.ng-single-product .ng-product__buy form.cart::after {
	display: none;
}

body.ng-single-product .ng-product__buy table.variations,
body.ng-single-product .ng-product__buy .woocommerce-variation-add-to-cart,
body.ng-single-product .ng-product__buy .woocommerce-variation,
body.ng-single-product .ng-product__buy .single_variation_wrap {
	width: 100%;
	flex: 0 0 100%;
}

body.ng-single-product .ng-product__buy table.variations {
	margin: 0 0 8px;
	border: 0;
}

body.ng-single-product .ng-product__buy table.variations tr,
body.ng-single-product .ng-product__buy table.variations th,
body.ng-single-product .ng-product__buy table.variations td {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	text-align: start;
}

body.ng-single-product .ng-product__buy table.variations th {
	padding-block: 10px 2px;
}

body.ng-single-product .ng-product__buy table.variations label {
	color: var(--ng-dark);
	font-size: 12px;
	font-weight: 700;
}

body.ng-single-product .ng-product__buy table.variations select {
	width: 100%;
	min-height: 46px;
	padding-inline: 12px;
	border: 1px solid var(--ng-line);
	border-radius: 8px;
	background: #fff;
	color: var(--ng-dark);
}

body.ng-single-product .ng-product__buy .reset_variations {
	display: inline-block;
	margin-block-start: 8px;
	color: var(--ng-muted);
	font-size: 12px;
}

body.ng-single-product .ng-product__buy .woocommerce-variation-price {
	margin-block: 10px 4px;
}

body.ng-single-product .ng-product__buy .woocommerce-variation-add-to-cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

body.ng-single-product .ng-product__buy .quantity {
	margin: 0;
	flex: 0 0 auto;
}

body.ng-single-product .ng-product__buy .quantity .qty {
	width: 78px;
	min-width: 78px;
	height: 50px;
	padding-inline: 8px;
	border: 1px solid var(--ng-line);
	border-radius: 8px;
	background: #fff;
	color: var(--ng-dark);
	font-weight: 600;
	text-align: center;
}

body.ng-single-product .ng-product__buy .single_add_to_cart_button {
	min-height: 50px;
	flex: 1 1 170px;
	margin: 0;
	padding-inline: 22px;
	border: 1px solid var(--ng-line);
	border-radius: 8px;
	background: var(--ng-primary);
	color: var(--ng-deep);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	transition: background-color 0.15s ease, color 0.15s ease;
}

body.ng-single-product .ng-product__buy .single_add_to_cart_button:hover,
body.ng-single-product .ng-product__buy .single_add_to_cart_button:focus-visible {
	background: var(--ng-primary-dark);
	color: #fff;
}

body.ng-single-product .ng-product__buy .single_add_to_cart_button.disabled,
body.ng-single-product .ng-product__buy .single_add_to_cart_button:disabled {
	background: var(--ng-surface);
	color: var(--ng-muted);
	cursor: not-allowed;
}

body.ng-single-product .ng-product__buy .woocommerce-variation-availability .stock {
	margin-block: 8px 0;
}

/* Anything the theme cannot predict (add-ons, wishlist rows) still fits. */
body.ng-single-product .ng-product__buy .yith-wcwl-add-to-wishlist,
body.ng-single-product .ng-product__buy .compare-button {
	flex: 0 0 100%;
	margin-block-start: 10px;
	font-size: 12px;
}

/* -------------------------------------------------------------------------
 * About panel
 * ---------------------------------------------------------------------- */

body.ng-single-product .ng-product__about-title {
	margin: 0 0 10px;
	color: var(--ng-dark);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
}

/* -------------------------------------------------------------------------
 * Sections
 * ---------------------------------------------------------------------- */

body.ng-single-product .ng-product__section {
	margin-block-start: 34px;
}

body.ng-single-product .ng-product__section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-block-end: 14px;
	padding-block-end: 10px;
	border-block-end: 1px solid var(--ng-line);
}

body.ng-single-product .ng-product__section-title {
	margin: 0;
	color: var(--ng-dark);
	font-size: clamp(18px, 1.6vw, 24px);
	font-weight: 700;
	line-height: 1.3;
}

/* Product description */

body.ng-single-product .ng-product__content {
	max-width: 1080px;
	margin-inline: auto;
	color: var(--ng-text);
	font-size: 15px;
	line-height: 1.85;
	overflow-wrap: break-word;
}

body.ng-single-product .ng-product__content > *:first-child {
	margin-block-start: 0;
}

body.ng-single-product .ng-product__content img,
body.ng-single-product .ng-product__content video,
body.ng-single-product .ng-product__content iframe {
	display: block;
	max-width: 100%;
	height: auto;
	margin-inline: auto;
}

body.ng-single-product .ng-product__content iframe {
	aspect-ratio: 16 / 9;
	width: 100%;
	border: 0;
}

body.ng-single-product .ng-product__content h2,
body.ng-single-product .ng-product__content h3,
body.ng-single-product .ng-product__content h4 {
	margin-block: 26px 10px;
	color: var(--ng-dark);
	line-height: 1.35;
}

body.ng-single-product .ng-product__content ul,
body.ng-single-product .ng-product__content ol {
	padding-inline-start: 22px;
}

body.ng-single-product .ng-product__content table {
	display: block;
	width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
}

body.ng-single-product .ng-product__content table th,
body.ng-single-product .ng-product__content table td {
	padding: 9px 12px;
	border: 1px solid var(--ng-line);
	text-align: start;
}

/* Product loops (related, recently viewed) */

body.ng-single-product .ng-product__section ul.products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

body.ng-single-product .ng-product__section ul.products::before,
body.ng-single-product .ng-product__section ul.products::after {
	display: none;
}

body.ng-single-product .ng-product__section ul.products li.product {
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 14px;
	border: 1px solid var(--ng-line);
	border-radius: 12px;
	background: #fff;
	text-align: start;
}

body.ng-single-product .ng-product__section ul.products li.product img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	margin-inline: auto;
	object-fit: contain;
}

body.ng-single-product .ng-product__section ul.products .woocommerce-loop-product__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	margin-block: 8px 6px;
	padding: 0;
	color: var(--ng-dark);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.45;
}

body.ng-single-product .ng-product__section ul.products .price {
	display: block;
	margin-block-end: 8px;
	color: var(--ng-sale);
	font-size: 14px;
	font-weight: 700;
}

body.ng-single-product .ng-product__section ul.products .price del {
	color: var(--ng-muted);
	font-size: 0.8em;
	font-weight: 500;
}

body.ng-single-product .ng-product__section ul.products .button {
	display: block;
	width: 100%;
	min-height: 40px;
	padding: 10px 12px;
	border: 0;
	border-radius: 7px;
	background: var(--ng-surface);
	color: var(--ng-dark);
	font-size: 12px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}

body.ng-single-product .ng-product__section ul.products .button:hover {
	background: var(--ng-primary);
	color: var(--ng-deep);
}

/* -------------------------------------------------------------------------
 * Reviews
 * ---------------------------------------------------------------------- */

body.ng-single-product .ng-product__section--reviews #reviews {
	padding: 20px;
	border: 1px solid var(--ng-line);
	border-radius: var(--ng-radius);
	background: #fff;
}

body.ng-single-product .ng-product__section--reviews #reviews > h2:first-child,
body.ng-single-product .ng-product__section--reviews #comments > h2:first-child {
	margin-block-start: 0;
	font-size: 16px;
}

body.ng-single-product .ng-product__section--reviews .commentlist {
	margin: 0;
	padding: 0;
	list-style: none;
}

body.ng-single-product .ng-product__section--reviews .commentlist li {
	margin-block-end: 14px;
	padding-block-end: 14px;
	border-block-end: 1px solid var(--ng-line);
	list-style: none;
}

body.ng-single-product .ng-product__section--reviews .comment-form label {
	display: block;
	margin-block-end: 4px;
	font-size: 13px;
	font-weight: 600;
}

body.ng-single-product .ng-product__section--reviews .comment-form input[type="text"],
body.ng-single-product .ng-product__section--reviews .comment-form input[type="email"],
body.ng-single-product .ng-product__section--reviews .comment-form textarea {
	width: 100%;
	max-width: 560px;
	padding: 10px 12px;
	border: 1px solid var(--ng-line);
	border-radius: 8px;
}

/* -------------------------------------------------------------------------
 * Focus visibility
 * ---------------------------------------------------------------------- */

body.ng-single-product .ng-product a:focus-visible,
body.ng-single-product .ng-product button:focus-visible,
body.ng-single-product .ng-product input:focus-visible,
body.ng-single-product .ng-product select:focus-visible,
body.ng-single-product .ng-product textarea:focus-visible {
	outline: 2px solid var(--ng-primary-dark);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Tablet: gallery and purchase stay side by side, About moves below
 * ---------------------------------------------------------------------- */

@media (max-width: 1199px) {
	body.ng-single-product .ng-product__hero {
		grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
	}

	body.ng-single-product .ng-product__about {
		grid-column: 1 / -1;
	}

	body.ng-single-product .ng-product__section ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* -------------------------------------------------------------------------
 * Mobile
 * ---------------------------------------------------------------------- */

@media (max-width: 767px) {
	body.ng-single-product .ng-product {
		width: min(var(--ng-max), 100% - 24px);
		padding-block: 8px 40px;
	}

	body.ng-single-product .ng-product__hero {
		display: flex;
		flex-direction: column;
		gap: 14px;
	}

	body.ng-single-product .ng-product__media,
	body.ng-single-product .ng-product__about {
		padding: 12px;
	}

	body.ng-single-product .ng-product__media .woocommerce-product-gallery__image img {
		max-height: 62vh;
	}

	body.ng-single-product .ng-product__media .flex-control-thumbs li {
		flex-basis: 58px;
	}

	body.ng-single-product .ng-product__media .flex-control-thumbs img {
		width: 58px;
		height: 58px;
	}

	body.ng-single-product .ng-product__buy .quantity .qty {
		width: 72px;
		min-width: 72px;
	}

	body.ng-single-product .ng-product__buy .single_add_to_cart_button {
		flex: 1 1 140px;
	}

	body.ng-single-product .ng-product__section {
		margin-block-start: 26px;
	}

	body.ng-single-product .ng-product__section ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	body.ng-single-product .ng-product__section ul.products li.product {
		padding: 10px;
	}

	body.ng-single-product .ng-product__section--reviews #reviews {
		padding: 14px;
	}

	body.ng-single-product .ng-product__content {
		font-size: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.ng-single-product .ng-product * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
