/* =========================================================
   التجاوب — Mobile First هو المبدأ، وهنا التعديلات لكل مقاس
   نقاط التوقف: 1200 / 1024 / 768 / 560 / 380
   ========================================================= */

/* ============ ≤ 1200px ============ */
@media (max-width: 1200px) {
	.bq-footer__top { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
	.bq-footer__col:nth-child(4) { display: none; }
	.bq-carousel__nav--prev { inset-inline-end: 2px; }
	.bq-carousel__nav--next { inset-inline-start: 2px; }
}

/* ============ ≤ 1024px (تابلت) ============ */
@media (max-width: 1024px) {
	:root { --bq-header-h: 64px; }

	.bq-grid--4 { grid-template-columns: repeat(3, 1fr); }
	.bq-carousel__cell { flex-basis: calc((100% - 2 * 20px) / 3); }
	.bq-cats { grid-template-columns: repeat(3, 1fr); }
	.bq-trust { grid-template-columns: repeat(2, 1fr); }
	.bq-insta { grid-template-columns: repeat(3, 1fr); }
	.related ul.products, .up-sells ul.products { grid-template-columns: repeat(3, 1fr); }

	/* المنتج */
	.bq-product__top { grid-template-columns: 1fr; }
	.bq-product__summary { position: static; }

	/* الدفع وحسابي */
	.woocommerce-checkout form.checkout { grid-template-columns: 1fr; }
	.woocommerce-checkout-review-order { position: static; }
	.woocommerce-account .woocommerce { grid-template-columns: 1fr; }

	/* المتجر: الفلاتر تصبح درجًا */
	.bq-shop { grid-template-columns: 1fr; }
	.bq-shop__filterbtn {
		display: inline-flex;
		align-self: flex-start;
		margin-bottom: var(--bq-sp-4);
	}
	.bq-shop__aside {
		position: fixed;
		inset: 0;
		z-index: var(--bq-z-drawer);
		display: none;
	}
	.bq-shop__aside.is-open { display: block; }
	.bq-shop__aside-backdrop {
		position: absolute;
		inset: 0;
		background: rgba(36,30,34,.5);
		animation: bq-fade 240ms;
	}
	.bq-shop__aside-panel {
		position: absolute;
		inset-block: 0;
		inset-inline-start: 0;
		width: min(370px, 90vw);
		background: var(--bq-surface);
		overflow-y: auto;
		animation: bq-drawer-in 340ms var(--bq-ease-out);
		box-shadow: var(--bq-shadow-lg);
	}
	@keyframes bq-drawer-in {
		from { transform: translateX(-100%); }
		to { transform: translateX(0); }
	}
	html[dir=rtl] .bq-shop__aside-panel { animation-name: bq-drawer-in-rtl; }
	@keyframes bq-drawer-in-rtl {
		from { transform: translateX(100%); }
		to { transform: translateX(0); }
	}
	.bq-filters { border: 0; border-radius: 0; min-height: 100%; padding-bottom: 100px; }
	.bq-filters__close { display: grid; place-items: center; width: 40px; height: 40px; }
	.bq-filters__actions {
		position: sticky;
		inset-block-end: 0;
		background: var(--bq-surface);
		padding-top: var(--bq-sp-3);
		border-top: 1px solid var(--bq-line);
	}
}

/* ============ ≤ 768px (هاتف) ============ */
@media (max-width: 768px) {
	:root { --bq-section: 44px; }

	/* الهيدر */
	.bq-header__burger { display: inline-flex; }
	.bq-header__account { display: none; }
	.bq-nav { display: none; }
	.bq-header__inner { min-height: 60px; }
	.bq-logo__img { height: 46px; }
	.bq-header.is-stuck .bq-logo__img { height: 38px; }
	.bq-topbar__inner { grid-template-columns: 1fr; min-height: 34px; }
	.bq-topbar__social, .bq-topbar__links { display: none; }

	/* الهيرو */
	.bq-hero { height: clamp(400px, 62vh, 520px); }
	.bq-hero__content { align-items: center; text-align: center; }
	.bq-hero__title { max-width: 20ch; }
	.bq-hero__sub { margin-inline: auto; }
	.bq-hero__actions { justify-content: center; }
	.bq-hero__overlay,
	html:not([dir=rtl]) .bq-hero__overlay {
		background: linear-gradient(to top, rgba(36,30,34,.72), rgba(36,30,34,.25) 60%, rgba(36,30,34,.12));
	}

	/* منتجان في الصف — متطلب أساسي */
	.bq-grid--3, .bq-grid--4 { grid-template-columns: repeat(2, 1fr); }
	.related ul.products, .up-sells ul.products { grid-template-columns: repeat(2, 1fr); }
	.bq-carousel__cell { flex-basis: calc((100% - 14px) / 2); }
	.bq-carousel__nav { display: none; }
	.bq-carousel--quotes .bq-carousel__cell--quote { flex-basis: 86%; }

	.bq-cats { grid-template-columns: repeat(2, 1fr); }
	.bq-trust { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.bq-trust__item { padding: var(--bq-sp-4) 12px; }
	.bq-trust__icon { width: 52px; height: 52px; }
	.bq-insta { grid-template-columns: repeat(3, 1fr); gap: 6px; }
	.bq-collections { grid-template-columns: 1fr; }
	.bq-collection, .bq-collection--large { grid-column: span 1; min-height: 260px; }
	.bq-collection__body { min-height: 260px; padding: var(--bq-sp-4); }
	.bq-news { grid-template-columns: 1fr; text-align: center; }
	.bq-newsform { justify-content: center; }

	/* الفيديو */
	.bq-video { grid-template-columns: 1fr; gap: var(--bq-sp-5); }
	.bq-video__text { text-align: center; }
	.bq-video__text .bq-rule, .bq-rule--start { justify-content: center; margin-inline: auto; }
	.bq-video__desc { margin-inline: auto; }
	.bq-video__play { width: 64px; height: 64px; }

	/* الكوزمتكس */
	.bq-coming { padding: clamp(40px, 9vw, 64px) var(--bq-sp-4); }
	.bq-coming__form { flex-direction: column; }
	.bq-coming__form input { min-width: 0; width: 100%; }
	.bq-coming__form .bq-btn { width: 100%; }

	/* رأس القسم */
	.bq-sechead { margin-bottom: var(--bq-sp-5); }
	.bq-sechead--split { flex-direction: row; align-items: center; }
	.bq-sechead__sub { display: none; }

	/* بطاقة المنتج */
	.bq-card__body { padding: 12px 6px 10px; }
	.bq-card__actions { flex-direction: column; padding-top: 10px; }
	.bq-card__actions .bq-btn { max-width: none; width: 100%; }
	.bq-card__buy { display: none; }
	/* الأدوات تبقى ظاهرة على اللمس */
	.bq-card__tools > * { opacity: 1; transform: none; width: 36px; height: 36px; }
	.bq-card__sizes { display: none; }
	.bq-badge { font-size: 10px; padding: 4px 8px; }

	/* المتجر */
	.bq-shop__bar { gap: 10px; }
	.woocommerce-ordering select { min-width: 0; width: 100%; }
	.woocommerce-result-count { width: 100%; }

	/* المنتج */
	.bq-product__summary .price { font-size: var(--bq-fs-lg); }
	.cart { gap: 10px; }
	.single_add_to_cart_button { min-width: 100%; }
	.woocommerce-product-gallery .flex-control-thumbs li { width: 64px; }
	.wc-tabs { gap: var(--bq-sp-4); justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
	.wc-tabs li a { white-space: nowrap; }

	/* السلة: جدول متجاوب */
	.shop_table thead { display: none; }
	.shop_table, .shop_table tbody, .shop_table tr, .shop_table td { display: block; width: 100%; }
	.shop_table tr {
		position: relative;
		border-top: 1px solid var(--bq-line);
		padding: var(--bq-sp-3) 0;
		display: grid;
		grid-template-columns: 84px 1fr;
		gap: 4px 14px;
		align-items: start;
	}
	.shop_table td { border: 0; padding: 2px 0; }
	.shop_table .product-thumbnail { grid-row: span 4; }
	.shop_table .product-remove { position: absolute; inset-block-start: 10px; inset-inline-end: 0; }
	.shop_table td::before {
		content: attr(data-title) ': ';
		font-size: var(--bq-fs-xs);
		color: var(--bq-muted);
	}
	.shop_table .product-thumbnail::before, .shop_table .product-remove::before, .shop_table .actions::before { content: none; }
	.shop_table tr.cart_item .product-name::before { content: none; }
	.coupon { width: 100%; }
	.coupon input { max-width: none; flex: 1; }
	.cart-collaterals { justify-content: stretch; }
	.cart_totals { width: 100%; }

	/* الفوتر: أكورديون */
	.bq-footer__top { grid-template-columns: 1fr; gap: 0; }
	.bq-footer__col:nth-child(4) { display: block; }
	.bq-footer__brand { margin-bottom: var(--bq-sp-5); text-align: center; }
	.bq-footer__brand .bq-logo { text-align: center; }
	.bq-footer__brand .bq-logo__img { margin-inline: auto; height: 70px; }
	.bq-footer__about { max-width: none; margin-inline: auto; }
	.bq-footer__brand .bq-social { justify-content: center; }
	.bq-footer__col { border-top: 1px solid var(--bq-line); }
	.bq-footer__title { padding: 16px 0; cursor: pointer; }
	.bq-footer__title--static { cursor: default; }
	.bq-footer__chev { display: block; transition: transform var(--bq-t-fast); color: var(--bq-muted); }
	.bq-footer__title[aria-expanded="true"] .bq-footer__chev { transform: rotate(180deg); }
	.bq-footer__panel {
		display: grid;
		grid-template-rows: 0fr;
		transition: grid-template-rows 320ms var(--bq-ease-out);
	}
	.bq-footer__panel > * { overflow: hidden; }
	.bq-footer__col.is-open .bq-footer__panel { grid-template-rows: 1fr; }
	.bq-footer__list { padding-bottom: var(--bq-sp-4); }
	.bq-footer__contact .bq-footer__panel { grid-template-rows: 1fr; }
	.bq-footer__bottom { flex-direction: column; text-align: center; gap: 10px; }

	/* واتساب وشريط الشراء */
	.bq-wa-float { inset-block-end: 16px; inset-inline-start: 16px; width: 52px; height: 52px; max-width: 52px; }
	.bq-wa-float:hover { max-width: 52px; }
	.bq-wa-float__text { display: none; }
	body.bq-has-stickybar .bq-wa-float { inset-block-end: 82px; }

	/* النوافذ */
	.bq-modal__box { padding: var(--bq-sp-5) var(--bq-sp-4); max-height: 92vh; }
	.bq-quickview { grid-template-columns: 1fr; gap: var(--bq-sp-4); }
	.bq-quickview__media { max-width: 220px; margin-inline: auto; }

	.bq-pagehead { padding-block: var(--bq-sp-6) var(--bq-sp-4); }
}

/* ============ ≤ 560px ============ */
@media (max-width: 560px) {
	.bq-countdown { gap: 10px; padding: 12px; }
	.bq-countdown__unit { min-width: 54px; }
	.bq-insta { grid-template-columns: repeat(2, 1fr); }
	.bq-quote { padding: var(--bq-sp-4); }
	.woocommerce-account .u-columns { grid-template-columns: 1fr; }
}

/* ============ ≤ 380px (أصغر الشاشات) ============ */
@media (max-width: 380px) {
	:root { --bq-gutter: 12px; }
	.bq-card__title { font-size: var(--bq-fs-sm); }
	.bq-card__price { font-size: var(--bq-fs-base); }
	.bq-btn { padding-inline: 16px; font-size: var(--bq-fs-sm); }
	.bq-trust { grid-template-columns: 1fr; }
	.bq-stickybar__name { max-width: 34vw; }
}

/* ============ منع أي تمرير أفقي ============ */
html, body { max-width: 100%; }
.bq-page { overflow-x: clip; }

/* ============ الطباعة ============ */
@media print {
	.bq-header, .bq-footer, .bq-wa-float, .bq-topbar, .bq-stickybar, .bq-drawer { display: none !important; }
}
