/**
 * Bonyan Medica - Shop / Archive / Cart
 */

/* ------------------------------------------------------------
   1) عنوان و نوار ابزار آرشیو
------------------------------------------------------------ */
body .woocommerce-products-header {
	margin-bottom: 18px;
}

body .woocommerce-products-header__title,
body .page-title {
	font-size: var(--bm-fs-xl);
	font-weight: 800;
	color: var(--bm-ink);
	margin: 0 0 6px;
	line-height: 1.5;
}

body .woocommerce-result-count,
body .woocommerce-ordering {
	font-size: var(--bm-fs-sm);
	color: var(--bm-muted);
	margin: 0;
}

body .woocommerce-ordering select {
	min-width: 190px;
	padding: 9px 14px;
	font-size: var(--bm-fs-sm);
	border-radius: var(--bm-r-sm);
}

body .shoptimizer-sorting {
	background: #fff;
	border: 1px solid var(--bm-line);
	border-radius: var(--bm-r-md);
	padding: 10px 16px;
	margin-bottom: 22px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

/* فروشگاه تمام‌عرض: سایدبار قدیمی حذف و گرید ۴ ستونی می‌شود. */
body.woocommerce-shop #secondary,
body.post-type-archive-product #secondary,
body.tax-product_cat #secondary,
body.search-results #secondary { display: none !important; }

body.woocommerce-shop .content-area,
body.post-type-archive-product .content-area,
body.tax-product_cat .content-area,
body.search-results .content-area {
	width: 100% !important;
	float: none !important;
}

body ul.products {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
	width: 100%;
	max-width: 100%;
	margin: 0 0 32px;
	padding: 0;
	list-style: none;
}

@media (min-width: 1101px) {
	body.woocommerce-shop ul.products,
	body.post-type-archive-product ul.products,
	body.tax-product_cat ul.products,
	body.search-results ul.products {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

body ul.products::before,
body ul.products::after { display: none; }

body ul.products li.product {
	position: relative;
	display: flex !important;
	flex-direction: column !important;
	flex-wrap: nowrap;
	width: auto !important;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
	background: #fff;
	border: 1px solid var(--bm-line);
	border-radius: var(--bm-r-lg);
	overflow: hidden;
	transition: box-shadow var(--bm-tr), transform var(--bm-tr), border-color var(--bm-tr);
	box-shadow: none;
}

body ul.products li.product:hover {
	box-shadow: var(--bm-sh-2);
	transform: translateY(-3px);
	border-color: var(--bm-line-strong);
}

@media (hover: hover) {
	body ul.products li.product:hover .woocommerce-image__wrapper img {
		transform: scale(1.045);
	}
}

body ul.products li.product .woocommerce-image__wrapper {
	position: relative;
	width: 100%;
	background: var(--bm-soft);
	padding: 16px;
	margin: 0;
	border-radius: 0;
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

body ul.products li.product .woocommerce-image__wrapper img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	margin: 0;
	transition: transform 320ms cubic-bezier(.2, .8, .3, 1);
	mix-blend-mode: multiply;
}

body ul.products li.product .product-label.sale-item,
body ul.products li.product .onsale {
	position: absolute;
	top: 12px;
	inset-inline-start: 12px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	height: 26px;
	padding: 0 10px;
	border-radius: var(--bm-r-pill);
	background: var(--bm-danger);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	min-height: 0;
	min-width: 0;
	margin: 0;
	box-shadow: var(--bm-sh-1);
}

body ul.products li.product .woocommerce-card__header {
	padding: 16px 16px 18px;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 8px;
	text-align: start;
	background: #fff;
}

body ul.products li.product .product__categories {
	display: none;
}

body ul.products li.product .woocommerce-loop-product__title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.75;
	color: var(--bm-ink);
	margin: 0;
	padding: 0;
	min-height: 3.5em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

body ul.products li.product .woocommerce-loop-product__title a {
	color: inherit;
	text-decoration: none;
}

body ul.products li.product .woocommerce-loop-product__title a:hover { color: var(--bm-gold-dark); }

body ul.products li.product .cgkit-as-variation-price { margin: 0; }

body ul.products li.product .price {
	display: flex;
	align-items: baseline;
	gap: 8px;
	flex-wrap: wrap;
	font-size: 17px;
	font-weight: 800;
	color: var(--bm-ink);
	margin: 0;
	line-height: 1.6;
}

body ul.products li.product .price del {
	font-size: 12.5px;
	font-weight: 400;
	color: var(--bm-muted);
	text-decoration: line-through;
	opacity: .85;
}

body ul.products li.product .price ins {
	text-decoration: none;
	color: var(--bm-gold-dark);
	font-weight: 800;
}

body ul.products li.product .price .woocommerce-Price-currencySymbol {
	font-size: 11px;
	font-weight: 600;
	color: var(--bm-muted);
}

body ul.products li.product .button.add_to_cart_button,
body ul.products li.product .added_to_cart {
	width: 100%;
	margin-top: auto;
	height: 42px;
	padding: 0 12px;
	font-size: 13.5px;
	font-weight: 700;
	background: var(--bm-soft);
	color: var(--bm-ink);
	border: 1px solid var(--bm-line-strong);
	box-shadow: none;
	border-radius: var(--bm-r-sm);
}

body ul.products li.product .button.add_to_cart_button:hover,
body ul.products li.product .added_to_cart:hover {
	background: var(--bm-green);
	color: #fff;
	border-color: var(--bm-green);
	transform: none;
	box-shadow: none;
}

body ul.products li.product .button.add_to_cart_button.loading::after {
	border-color: var(--bm-ink) transparent var(--bm-ink) transparent;
}

/* علاقه‌مندی */
body ul.products li.product .commercekit-wishlist.mini {
	position: absolute;
	top: 12px;
	inset-inline-end: 12px;
	z-index: 3;
}

body .commercekit-wishlist.mini a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid var(--bm-line);
	box-shadow: var(--bm-sh-1);
	color: var(--bm-muted);
}

body .commercekit-wishlist.mini a:hover { color: var(--bm-danger); }

body .commercekit-wishlist.mini a .cg-wishlist::before { font-size: 15px; }

/* ------------------------------------------------------------
   3) صفحه‌بندی
------------------------------------------------------------ */
body .woocommerce-pagination {
	margin: 8px 0 40px;
	text-align: center;
	width: 100%;
	max-width: 100%;
}

/*
 * قالب والد صفحهبندی را inline-flex و بدون wrap میسازد؛ روی موبایل با تعداد
 * زیاد شماره صفحه از عرض ستون بیرون میزند و سرریز افقی ایجاد میکند.
 */
body .woocommerce-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	border: 0;
	margin: 0;
	padding: 0;
	width: 100%;
	max-width: 100%;
}

body .woocommerce-pagination ul li {
	border: 0;
	margin: 0;
}

body .woocommerce-pagination ul li a,
body .woocommerce-pagination ul li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border-radius: var(--bm-r-sm);
	border: 1px solid var(--bm-line);
	background: #fff;
	color: var(--bm-text);
	font-size: 14px;
	font-weight: 600;
}

body .woocommerce-pagination ul li a:hover {
	border-color: var(--bm-gold);
	color: var(--bm-gold-dark);
}

body .woocommerce-pagination ul li span.current {
	background: var(--bm-ink);
	border-color: var(--bm-ink);
	color: #fff;
}

/* ------------------------------------------------------------
   4) سایدبار فروشگاه
------------------------------------------------------------ */
body #secondary .widget,
body .left-woocommerce-sidebar .widget {
	background: #fff;
	border: 1px solid var(--bm-line);
	border-radius: var(--bm-r-md);
	padding: 18px;
	margin-bottom: 18px;
}

body #secondary .widget .gamma.widget-title,
body #secondary .widget .widget-title {
	font-size: 15px;
	font-weight: 700;
	color: var(--bm-ink);
	margin: 0 0 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--bm-line);
	display: block;
}

body #secondary ul.product-categories li a,
body #secondary .widget ul li a {
	display: block;
	padding: 7px 0;
	font-size: 14px;
	color: var(--bm-text);
	border: 0;
}

body #secondary ul.product-categories li a:hover { color: var(--bm-gold-dark); }

body #secondary .widget .count {
	color: var(--bm-muted);
	font-size: 12px;
}

/* ------------------------------------------------------------
   5) سبد خرید / تسویه
------------------------------------------------------------ */
body .woocommerce-cart .woocommerce,
body .woocommerce-checkout .woocommerce {
	background: transparent;
}

body .cart-collaterals .cart_totals,
body .woocommerce-checkout-review-order,
body .woocommerce-checkout #customer_details {
	background: #fff;
	border: 1px solid var(--bm-line);
	border-radius: var(--bm-r-lg);
	padding: 24px;
}

body .cart_totals h2,
body #order_review_heading,
body .woocommerce-checkout h3 {
	font-size: var(--bm-fs-md);
	font-weight: 700;
	margin-bottom: 16px;
}

body .woocommerce table.shop_table {
	border: 1px solid var(--bm-line);
	border-radius: var(--bm-r-md);
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
}

body .woocommerce table.shop_table th {
	background: var(--bm-soft);
	color: var(--bm-ink);
	font-weight: 700;
	font-size: 14px;
	padding: 12px 14px;
}

body .woocommerce table.shop_table td {
	padding: 14px;
	border-top: 1px solid var(--bm-line);
	font-size: 14px;
}

body .cart_totals .order-total .amount {
	color: var(--bm-gold-dark);
	font-weight: 800;
}

body .woocommerce-checkout #payment {
	background: #fff;
	border: 1px solid var(--bm-line);
	border-radius: var(--bm-r-lg);
	padding: 20px;
}

body .woocommerce-checkout #payment ul.payment_methods {
	border-bottom: 1px solid var(--bm-line);
	padding-bottom: 12px;
}

body #place_order {
	width: 100%;
	height: 52px;
	font-size: 16px;
	background: var(--bm-green);
	border: 0;
	border-radius: var(--bm-r-md);
	font-weight: 700;
	box-shadow: 0 6px 18px rgba(11, 122, 75, .28);
}

body #place_order:hover { background: var(--bm-green-dark); }

/* انتخابگر تعداد در سبد و صفحه محصول */
body .woocommerce .quantity input.qty,
body .woocommerce-page .quantity input.qty {
	height: 46px;
	min-width: 54px;
	border: 1px solid var(--bm-line);
	border-radius: var(--bm-r-sm);
	font-size: 15px;
	font-weight: 600;
	color: var(--bm-ink);
}

/* ------------------------------------------------------------
   6) ریسپانسیو
------------------------------------------------------------ */
@media (max-width: 1100px) {
	body ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) and (min-width: 768px) {
	body.woocommerce-shop ul.products,
	body.post-type-archive-product ul.products,
	body.tax-product_cat ul.products,
	body.search-results ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	body ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}
	body ul.products li.product .woocommerce-card__header { padding: 12px; gap: 6px; }
	body ul.products li.product .woocommerce-loop-product__title { font-size: 13.5px; min-height: 3.5em; }
	body ul.products li.product .price { font-size: 15px; }
	body ul.products li.product .button.add_to_cart_button { height: 38px; font-size: 12.5px; }
	body ul.products li.product .woocommerce-image__wrapper { padding: 10px; }
}
