/**
 * WooCommerce single product page.
 */

.cb-product-page {
	background: var(--color-bg);
	padding-bottom: var(--space-20);
}

.cb-product-page__notices {
	display: none;
}

.cb-product-page .woocommerce-message,
.cb-product-page .woocommerce-info,
.cb-product-page .woocommerce-error {
	padding: var(--space-4) var(--space-5);
	border-radius: var(--radius-md);
	margin-bottom: var(--space-4);
	list-style: none;
}

.cb-product-page .woocommerce-message {
	background: rgba(110, 158, 122, 0.12);
	border: 1px solid rgba(110, 158, 122, 0.35);
	color: var(--color-text);
}

.cb-product-wishlist-wrap {
	margin: 0;
}

.cb-product-hero__summary .cb-product-wishlist-wrap .cb-product-card__wishlist {
	min-width: 44px;
	min-height: 44px;
	padding: 0;
}

/* —— Hero —— */
.cb-product-hero {
	padding: var(--space-8) 0 var(--space-12);
	background: var(--gradient-soft);
	border-bottom: 1px solid var(--color-border);
}

.cb-product-hero__crumbs {
	margin-bottom: var(--space-6);
	font-size: var(--text-sm);
}

.cb-product-hero__crumbs .woocommerce-breadcrumb {
	margin: 0;
	color: var(--color-text-muted);
}

.cb-product-hero__crumbs a {
	color: var(--color-primary);
	text-decoration: none;
}

.cb-product-hero__crumbs a:hover {
	color: var(--color-primary);
}

.cb-product-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: var(--space-10);
	align-items: start;
}

.cb-product-hero__gallery {
	position: relative;
}

.cb-product-hero__gallery .woocommerce-product-gallery {
	position: relative;
	background: var(--color-bg-elevated);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-md);
	overflow: hidden;
}

.cb-product-hero__gallery .woocommerce-product-gallery__wrapper,
.cb-product-hero__gallery .woocommerce-product-gallery__image {
	margin: 0;
}

.cb-product-hero__gallery .woocommerce-product-gallery__image img,
.cb-product-hero__gallery .woocommerce-product-gallery__image--placeholder img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
}

.cb-product-hero__gallery .flex-control-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin: var(--space-4) 0 0;
	padding: 0 var(--space-4) var(--space-4);
	list-style: none;
}

.cb-product-hero__gallery .flex-control-thumbs li {
	flex: 0 0 calc(25% - var(--space-3) * 0.75);
	margin: 0;
}

.cb-product-hero__gallery .flex-control-thumbs img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: var(--radius-md);
	border: 2px solid transparent;
	cursor: pointer;
	opacity: 0.72;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}

.cb-product-hero__gallery .flex-control-thumbs img:hover,
.cb-product-hero__gallery .flex-control-thumbs .flex-active img {
	opacity: 1;
	border-color: var(--color-primary);
}

.cb-product-hero__gallery .onsale {
	position: absolute;
	top: var(--space-4);
	inset-inline-start: var(--space-4);
	z-index: 2;
	margin: 0;
	padding: 0.35rem 0.85rem;
	border-radius: var(--radius-pill);
	background: var(--gradient-rose);
	color: var(--color-text-inverse);
	font-size: var(--text-sm);
	font-weight: 700;
	line-height: 1.3;
	min-height: auto;
	min-width: 0;
}

/* —— Summary —— */
.cb-product-hero__summary {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
	padding: var(--space-6);
	background: var(--color-bg-elevated);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-sm);
}

.cb-product-hero__summary .product_title {
	margin: 0;
	font-size: clamp(1.5rem, 2.5vw, 2.25rem);
	line-height: 1.25;
	font-family: var(--family-display);
}

.cb-product-vendor {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
	margin: 0;
	font-size: var(--text-sm);
}

.cb-product-vendor__label {
	color: var(--color-text-muted);
	font-weight: 600;
}

.cb-product-vendor__link {
	color: var(--color-primary);
	font-weight: 700;
	text-decoration: none;
}

.cb-product-vendor__link:hover {
	color: var(--color-primary-dark);
}

.cb-product-hero__summary .woocommerce-product-rating {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
	margin: 0;
}

.cb-product-hero__summary .star-rating {
	color: var(--color-rose-gold);
}

.cb-product-hero__summary .woocommerce-review-link {
	font-size: var(--text-sm);
	color: var(--color-text-muted);
	text-decoration: none;
}

.cb-product-hero__summary .woocommerce-review-link:hover {
	color: var(--color-primary);
}

.cb-product-hero__summary .price {
	margin: 0;
	font-size: var(--text-2xl);
	line-height: 1.2;
}

.cb-product-hero__summary .price del {
	font-size: var(--text-lg);
	color: var(--color-text-soft);
	font-weight: 500;
	margin-inline-end: var(--space-2);
}

.cb-product-hero__summary .price ins {
	text-decoration: none;
}

.cb-product-hero__summary .woocommerce-product-details__short-description {
	margin: 0;
	color: var(--color-text-muted);
	font-size: var(--text-base);
	line-height: 1.7;
}

.cb-product-purchase {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: var(--space-4);
	margin-top: var(--space-2);
}

.cb-product-purchase .cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3);
	margin: 0;
	width: 100%;
}

.cb-product-purchase .quantity {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

/* Product-page qty — between drawer default (28px) and full Woo size attr */
.cb-product-purchase .cb-qty {
	padding: 3px;
}

.cb-product-purchase .cb-qty .cb-qty__btn,
.cb-product-purchase .cb-qty button.cb-qty__btn[type='button'] {
	width: 27px;
	height: 27px;
	min-height: 0;
	font-size: var(--text-sm);
}

.cb-product-purchase .cb-qty .cb-qty__value,
.cb-product-purchase .cb-qty .qty {
	width: 3.25rem;
	min-width: 2.25rem;
	max-width: 3.5rem;
	padding: 0 var(--space-2);
	line-height: 27px;
	font-size: var(--text-sm);
}

.cb-product-purchase .single_add_to_cart_button {
	flex: 1 1 0;
	min-width: 0;
	width: auto;
	min-height: 52px;
	padding: 0.85rem 1.75rem;
	border: none;
	border-radius: var(--radius-pill);
	background: var(--gradient-rose);
	color: var(--color-text-inverse);
	font-family: inherit;
	font-size: var(--text-base);
	font-weight: 700;
	box-shadow: var(--shadow-md);
	cursor: pointer;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cb-product-purchase .single_add_to_cart_button:hover {
	transform: translateY(-2px);
}

.cb-product-purchase .single_add_to_cart_button.loading {
	opacity: 0.8;
	pointer-events: none;
}

.cb-product-purchase .single_add_to_cart_button.added {
	background: var(--color-success);
}

/* Dokan store support — matches header "مشاهده سبد خرید" */
.woocommerce .cb-product-purchase .dokan-store-support-btn-product.button.alt,
.woocommerce .cb-product-purchase button.dokan-store-support-btn-product.button {
	flex: 1 1 100%;
	width: 100%;
	min-height: 48px;
	padding: var(--space-3) 1rem !important;
	border: 1px solid var(--color-border-strong) !important;
	border-radius: var(--radius-md) !important;
	background: var(--color-beige) !important;
	color: var(--color-primary-dark) !important;
	font-family: inherit;
	font-size: var(--text-sm);
	font-weight: 700;
	line-height: 1.4;
	box-shadow: none !important;
	cursor: pointer;
	transition:
		background 0.2s ease,
		color 0.2s ease,
		border-color 0.2s ease;
}

.woocommerce .cb-product-purchase .dokan-store-support-btn-product.button.alt:hover,
.woocommerce .cb-product-purchase button.dokan-store-support-btn-product.button:hover {
	background: var(--color-beige-dark) !important;
	color: var(--color-primary-dark) !important;
	border-color: var(--color-border-strong) !important;
	transform: none !important;
}

.cb-product-purchase .variations {
	width: 100%;
	margin-bottom: var(--space-2);
}

.cb-product-purchase .variations td,
.cb-product-purchase .variations th {
	padding: var(--space-2) 0;
	vertical-align: middle;
}

.cb-product-purchase .variations select {
	min-width: 10rem;
	min-height: 44px;
	padding: 0.5rem 2rem 0.5rem 1rem;
	border: 1px solid var(--color-border-strong);
	border-radius: var(--radius-md);
	font-family: inherit;
	font-size: var(--text-sm);
	background: var(--color-bg);
}

.cb-product-meta {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	margin-top: var(--space-4);
	padding-top: var(--space-5);
	border-top: 1px solid var(--color-border);
}

.cb-product-meta__row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-4);
	font-size: var(--text-sm);
}

.cb-product-meta__label {
	flex: 0 0 auto;
	color: var(--color-text-muted);
	font-weight: 700;
}

.cb-product-meta__value {
	color: var(--color-text);
}

.cb-product-meta__value a {
	color: var(--color-primary);
	text-decoration: none;
}

.cb-product-meta__value a:hover {
	color: var(--color-primary-dark);
}

/* —— Below hero: description + related —— */
.cb-product-below {
	padding: var(--space-12) 0 0;
}

.cb-product-section {
	margin-bottom: var(--space-12);
	padding: var(--space-8);
	background: var(--color-bg-elevated);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-xs);
}

.cb-product-section__title {
	margin: 0 0 var(--space-6);
	font-size: var(--text-2xl);
	line-height: 1.3;
}

.cb-product-about__content {
	color: var(--color-text);
	line-height: 1.75;
}

.cb-product-about__content > :first-child {
	margin-top: 0;
}

.cb-product-about__content > :last-child {
	margin-bottom: 0;
}

/* —— Related products —— */
.cb-product-related {
	margin-top: var(--space-4);
	padding-top: var(--space-8);
	border-top: 1px solid var(--color-border);
}

.cb-product-related__head {
	margin-bottom: var(--space-8);
	text-align: center;
}

.cb-product-related__head h2 {
	margin: 0;
	font-size: var(--text-2xl);
	line-height: 1.3;
}

/* Stock */
.cb-product-hero__summary .stock {
	margin: 0;
	font-size: var(--text-sm);
	font-weight: 600;
}

.cb-product-hero__summary .stock.in-stock {
	color: var(--color-success);
}

.cb-product-hero__summary .stock.out-of-stock {
	color: var(--color-danger);
}

@media (max-width: 1023px) {
	.cb-product-hero__grid {
		grid-template-columns: 1fr;
		gap: var(--space-8);
	}

}

@media (max-width: 767px) {
	.cb-product-hero {
		padding-top: var(--space-6);
	}

	.cb-product-hero__summary {
		padding: var(--space-5);
	}

	.cb-product-purchase .cart {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
	}

	.cb-product-purchase .cb-qty {
		width: auto;
		flex: 0 0 auto;
	}

	.cb-product-purchase .single_add_to_cart_button {
		flex: 1 1 0;
		width: auto;
		min-width: 0;
	}

	.cb-product-section {
		padding: var(--space-5);
	}

	.cb-product-hero__gallery .flex-control-thumbs li {
		flex: 0 0 calc(33.333% - var(--space-3) * 0.67);
	}
}
