/**
 * HM Shop — Single Product Page Styles (v2)
 *
 * עיצוב עמוד מוצר אינהאוס. נטען רק כאשר ?v2=1 ועמוד הוא singular(product).
 *
 * @package HM_Shop\Frontend
 * @since   2026-05-31
 */

.hm-shop-product-section {
	padding: 32px 0 64px;
}

.hm-shop-product-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
	margin-bottom: 48px;
}

@media (min-width: 900px) {
	.hm-shop-product-grid {
		/* בעברית/RTL — הטור הראשון הוא הימני (גלריה גדולה). */
		grid-template-columns: 1.6fr 1fr;
	}
}

/* === Gallery === */

.hm-shop-product-gallery {
	min-width: 0;
}

.hm-shop-product-main-image {
	background: #f4f5f7;
	border-radius: 16px;
	overflow: hidden;
	position: relative;
	aspect-ratio: 4 / 3;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hm-shop-product-main-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.hm-shop-zoom-trigger {
	all: unset;
	cursor: zoom-in;
	display: block;
	width: 100%;
	height: 100%;
}

.hm-shop-zoom-trigger:focus-visible {
	outline: 3px solid #f59e0b;
	outline-offset: 2px;
}

.hm-shop-product-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.hm-shop-thumb {
	all: unset;
	cursor: pointer;
	border: 2px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	width: 72px;
	height: 72px;
	background: #f4f5f7;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hm-shop-thumb.is-active {
	border-color: #f59e0b;
}

.hm-shop-thumb:focus-visible {
	outline: 2px solid #f59e0b;
	outline-offset: 2px;
}

.hm-shop-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* === Summary (right column on RTL = appears on left visually in LTR) === */

.hm-shop-product-summary {
	min-width: 0;
}

.hm-shop-product-title {
	font-size: 28px;
	line-height: 1.25;
	margin: 0 0 16px;
	color: #1f2937;
}

.hm-shop-product-sku,
.hm-shop-product-vendor {
	margin: 0 0 8px;
	color: #6b7280;
	font-size: 14px;
}

.hm-shop-product-sku .label,
.hm-shop-product-vendor .label {
	font-weight: 600;
	color: #374151;
}

.hm-shop-product-price {
	margin: 24px 0 16px;
	padding: 16px;
	background: #fff7ed;
	border: 1px solid #fde7c2;
	border-radius: 12px;
}

.hm-shop-price-member {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 8px;
}

.hm-shop-price-member .label {
	font-size: 13px;
	color: #92400e;
	font-weight: 500;
}

.hm-shop-price-member .value {
	font-size: 30px;
	font-weight: 800;
	color: #ea580c;
	line-height: 1;
}

.hm-shop-price-nonmember {
	display: flex;
	align-items: baseline;
	gap: 8px;
	color: #6b7280;
	font-size: 14px;
}

.hm-shop-price-nonmember .label {
	background: #e5e7eb;
	color: #374151;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
}

.hm-shop-price-nonmember .value {
	font-weight: 600;
	color: #4b5563;
}

.hm-shop-price-info {
	color: #2563eb;
	text-decoration: underline;
	font-size: 12px;
	margin-inline-start: 8px;
}

.hm-shop-price-regular .value {
	font-size: 26px;
	font-weight: 700;
	color: #1f2937;
}

.hm-shop-stock {
	margin: 0 0 16px;
	font-weight: 600;
	font-size: 14px;
}

.hm-shop-stock.is-in {
	color: #16a34a;
}

.hm-shop-stock.is-out {
	color: #dc2626;
}

.hm-shop-short-desc {
	color: #374151;
	font-size: 15px;
	line-height: 1.6;
	margin: 0 0 20px;
}

/* === Add to cart === */

.hm-shop-add-to-cart {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: end;
	margin-top: 16px;
}

.hm-shop-qty-label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 13px;
	color: #374151;
	font-weight: 600;
}

.hm-shop-qty {
	width: 80px;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 16px;
	text-align: center;
}

.hm-shop-qty:focus-visible {
	outline: 2px solid #f59e0b;
	outline-offset: 1px;
	border-color: #f59e0b;
}

.hm-shop-cta-add {
	background: #ea580c;
	color: #ffffff;
	border: none;
	padding: 14px 28px;
	font-size: 16px;
	font-weight: 700;
	border-radius: 10px;
	cursor: pointer;
	transition: background 150ms ease;
	min-height: 48px;
}

.hm-shop-cta-add:hover:not([disabled]) {
	background: #c2410c;
}

.hm-shop-cta-add:focus-visible {
	outline: 3px solid #fbbf24;
	outline-offset: 2px;
}

.hm-shop-cta-add[disabled] {
	background: #9ca3af;
	cursor: not-allowed;
}

.hm-shop-cta-add.is-loading {
	opacity: 0.7;
	cursor: wait;
}

.hm-shop-cta-feedback {
	flex-basis: 100%;
	min-height: 24px;
	font-size: 14px;
	color: #16a34a;
	font-weight: 600;
}

.hm-shop-cta-feedback.is-error {
	color: #dc2626;
}

.hm-shop-added-pulse {
	animation: hmShopAddedPulse 700ms ease;
}

@keyframes hmShopAddedPulse {
	0% { transform: scale(1); }
	40% { transform: scale(1.05); background: #16a34a; }
	100% { transform: scale(1); }
}

/* === Tabs === */

.hm-shop-tabs {
	display: flex;
	gap: 4px;
	border-bottom: 2px solid #e5e7eb;
	margin: 32px 0 0;
	flex-wrap: wrap;
}

.hm-shop-tabs button {
	all: unset;
	cursor: pointer;
	padding: 12px 20px;
	font-size: 15px;
	font-weight: 600;
	color: #6b7280;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	transition: color 120ms ease, border-color 120ms ease;
}

.hm-shop-tabs button.is-active,
.hm-shop-tabs button[aria-selected="true"] {
	color: #ea580c;
	border-bottom-color: #ea580c;
}

.hm-shop-tabs button:focus-visible {
	outline: 2px solid #f59e0b;
	outline-offset: 2px;
}

.hm-shop-tabpanel {
	padding: 24px 0;
	color: #374151;
	font-size: 15px;
	line-height: 1.7;
}

.hm-shop-tabpanel[hidden] {
	display: none;
}

.hm-shop-attrs {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 8px 24px;
	margin: 0;
}

.hm-shop-attrs dt {
	font-weight: 600;
	color: #1f2937;
}

.hm-shop-attrs dd {
	margin: 0;
	color: #4b5563;
}

.hm-shop-empty {
	color: #9ca3af;
	font-style: italic;
}

/* === Related products === */

.hm-shop-related {
	margin-top: 48px;
}

.hm-shop-related-title {
	font-size: 22px;
	color: #1f2937;
	margin: 0 0 20px;
}

.hm-shop-related-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}

@media (min-width: 720px) {
	.hm-shop-related-list {
		grid-template-columns: repeat(4, 1fr);
	}
}

.hm-shop-related-card {
	display: block;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 12px;
	text-decoration: none;
	color: inherit;
	transition: box-shadow 150ms ease, transform 150ms ease;
}

.hm-shop-related-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.hm-shop-related-card:focus-visible {
	outline: 2px solid #f59e0b;
	outline-offset: 2px;
}

.hm-shop-related-img {
	display: block;
	background: #f4f5f7;
	border-radius: 8px;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	margin-bottom: 8px;
}

.hm-shop-related-img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.hm-shop-related-name {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
	line-height: 1.35;
	margin-bottom: 4px;
	min-height: 38px;
}

.hm-shop-related-price {
	display: block;
	font-size: 16px;
	font-weight: 700;
	color: #ea580c;
}

/* === Lightbox === */

.hm-shop-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 9999;
}

.hm-shop-lightbox img {
	max-width: 95vw;
	max-height: 90vh;
	object-fit: contain;
}

.hm-shop-lightbox-close {
	position: absolute;
	top: 16px;
	inset-inline-end: 16px;
	background: #ffffff;
	color: #1f2937;
	border: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 24px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hm-shop-lightbox-close:focus-visible {
	outline: 3px solid #f59e0b;
	outline-offset: 2px;
}

/* === Breadcrumb fallback (when hero brand absent) === */

.hm-shop-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	padding: 12px 0;
	margin: 0;
	color: #6b7280;
	font-size: 13px;
}

.hm-shop-breadcrumb li::after {
	content: "›";
	margin-inline-start: 6px;
	color: #9ca3af;
}

.hm-shop-breadcrumb li:last-child::after {
	content: "";
}

.hm-shop-breadcrumb a {
	color: #6b7280;
	text-decoration: none;
}

.hm-shop-breadcrumb a:hover {
	color: #ea580c;
	text-decoration: underline;
}
