/* =========================================================
   ووكومرس — بطاقة المنتج، المتجر، الفلاتر، الكاروسيل
   ========================================================= */

/* ---------- الكاروسيل الخفيف (بدون مكتبات) ---------- */
.bq-carousel { position: relative; }
.bq-carousel__track {
	display: flex;
	gap: clamp(12px, 1.6vw, 24px);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	padding-bottom: 6px;
	margin-inline: calc(var(--bq-gutter) * -1);
	padding-inline: var(--bq-gutter);
}
.bq-carousel__track::-webkit-scrollbar { display: none; }
.bq-carousel__cell { flex: 0 0 calc((100% - 3 * 24px) / 4); scroll-snap-align: start; }

.bq-carousel__nav {
	position: absolute;
	inset-block-start: 34%;
	z-index: 4;
	display: grid;
	place-items: center;
	width: 46px; height: 46px;
	background: var(--bq-surface);
	border: 1px solid var(--bq-line);
	border-radius: 50%;
	cursor: pointer;
	box-shadow: var(--bq-shadow-sm);
	transition: all var(--bq-t-fast);
}
.bq-carousel__nav:hover { background: var(--bq-wine); color: #fff; border-color: var(--bq-wine); }
.bq-carousel__nav--prev { inset-inline-end: -14px; }
.bq-carousel__nav--next { inset-inline-start: -14px; }
.bq-carousel__nav[disabled] { opacity: 0; pointer-events: none; }

/* ---------- بطاقة المنتج ---------- */
.bq-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--bq-surface);
	border-radius: var(--bq-r-lg);
	overflow: hidden;
	transition: transform var(--bq-t), box-shadow var(--bq-t);
}
.bq-card:hover { transform: translateY(-5px); box-shadow: var(--bq-shadow); }

.bq-card__media {
	position: relative;
	overflow: hidden;
	background: var(--bq-beige);
	aspect-ratio: 3 / 4;
}
.bq-card__imglink { display: block; height: 100%; }
.bq-card__img {
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform 800ms var(--bq-ease-out), opacity 500ms var(--bq-ease);
}
.bq-card__img--alt {
	position: absolute;
	inset: 0;
	opacity: 0;
}
.bq-card:hover .bq-card__img--alt { opacity: 1; }
.bq-card:hover .bq-card__img { transform: scale(1.05); }
.bq-card.outofstock .bq-card__img { filter: grayscale(.55) opacity(.75); }

/* الشارات */
.bq-badges {
	position: absolute;
	inset-block-start: 12px;
	inset-inline-start: 12px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}
.bq-badge {
	display: inline-block;
	padding: 5px 11px;
	border-radius: var(--bq-r-pill);
	font-family: var(--bq-font-head);
	font-size: var(--bq-fs-xs);
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: .02em;
	backdrop-filter: blur(4px);
}
.bq-badge--new { background: var(--bq-primary-pale); color: var(--bq-primary-deep); }
.bq-badge--sale { background: var(--bq-sale); color: #fff; direction: ltr; }
.bq-badge--out { background: rgba(36,30,34,.82); color: #fff; }
.bq-badge--single { position: static; display: inline-block; margin-bottom: var(--bq-sp-3); }

/* أدوات البطاقة */
.bq-card__tools {
	position: absolute;
	inset-block-start: 12px;
	inset-inline-end: 12px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.bq-card__tools > * {
	display: grid;
	place-items: center;
	width: 40px; height: 40px;
	background: rgba(255,255,255,.92);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	color: var(--bq-text);
	box-shadow: var(--bq-shadow-sm);
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity var(--bq-t), transform var(--bq-t), background var(--bq-t-fast), color var(--bq-t-fast);
}
.bq-card:hover .bq-card__tools > *,
.bq-card:focus-within .bq-card__tools > *,
.bq-card__tools .bq-wish.is-active { opacity: 1; transform: translateY(0); }
.bq-card__tools > *:nth-child(2) { transition-delay: 60ms; }
.bq-card__tools > *:hover { background: var(--bq-wine); color: #fff; }

.bq-wish.is-active { color: var(--bq-sale); }
.bq-wish.is-active svg { fill: currentColor; }
.bq-wish.is-loading { opacity: .5; pointer-events: none; }
.bq-wish--labeled {
	display: inline-flex !important;
	width: auto !important;
	gap: 8px;
	padding: 0 18px;
	height: 48px !important;
	border: 1px solid var(--bq-line) !important;
	border-radius: var(--bq-r-pill) !important;
	background: transparent !important;
	box-shadow: none !important;
	opacity: 1 !important;
	transform: none !important;
	font-size: var(--bq-fs-sm);
}
.bq-wish--labeled:hover { border-color: var(--bq-primary) !important; background: transparent !important; color: var(--bq-primary-deep) !important; }

/* المقاسات على الصورة */
.bq-card__sizes {
	position: absolute;
	inset-block-end: 0;
	inset-inline: 0;
	z-index: 3;
	display: flex;
	justify-content: center;
	gap: 6px;
	padding: 10px;
	background: linear-gradient(to top, rgba(255,255,255,.96), rgba(255,255,255,0));
	transform: translateY(100%);
	opacity: 0;
	transition: transform var(--bq-t), opacity var(--bq-t);
}
.bq-card:hover .bq-card__sizes { transform: translateY(0); opacity: 1; }
.bq-card__size {
	min-width: 30px;
	padding: 3px 7px;
	border: 1px solid var(--bq-line);
	border-radius: var(--bq-r-sm);
	background: #fff;
	font-size: var(--bq-fs-xs);
	text-align: center;
	color: var(--bq-muted);
}

/* جسم البطاقة */
.bq-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: var(--bq-sp-4) var(--bq-sp-2) var(--bq-sp-3);
	text-align: center;
}
.bq-card__cat {
	font-family: var(--bq-font-latin);
	font-size: var(--bq-fs-xs);
	letter-spacing: .1em;
	color: var(--bq-muted);
	margin-bottom: 4px;
}
.bq-card__title {
	font-size: var(--bq-fs-base);
	font-weight: 400;
	line-height: 1.6;
	margin: 0 0 6px;
}
.bq-card__title a { transition: color var(--bq-t-fast); }
.bq-card__title a:hover { color: var(--bq-primary-deep); }
.bq-card__rating { margin-bottom: 4px; }
.bq-card__price {
	font-family: var(--bq-font-head);
	font-size: var(--bq-fs-md);
	color: var(--bq-text);
	margin-bottom: 4px;
}
.bq-card__price del { color: var(--bq-muted); font-size: var(--bq-fs-sm); opacity: .8; margin-inline-start: 8px; font-weight: 300; }
.bq-card__price ins { text-decoration: none; color: var(--bq-sale); }
.bq-card__hint { font-size: var(--bq-fs-xs); color: var(--bq-muted); }
.bq-card__actions {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-top: auto;
	padding-top: var(--bq-sp-3);
}
.bq-card__actions .bq-btn { flex: 1; max-width: 170px; }
.bq-card .added_to_cart { display: none; }
.bq-card .add_to_cart_button.loading { opacity: .6; pointer-events: none; }
.bq-card .add_to_cart_button.added::before { content: '✓ '; }

/* ---------- صفحة المتجر ---------- */
.bq-shop {
	display: grid;
	grid-template-columns: 272px 1fr;
	gap: clamp(20px, 3vw, 44px);
	align-items: start;
	padding-block: var(--bq-section);
}
.bq-shop__filterbtn { display: none; }
.bq-shop__aside { position: sticky; top: calc(var(--bq-header-h) + 16px); }

.bq-shop__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--bq-sp-4);
	flex-wrap: wrap;
	padding-bottom: var(--bq-sp-4);
	margin-bottom: var(--bq-sp-5);
	border-bottom: 1px solid var(--bq-line);
}
.woocommerce-result-count { margin: 0; font-size: var(--bq-fs-sm); color: var(--bq-muted); }
.woocommerce-ordering select { min-width: 190px; min-height: 44px; }

/* ---------- الفلاتر ---------- */
.bq-filters {
	background: var(--bq-surface);
	border: 1px solid var(--bq-line);
	border-radius: var(--bq-r-lg);
	padding: var(--bq-sp-5);
}
.bq-filters__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--bq-sp-3); }
.bq-filters__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: var(--bq-fs-base);
	margin: 0;
}
.bq-filters__title svg { color: var(--bq-primary); }
.bq-filters__close { display: none; background: none; border: 0; cursor: pointer; }

.bq-filter { border-top: 1px solid var(--bq-line); padding-block: var(--bq-sp-3); }
.bq-filter__label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-family: var(--bq-font-head);
	font-size: var(--bq-fs-sm);
	font-weight: 500;
	cursor: pointer;
	list-style: none;
	padding-block: 6px;
}
.bq-filter__label::-webkit-details-marker { display: none; }
.bq-filter__label svg { transition: transform var(--bq-t-fast); color: var(--bq-muted); }
.bq-filter[open] .bq-filter__label svg { transform: rotate(180deg); }
.bq-filter__body {
	padding-top: var(--bq-sp-2);
	max-height: 230px;
	overflow-y: auto;
	animation: bq-acc 280ms var(--bq-ease-out);
}
@keyframes bq-acc {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: translateY(0); }
}
.bq-check {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 6px 0;
	font-size: var(--bq-fs-sm);
	font-weight: 400;
	cursor: pointer;
	color: var(--bq-muted);
	transition: color var(--bq-t-fast);
}
.bq-check:hover { color: var(--bq-text); }
.bq-check input { width: 17px; height: 17px; accent-color: var(--bq-wine); flex: none; }
.bq-check i { font-style: normal; opacity: .6; font-size: var(--bq-fs-xs); }

.bq-filter__price { display: flex; gap: 10px; }
.bq-filter__price label { flex: 1; display: grid; gap: 4px; font-size: var(--bq-fs-xs); color: var(--bq-muted); }
.bq-filter__price input { min-height: 42px; padding: 8px 10px; }

.bq-filter__chips { display: flex; flex-wrap: wrap; gap: 7px; }
.bq-chip { position: relative; cursor: pointer; }
.bq-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.bq-chip span {
	display: block;
	min-width: 42px;
	padding: 7px 12px;
	border: 1px solid var(--bq-line);
	border-radius: var(--bq-r-pill);
	font-size: var(--bq-fs-xs);
	text-align: center;
	color: var(--bq-muted);
	transition: all var(--bq-t-fast);
}
.bq-chip input:checked + span { background: var(--bq-wine); border-color: var(--bq-wine); color: #fff; }
.bq-chip input:focus-visible + span { outline: 2px solid var(--bq-primary); outline-offset: 2px; }
.bq-chip:hover span { border-color: var(--bq-primary); color: var(--bq-primary-deep); }

.bq-filters__actions { margin-top: var(--bq-sp-4); display: grid; gap: 10px; }
.bq-filters__reset { text-align: center; font-size: var(--bq-fs-sm); color: var(--bq-sale); }
.bq-filters__reset:hover { text-decoration: underline; }
.bq-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bq-sale); display: inline-block; }

/* ---------- العرض السريع ---------- */
.bq-quickview { display: grid; grid-template-columns: 1fr 1fr; gap: var(--bq-sp-6); }
.bq-quickview__media { position: relative; border-radius: var(--bq-r); overflow: hidden; }
.bq-quickview__img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.bq-quickview__title { font-size: var(--bq-fs-xl); }
.bq-quickview__price { font-family: var(--bq-font-head); font-size: var(--bq-fs-lg); color: var(--bq-primary-deep); margin-bottom: var(--bq-sp-3); }
.bq-quickview__price del { color: var(--bq-muted); font-size: var(--bq-fs-base); }
.bq-quickview__price ins { text-decoration: none; color: var(--bq-sale); }
.bq-quickview__excerpt { font-size: var(--bq-fs-sm); color: var(--bq-muted); margin-bottom: var(--bq-sp-4); }
.bq-quickview__more { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--bq-sp-4); font-size: var(--bq-fs-sm); color: var(--bq-primary-deep); border-bottom: 1px solid var(--bq-primary-soft); padding-bottom: 3px; }

/* ---------- عناصر ووكومرس العامة ---------- */
.woocommerce-message, .woocommerce-info, .woocommerce-error {
	list-style: none;
	background: var(--bq-primary-pale);
	border-inline-start: 3px solid var(--bq-primary);
	border-radius: var(--bq-r);
	padding: 14px 18px;
	margin-bottom: var(--bq-sp-4);
	font-size: var(--bq-fs-sm);
}
.woocommerce-error { background: #FBEDEF; border-color: var(--bq-sale); }
.woocommerce-message a, .woocommerce-info a { color: var(--bq-primary-deep); text-decoration: underline; }
.woocommerce-store-notice { display: none; }

.bq-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--bq-line);
	border-radius: var(--bq-r-pill);
	overflow: hidden;
	background: var(--bq-surface);
}
.bq-qty__btn {
	display: grid;
	place-items: center;
	width: 42px; height: 46px;
	background: none;
	border: 0;
	cursor: pointer;
	color: var(--bq-muted);
	transition: background var(--bq-t-fast), color var(--bq-t-fast);
}
.bq-qty__btn:hover { background: var(--bq-primary-pale); color: var(--bq-primary-deep); }
.bq-qty input.qty {
	width: 46px;
	min-height: 46px;
	padding: 0;
	border: 0;
	border-radius: 0;
	text-align: center;
	font-variant-numeric: tabular-nums;
	-moz-appearance: textfield;
}
.bq-qty input.qty::-webkit-outer-spin-button,
.bq-qty input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bq-qty input.qty:focus { box-shadow: none; }

.star-rating { color: var(--bq-primary); }
