/* ==========================================================================
   Perfume Brand — Shop Selector (Plugin 1)
   Uses the Astra Luna brand tokens when present, with standalone fallbacks.
   ========================================================================== */

/* ==========================================================================
   Arabic typography — applies ONLY on the RTL/Arabic version (body.rtl).
   Aref Ruqaa for display/headings, Cairo for body/UI. The fonts are enqueued
   conditionally (is_rtl) so English never downloads them. The body rule avoids
   !important and wildcards so icon fonts keep their own family.
   ========================================================================== */
body.rtl,
body.rtl input, body.rtl select, body.rtl textarea, body.rtl button { font-family: 'Cairo', Tahoma, Arial, sans-serif; }
body.rtl h1, body.rtl h2, body.rtl h3, body.rtl h4, body.rtl h5, body.rtl h6,
body.rtl .title, body.rtl .wd-entities-title, body.rtl .product_title,
body.rtl .uno-hero-video__title { font-family: 'Aref Ruqaa', 'Cairo', serif !important; }

.pbm-shopbar {
	background: var(--luna-panel, #F5F2EC);
	border-bottom: 1px solid var(--luna-line-2, #E8E0D4);
	font-family: var(--luna-font-body, "Inter", sans-serif);
	font-size: 13px;
}
.pbm-shopbar__inner {
	max-width: 1200px;
	margin-inline: auto;
	padding: 10px clamp(16px, 4vw, 40px);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}
.pbm-shopbar__label { color: var(--luna-text-soft, #7A7168); }
.pbm-shopbar__label strong { color: var(--luna-ink, #2C2824); font-weight: 600; }
.pbm-shopbar__pills,
.pbm-shopbar__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pbm-shopbar__switch { font-size: 12px; color: var(--luna-muted, #9B9488); margin-inline-end: 2px; }

/* Pills (shared by bar + find-a-shop) */
.pbm-pill {
	display: inline-block;
	padding: 6px 14px;
	border: 1.5px solid var(--luna-line-4, #D4C8B4);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--luna-ink, #2C2824);
	background: #fff;
	text-decoration: none;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.pbm-pill:hover { background: var(--luna-ink, #2C2824); border-color: var(--luna-ink, #2C2824); color: #fff; }
.pbm-pill.is-active { background: var(--luna-ink, #2C2824); border-color: var(--luna-ink, #2C2824); color: #fff; }
.pbm-pill--ghost { background: transparent; color: var(--luna-text-soft, #7A7168); border-style: dashed; }

/* Availability badge spacing */
.pbm-loop-badge { display: block; margin-top: 8px; }
.pbm-single-badge { margin: 10px 0 16px; }

/* Badge fallback (theme refines .luna-stock-badge) */
.luna-stock-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 500;
	padding: 6px 14px;
	border-radius: 999px;
}
.luna-stock-badge--in    { background: rgba(107,143,107,.12); color: var(--luna-success, #6B8F6B); }
.luna-stock-badge--out   { background: rgba(176,65,62,.10);  color: var(--luna-danger, #B0413E); }
.luna-stock-badge--other { background: var(--luna-panel, #F5F2EC); color: var(--luna-gold-deep, #9B7B3C); }

/* ---- Product cards + shop archive: white background ----
   The WoodMart "Perfume" demo paints (a) a gray card behind each product
   (.wd-product-card-bg) and (b) the whole products section #F1F1F1 via the
   Elementor shop-archive template (element 9738884). Force both white so the
   catalogue sits cleanly on the white page. */
.wd-product-card-bg { background-color: #fff !important; }
.elementor-element-9738884 > .elementor-motion-effects-container > .elementor-motion-effects-layer,
.elementor-element-9738884,
body.post-type-archive-product .elementor-motion-effects-layer,
body.tax-product_cat .elementor-motion-effects-layer { background-color: #fff !important; }

/* Hide TranslatePress's floating bottom-corner switcher — we use our own top-bar toggle. */
.trp-floating-switcher,
.trp-language-switcher.trp-floating-switcher { display: none !important; }

/* ---- Language switcher in the top utility bar: clean "EN | العربية" toggle, pinned right ---- */
.pbm-shopbar__lang { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 8px; }
.pbm-lang { font-size: 13px; font-weight: 600; letter-spacing: .4px; text-decoration: none; color: var(--luna-text-soft, #7A7168); transition: color .2s ease; line-height: 1; }
.pbm-lang:hover { color: var(--luna-ink, #2C2824); }
.pbm-lang.is-active { color: var(--luna-gold-deep, #9B7B3C); }
.pbm-lang__sep { color: var(--luna-line-4, #D4C8B4); font-size: 12px; }
/* Stay visible even when the bar is compact / mobile-collapsed. */
.pbm-shopbar--compact .pbm-shopbar__lang { display: inline-flex !important; }
@media (max-width: 600px) { .pbm-shopbar__lang { order: 2; } }

/* ---- Blog: uniform featured-image thumbnails so the grid aligns (crop all to 3:2) ---- */
.blog-post-loop .wd-post-img { aspect-ratio: 3 / 2; overflow: hidden; }
.blog-post-loop .wd-post-img img { width: 100% !important; height: 100% !important; object-fit: cover; object-position: center; display: block; }

/* ---- Find a Shop directory ---- */
.pbm-find { max-width: 1100px; margin-inline: auto; }
.pbm-find__filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 24px; }
.pbm-find__map-note {
	text-align: center;
	color: var(--luna-muted, #9B9488);
	font-size: 13px;
	padding: 22px;
	border: 1px dashed var(--luna-line-4, #D4C8B4);
	border-radius: 8px;
	margin-bottom: 28px;
}
.pbm-find__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 18px;
}
.pbm-shop-card {
	background: #fff;
	border: 1px solid var(--luna-line, #F0ECE6);
	border-radius: 8px;
	padding: 22px;
}
.pbm-shop-card__name {
	font-family: var(--luna-font-display, "Cormorant Garamond", serif);
	font-size: 22px;
	font-weight: 500;
	color: var(--luna-ink, #2C2824);
}
.pbm-shop-card__name-ar {
	font-family: var(--luna-font-display-ar, "Aref Ruqaa", serif);
	font-size: 18px;
	color: var(--luna-muted-2, #B8A88A);
	margin-bottom: 6px;
}
.pbm-shop-card__meta { font-size: 13px; color: var(--luna-text-soft, #7A7168); margin-top: 2px; }
.pbm-shop-card__stock { font-size: 13px; color: var(--luna-success, #6B8F6B); margin: 10px 0 14px; font-weight: 500; }
.pbm-shop-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pbm-find__empty { text-align: center; color: var(--luna-muted, #9B9488); padding: 24px; }

/* Find a Shop — search / geolocate / distance / nearest */
.pbm-find__tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-bottom: 16px; }
.pbm-find__search {
	flex: 1 1 280px;
	max-inline-size: 360px;
	border: 1px solid var(--luna-line-4, #D4C8B4);
	background: #fff;
	padding: 10px 14px;
	font-size: 14px;
	font-family: inherit;
	color: var(--luna-ink, #2C2824);
}
.pbm-find__locate { cursor: pointer; }
.pbm-find__nearest {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: var(--luna-panel, #F5F2EC);
	border: 1px solid var(--luna-line-2, #E8E0D4);
	padding: 12px 16px;
	margin-bottom: 18px;
	font-size: 14px;
	color: var(--luna-ink, #2C2824);
}
.pbm-shop-card__distance { font-size: 12px; color: var(--luna-gold-deep, #9B7B3C); margin-top: 4px; font-weight: 600; }
.pbm-shop-card.is-nearest { border-color: var(--luna-gold, #C4A265); box-shadow: inset 0 0 0 2px var(--luna-gold, #C4A265); }

/* ---- Header emirate → shop dropdowns ---- */
.pbm-shopbar__emirates { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pbm-emirate { position: relative; }
.pbm-emirate__btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 14px;
	border: 1.5px solid var(--luna-line-4, #D4C8B4);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--luna-ink, #2C2824);
	background: #fff;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.pbm-emirate__btn:hover { border-color: var(--luna-ink, #2C2824); }
.pbm-emirate.is-active .pbm-emirate__btn { background: var(--luna-ink, #2C2824); color: #fff; border-color: var(--luna-ink, #2C2824); }
.pbm-emirate__caret { font-size: 9px; }
.pbm-emirate__shops {
	position: absolute;
	inset-block-start: calc(100% + 6px);
	inset-inline-start: 0;
	z-index: 60;
	min-inline-size: 250px;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--luna-line-2, #E8E0D4);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
	padding: 6px;
}
.pbm-emirate__shops[hidden] { display: none; }
.pbm-emirate__shop {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 9px 12px;
	color: var(--luna-ink, #2C2824);
	text-decoration: none;
	font-size: 13px;
}
.pbm-emirate__shop:hover { background: var(--luna-panel, #F5F2EC); }
.pbm-emirate__shop.is-current { background: var(--luna-panel, #F5F2EC); }
.pbm-emirate__shop-name { font-weight: 500; }
.pbm-emirate__shop-stock { color: var(--luna-success, #459647); font-size: 12px; white-space: nowrap; }

/* ---- Shop-picker modal (header emirate click) ---- */
.pbm-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.pbm-modal[hidden] { display: none; }
.pbm-modal__overlay { position: absolute; inset: 0; background: rgba(20, 18, 16, 0.55); }
.pbm-modal__box {
	position: relative;
	z-index: 1;
	inline-size: min(440px, 92vw);
	max-block-size: 80vh;
	overflow: auto;
	background: #fff;
	border-radius: var(--luna-radius, 0);
	padding: 28px 24px 22px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}
/* High specificity + !important resets so WoodMart's default <button> chrome
   (gray background, min-width, padding) can't leak in and shove the × off. */
.pbm-modal .pbm-modal__close {
	position: absolute !important;
	inset-block-start: 8px;
	inset-inline-end: 8px;
	inset-inline-start: auto !important;   /* guard against RTL / theme setting left */
	z-index: 2;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	inline-size: 34px;
	block-size: 34px;
	min-width: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 999px;
	background: transparent !important;
	box-shadow: none !important;
	font-size: 24px;
	line-height: 1;
	color: var(--luna-muted, #9B9488);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}
.pbm-modal .pbm-modal__close:hover,
.pbm-modal .pbm-modal__close:focus {
	background: var(--luna-panel, #F5F2EC) !important;
	color: var(--luna-ink, #2C2824);
}
.pbm-modal__title { font-family: var(--luna-font-display, Georgia, serif); font-size: 24px; margin: 0 0 2px; color: var(--luna-ink, #2C2824); }
.pbm-modal__sub { font-size: 13px; color: var(--luna-muted, #9B9488); margin: 0 0 16px; }
.pbm-modal__body { display: flex; flex-direction: column; gap: 6px; }
.pbm-modal__body .pbm-emirate__shop { border: 1px solid var(--luna-line, #F0ECE6); }

/* ==========================================================================
   Mobile collapse (CSS-only): compact "📍 [shop] ▾" toggle on phones.
   Placed LAST so these overrides win on source order over the desktop
   .pbm-shopbar__emirates / __actions display rules defined earlier.
   ========================================================================== */
.pbm-shopbar__cb { display: none; }            /* hidden checkbox = the open/closed state-holder */
.pbm-shopbar__toggle { display: none; }        /* hidden on desktop — the full bar shows instead */
.pbm-shopbar__toggle-caret { font-size: 10px; transition: transform 0.2s ease; }

@media (max-width: 600px) {
	.pbm-shopbar__inner { flex-wrap: wrap; row-gap: 10px; justify-content: center; }
	.pbm-shopbar__toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		inline-size: 100%;
		font-size: 13px;
		font-weight: 600;
		color: var(--luna-ink, #2C2824);
		cursor: pointer;
		padding: 2px 0;
	}
	/* Collapsed by default on phones */
	.pbm-shopbar__label,
	.pbm-shopbar__emirates,
	.pbm-shopbar__actions { display: none; inline-size: 100%; }
	/* Expanded only when the toggle is checked */
	.pbm-shopbar__cb:checked ~ .pbm-shopbar__label { display: block; text-align: center; }
	.pbm-shopbar__cb:checked ~ .pbm-shopbar__emirates { display: flex; flex-wrap: wrap; justify-content: center; }
	.pbm-shopbar__cb:checked ~ .pbm-shopbar__actions { display: flex; justify-content: center; }
	.pbm-shopbar__cb:checked ~ .pbm-shopbar__toggle .pbm-shopbar__toggle-caret { transform: rotate(180deg); }
	.pbm-shopbar__switch { display: none; }       /* "Change:" label is redundant in the compact panel */
	/* Keep the emirate→shop dropdown inside the viewport */
	.pbm-emirate__shops { min-inline-size: min(280px, 84vw); }
}

/* ==========================================================================
   Compact bar when NO shop is chosen yet: collapse to a single "Choose
   location" toggle on ALL widths (desktop included) so the always-on bar
   doesn't compete with the first-visit popup. Placed after the mobile block
   so these win on source order. Once a shop is chosen the class is dropped
   (PHP) and the full "Shopping from …" status line shows as normal.
   ========================================================================== */
.pbm-shopbar--compact .pbm-shopbar__toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--luna-ink, #2C2824);
	cursor: pointer;
}
.pbm-shopbar--compact .pbm-shopbar__label,
.pbm-shopbar--compact .pbm-shopbar__emirates,
.pbm-shopbar--compact .pbm-shopbar__actions { display: none; }
.pbm-shopbar--compact .pbm-shopbar__cb:checked ~ .pbm-shopbar__emirates { display: flex; }
.pbm-shopbar--compact .pbm-shopbar__cb:checked ~ .pbm-shopbar__actions { display: flex; }
/* Keep the verbose "Choose your emirate…" label hidden even when expanded — the toggle already says it. */
.pbm-shopbar--compact .pbm-shopbar__cb:checked ~ .pbm-shopbar__label { display: none; }
.pbm-shopbar--compact .pbm-shopbar__cb:checked ~ .pbm-shopbar__toggle .pbm-shopbar__toggle-caret { transform: rotate(180deg); }

/* ==========================================================================
   First-visit welcome / location prompt (skippable) — auto-opens once.
   ========================================================================== */
.pbm-welcome { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.pbm-welcome[hidden] { display: none; }
.pbm-welcome__overlay { position: absolute; inset: 0; background: rgba(20, 18, 16, 0.6); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.pbm-welcome__box {
	position: relative;
	z-index: 1;
	inline-size: min(460px, 94vw);
	background: var(--luna-bg, #FAFAF7);
	border-radius: var(--luna-radius, 0);
	padding: 36px 30px 28px;
	text-align: center;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
}
.pbm-welcome__title {
	font-family: var(--luna-font-display, "Cormorant Garamond", Georgia, serif);
	font-size: 28px;
	font-weight: 500;
	color: var(--luna-ink, #2C2824);
	margin: 0 0 8px;
}
.pbm-welcome__sub { font-size: 13px; color: var(--luna-text-soft, #7A7168); margin: 0 0 22px; line-height: 1.5; }
.pbm-welcome__emirates { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 18px; }
.pbm-welcome__emirate {
	display: inline-block;
	padding: 10px 20px;
	border: 1.5px solid var(--luna-line-4, #D4C8B4);
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	color: var(--luna-ink, #2C2824);
	background: #fff;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.pbm-welcome__emirate:hover { background: var(--luna-ink, #2C2824); border-color: var(--luna-ink, #2C2824); color: #fff; }
.pbm-welcome__detect {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	inline-size: 100%;
	padding: 12px 18px;
	margin-bottom: 14px;
	border: 0;
	background: var(--luna-gold, #C4A265);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.3px;
	cursor: pointer;
	border-radius: var(--luna-radius, 0);
	transition: opacity 0.2s ease;
}
.pbm-welcome__detect:hover { opacity: 0.9; }
.pbm-welcome__detect:disabled { opacity: 0.6; cursor: default; }
.pbm-welcome__skip {
	display: inline-block;
	background: none;
	border: 0;
	color: var(--luna-muted, #9B9488);
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
	padding: 4px;
}
.pbm-welcome__skip:hover { color: var(--luna-ink, #2C2824); }
.pbm-welcome__note { font-size: 12px; color: var(--luna-danger, #B0413E); margin: 8px 0 0; }
@media (max-width: 480px) {
	.pbm-welcome__box { padding: 28px 20px 22px; }
	.pbm-welcome__title { font-size: 23px; }
}
