/* ============================================================
 * Mtech — Single Product Page (PDP) redesign
 * Template: woocommerce/content-single-product.php
 * Colours: primary blue #135289, green #009245, ink #111827.
 * ============================================================ */

.woocommerce div.product.mtech-single,
.mtech-single {
	--sp-blue: #135289;
	--sp-blue-d: #0e3f6b;
	--sp-green: #009245;
	--sp-ink: #111827;
	--sp-muted: #6b7280;
	--sp-line: #e5e7eb;
	--sp-bg: #f7f8fa;
}

/* Own the layout: our template controls the block flow, not the theme's floats/flex. */
.woocommerce div.product.mtech-single { display: block !important; }
.woocommerce div.product.mtech-single > .mtech-sp-main { clear: both; }
.mtech-single .woocommerce-product-gallery { float: none !important; width: 100% !important; margin: 0 !important; }
.mtech-single .summary.mtech-sp-summary { float: none !important; width: 100% !important; margin: 0 !important; }
/* Stray Shoptimizer bits that now land inside the price card */
.mtech-single .summary.mtech-sp-summary #shoptimizer-modals-wrapper:empty { display: none; }
.mtech-single .summary.mtech-sp-summary .product-widget:empty { display: none; }
/* Join.chat "Order On WhatsApp" Woo button: redundant on priced products (Add to
   Cart is the CTA). Kept on call-for-price products so they still have a CTA.
   NB: keep the sibling `.clear` div — it clears the price float. */
.woocommerce div.product.mtech-has-price .joinchat__woo-btn__wrapper { display: none !important; }

/* ---------- Header ---------- */
.mtech-sp-header { margin: 4px 0 18px; }
.mtech-single h1.product_title.entry-title {
	font-size: clamp(21px, 1.2rem + 1vw, 30px) !important;
	font-weight: 800 !important;
	color: var(--sp-ink) !important;
	line-height: 1.2 !important;
	margin: 0 0 8px !important;
	padding: 0 !important;
}
.mtech-sp-specline {
	color: #374151;
	font-size: 15px;
	line-height: 1.55;
	margin: 0 0 10px;
	max-width: 900px;
}
.mtech-sp-specline p { margin: 0; }
.mtech-sp-specline ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.mtech-sp-specline ul li { position: relative; padding-left: 14px; }
.mtech-sp-specline ul li::before { content: "•"; position: absolute; left: 0; color: var(--sp-blue); }

.mtech-sp-metarow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mtech-single .mtech-sp-metarow .star-rating { margin: 0; float: none; font-size: 15px; }
.mtech-single .mtech-sp-metarow .woocommerce-review-link { color: var(--sp-muted); font-size: 13.5px; }

.mtech-sp-brand {
	margin-left: auto;
	display: inline-flex; align-items: center;
	font-weight: 800; font-size: 13px; letter-spacing: .3px; text-transform: uppercase;
	color: #fff; background: var(--sp-blue);
	padding: 5px 12px; border-radius: 6px; text-decoration: none;
}
.mtech-sp-brand:hover { background: var(--sp-blue-d); color: #fff; }

/* ---------- Two-column main ---------- */
.mtech-sp-main {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
	gap: 34px;
	align-items: start;
	margin-bottom: 30px;
}

/* Gallery */
.mtech-sp-gallery { position: relative; min-width: 0; }
.mtech-single .woocommerce-product-gallery {
	border: 1px solid var(--sp-line);
	border-radius: 12px;
	padding: 14px;
	background: #fff;
}
.mtech-single .flex-viewport { border-radius: 8px; }
.mtech-single .woocommerce-product-gallery__wrapper img { border-radius: 8px; }
/* Horizontal thumbnail rail */
.mtech-single .flex-control-thumbs { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mtech-single .flex-control-thumbs li { width: auto !important; margin: 0 !important; }
.mtech-single .flex-control-thumbs img {
	width: 62px; height: 62px; object-fit: contain;
	border: 1px solid var(--sp-line); border-radius: 8px; padding: 4px; background: #fff;
	opacity: 1; transition: border-color .15s ease;
}
.mtech-single .flex-control-thumbs img.flex-active,
.mtech-single .flex-control-thumbs img:hover { border-color: var(--sp-blue); }

/* Delivery banner under gallery */
.mtech-sp-delivery {
	display: flex; align-items: center; gap: 9px;
	margin-top: 12px; padding: 11px 14px;
	background: #eef4fb; border: 1px solid #d6e4f3; border-radius: 10px;
	color: #1f4e79; font-size: 14px; font-weight: 600;
}
.mtech-sp-delivery svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--sp-blue); }

/* ---------- Summary / price card ---------- */
.mtech-single .summary.mtech-sp-summary {
	border: 1px solid var(--sp-line);
	border-radius: 12px;
	padding: 20px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

/* Stock */
.mtech-sp-stock { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.mtech-sp-stock svg { width: 26px; height: 26px; flex: 0 0 26px; }
.mtech-sp-stock strong { display: block; font-size: 15px; color: var(--sp-ink); line-height: 1.1; }
.mtech-sp-stock.is-in strong { color: var(--sp-green); }
.mtech-sp-stock span { display: block; font-size: 12.5px; color: var(--sp-muted); }

/* Price */
.mtech-single .summary.mtech-sp-summary .price {
	margin: 0 0 16px !important;
	color: var(--sp-ink) !important;
	font-size: 30px !important;
	font-weight: 800 !important;
	line-height: 1.1 !important;
	float: none !important;
	clear: both !important;
	display: block !important;
	width: 100% !important;
}
.mtech-single .summary.mtech-sp-summary .price del { font-size: 17px; font-weight: 600; opacity: .55; }
.mtech-single .summary.mtech-sp-summary .price ins { text-decoration: none; }
.mtech-single .summary.mtech-sp-summary .price .woocommerce-price-suffix { font-size: 12.5px; font-weight: 600; color: var(--sp-muted); }

/* Trust points */
.mtech-sp-trust { list-style: none; clear: both; margin: 0 0 18px; padding: 16px 0; border-top: 1px solid var(--sp-line); border-bottom: 1px solid var(--sp-line); display: grid; gap: 12px; }
.mtech-sp-trust li { display: flex; align-items: center; gap: 11px; margin: 0; }
.mtech-sp-trust-icon { display: inline-flex; width: 34px; height: 34px; flex: 0 0 34px; align-items: center; justify-content: center; border-radius: 8px; background: var(--sp-bg); color: var(--sp-blue); }
.mtech-sp-trust-icon svg { width: 19px; height: 19px; }
.mtech-sp-trust-txt strong { display: block; font-size: 14px; color: var(--sp-ink); line-height: 1.15; }
.mtech-sp-trust-txt span { display: block; font-size: 12.5px; color: var(--sp-muted); }

/* Add to cart form */
.mtech-single .summary.mtech-sp-summary form.cart { margin: 0 0 14px !important; display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.mtech-single .summary.mtech-sp-summary form.cart .quantity { margin: 0 !important; }
.mtech-single .summary.mtech-sp-summary form.cart .quantity input.qty {
	height: 52px; width: 74px; border: 1px solid var(--sp-line); border-radius: 8px;
	font-size: 16px; text-align: center;
}
.mtech-single .summary.mtech-sp-summary form.cart button.single_add_to_cart_button {
	flex: 1 1 auto; min-width: 180px;
	height: 52px; border-radius: 8px !important;
	background: var(--sp-blue) !important; color: #fff !important;
	font-size: 16px !important; font-weight: 700 !important;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border: none !important; box-shadow: none !important; transition: background .15s ease;
}
.mtech-single .summary.mtech-sp-summary form.cart button.single_add_to_cart_button:hover { background: var(--sp-blue-d) !important; }
/* Variations table tidy */
.mtech-single .summary.mtech-sp-summary form.cart .variations { margin-bottom: 10px; }
.mtech-single .summary.mtech-sp-summary form.cart.variations_form { display: block; }

/* Compare / Wishlist / Share row */
.mtech-sp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.mtech-sp-act { flex: 1 1 0; min-width: 96px; }
.mtech-sp-act,
.mtech-sp-act a,
.mtech-sp-act .compare-button a,
.mtech-sp-act button,
.mtech-sp-act .yith-wcwl-add-to-wishlist a {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	width: 100%; box-sizing: border-box;
	height: 42px; padding: 0 10px;
	border: 1px solid var(--sp-line) !important; border-radius: 8px !important;
	background: #fff !important; color: #374151 !important;
	font-size: 13.5px !important; font-weight: 600 !important;
	text-decoration: none !important; cursor: pointer;
	transition: border-color .15s ease, color .15s ease;
}
.mtech-sp-act:hover a,
.mtech-sp-act button:hover,
.mtech-sp-act:hover .yith-wcwl-add-to-wishlist a { border-color: var(--sp-blue) !important; color: var(--sp-blue) !important; }
.mtech-sp-act svg { width: 17px; height: 17px; }
/* Normalise YITH internals so they sit inside our pills */
.mtech-sp-act .yith-wcwl-add-button,
.mtech-sp-act .yith-compare-button,
.mtech-sp-act .compare-button,
.mtech-sp-act .woocommerce.product.compare-button,
.mtech-sp-act .yith-add-to-wishlist-button-block { margin: 0 !important; width: 100%; }
.mtech-sp-act .yith-wcwl-wishlistaddedbrowse,
.mtech-sp-act .yith-wcwl-wishlistexistsbrowse { display: inline-flex !important; }
.mtech-sp-act .yith-wcwl-add-to-wishlist { margin: 0 !important; }
.mtech-sp-act .compare.button .label,
.mtech-sp-act .yith-wcwl-add-to-wishlist a span { line-height: 1; }
.mtech-sp-share span { line-height: 1; }

/* ---------- Key Features grid ---------- */
.mtech-sp-features { margin: 6px 0 30px; }
.mtech-sp-features-title,
.mtech-single .mtech-sp-features h2 { font-size: 19px; font-weight: 800; color: var(--sp-ink); margin: 0 0 14px; }
.mtech-sp-fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mtech-sp-fcard {
	display: flex; align-items: center; gap: 12px;
	border: 1px solid var(--sp-line); border-radius: 10px; padding: 13px 15px; background: #fff;
}
.mtech-sp-ficon { display: inline-flex; width: 38px; height: 38px; flex: 0 0 38px; align-items: center; justify-content: center; border-radius: 9px; background: var(--sp-bg); color: var(--sp-blue); }
.mtech-sp-ficon svg { width: 21px; height: 21px; }
.mtech-sp-fbody { min-width: 0; }
.mtech-sp-flabel { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--sp-muted); font-weight: 600; }
.mtech-sp-fvalue { display: block; font-size: 14.5px; font-weight: 700; color: var(--sp-ink); line-height: 1.25; }

/* ---------- Tabs ---------- */
.mtech-single .woocommerce-tabs { margin-top: 8px; }
.mtech-single .woocommerce-tabs ul.tabs { padding: 0 !important; margin: 0 0 20px !important; border-bottom: 1px solid var(--sp-line); display: flex; flex-wrap: wrap; gap: 4px; background: none; }
.mtech-single .woocommerce-tabs ul.tabs::before, .mtech-single .woocommerce-tabs ul.tabs::after { display: none !important; }
.mtech-single .woocommerce-tabs ul.tabs li {
	background: none !important; border: none !important; border-radius: 0 !important;
	margin: 0 !important; padding: 0 !important;
}
.mtech-single .woocommerce-tabs ul.tabs li::before, .mtech-single .woocommerce-tabs ul.tabs li::after { display: none !important; }
.mtech-single .woocommerce-tabs ul.tabs li a {
	display: block; padding: 10px 16px !important; font-weight: 700; font-size: 15px;
	color: var(--sp-muted) !important; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.mtech-single .woocommerce-tabs ul.tabs li.active a { color: var(--sp-blue) !important; border-bottom-color: var(--sp-blue); }
.mtech-single .woocommerce-tabs .panel { color: #374151; font-size: 15px; line-height: 1.7; }
.mtech-single .woocommerce-tabs .panel h2:first-child { margin-top: 0; }

/* ---------- Related products ---------- */
.mtech-single .related.products,
.mtech-single .upsells.products { clear: both; margin-top: 34px; }
.mtech-single .related.products > h2,
.mtech-single .upsells.products > h2 { font-size: 20px; font-weight: 800; color: var(--sp-ink); margin: 0 0 16px; }

/* ---------- Sticky summary (desktop) + responsive ---------- */
@media (min-width: 992px) {
	.mtech-single .summary.mtech-sp-summary { position: sticky; top: 90px; }
}

@media (max-width: 991px) {
	/* Mobile stacking order: IMAGE first, then title/short-desc, then price card,
	   then features/tabs/related. .mtech-sp-main is flattened (display:contents) so
	   the gallery & summary become direct flex items we can reorder. */
	.woocommerce div.product.mtech-single { display: flex !important; flex-direction: column; gap: 18px; }
	.mtech-single .mtech-sp-main { display: contents; }
	.mtech-single .mtech-sp-gallery { order: 1; }
	.mtech-single .mtech-sp-header { order: 2; margin: 0; }
	.mtech-single .summary.mtech-sp-summary { order: 3; }
	.mtech-single .mtech-sp-features { order: 4; margin: 0; }
	.mtech-single .woocommerce-tabs { order: 5; margin: 0; }
	.mtech-single .related-wrapper,
	.mtech-single .related.products,
	.mtech-single .upsells.products { order: 6; }

	.mtech-sp-brand { margin-left: 0; }
	.mtech-sp-fgrid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
	.mtech-sp-fgrid { grid-template-columns: 1fr; }
	.mtech-single .summary.mtech-sp-summary { padding: 16px; }
	.mtech-single .summary.mtech-sp-summary form.cart button.single_add_to_cart_button { min-width: 140px; }
	.mtech-sp-act { min-width: 0; }
	.mtech-sp-act span:not(.mtech-sp-share span) { font-size: 12.5px; }
}
