/*!
 * نادي كباتن بَلي — store page /vendor/<id>/ (handle `bdc-vendor`, after `bdc`).
 * Boards: After-dc-mobile (page of record), Comp-dc-store-header, Comp-dc-branch-card.
 */

/* ── Header: banner (cover, or the logo when there is none), logo on its edge, name */
.bdc-vhead__ban {
	display: flex; align-items: center; justify-content: center;
	aspect-ratio: 2 / 1;
	/* Phones: full-bleed, straight under the header (cancels the shell's page-top space). */
	margin-block-start: calc(var(--bsy-page-top, 16px) * -1);
	margin-inline: calc(var(--bsy-gutter) * -1);
	background: var(--bsy-grey-100);
	overflow: hidden;
}
.bdc-vhead__ban > .bdc-vhead__cover { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A wordmark/logo cover: whole, on the neutral ground, with an edge — never blown up. */
.bdc-vhead__ban--art > .bdc-vhead__cover { object-fit: contain; }
.bdc-vhead__ban--art { box-shadow: inset 0 0 0 1px var(--bsy-line); }
.bdc .bdc-vhead__mark {
	display: flex; align-items: center; justify-content: center;
	box-sizing: border-box; width: 104px; height: 104px;
	border: 1px solid var(--bsy-line); border-radius: var(--bsy-radius-xl);
	background: var(--bsy-white); object-fit: cover;
	font-size: var(--bsy-text-2xl); font-weight: var(--bsy-fw-bold); color: var(--bsy-fg2);
}
.bdc-vhead__row { position: relative; display: flex; flex-direction: column; gap: var(--bsy-space-4); padding-block-start: var(--bsy-space-10); }
.bdc-vhead__row--plain { padding-block-start: var(--bsy-space-5); } /* no edge logo to clear */
.bdc .bdc-vhead__logo {
	position: absolute; inset-block-start: -28px; inset-inline-start: 0;
	display: flex; align-items: center; justify-content: center;
	box-sizing: border-box; width: 64px; height: 64px;
	border: 3px solid var(--bsy-white); border-radius: var(--bsy-radius-md);
	background: var(--bsy-white); object-fit: cover;
	box-shadow: var(--bsy-shadow-1);
	font-size: var(--bsy-text-lg); font-weight: var(--bsy-fw-bold); color: var(--bsy-fg2);
}
.bdc-vhead__tx { display: flex; flex-direction: column; gap: var(--bsy-space-1); min-width: 0; }
.bdc-vhead__h {
	margin: 0;
	font-size: var(--bsy-text-h1-sm); font-weight: var(--bsy-fw-black); line-height: var(--bsy-leading-h1);
	color: var(--bsy-ink); overflow-wrap: anywhere;
}
.bdc-vhead__meta {
	display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--bsy-space-4);
	margin: 0;
	font-size: var(--bsy-text-sm); line-height: 1.5; color: var(--bsy-fg2);
	font-variant-numeric: tabular-nums;
}
.bdc-vhead__meta > :is(a, span):not(.bsy-status) { display: inline-flex; align-items: center; gap: 6px; }
.bdc-vhead__meta .bdc-i { color: var(--bsy-muted); }
.bdc-vhead__svc { color: inherit; text-decoration: none; }
.bdc-vhead__svc:hover { color: var(--bsy-brand); }
.bdc-vhead__acts { display: flex; gap: var(--bsy-space-3); }
.bdc-vhead__acts .bsy-btn { flex: 1 1 auto; }
.bdc-vhead__loc { display: none; }
@media (min-width: 641px) {
	/* 3:1, up to 400px: about two thirds of a 2:1 cover show (240px cut 64%). */
	.bdc-vhead__ban { width: 100%; aspect-ratio: 3 / 1; max-height: 400px; margin: 0; border-radius: var(--bsy-radius-xl); }
	.bdc-vhead__ban > .bdc-vhead__cover { object-position: center 40%; }
	.bdc-vhead__ban--logo { aspect-ratio: auto; height: 240px; }
	.bdc-vhead__row--plain { padding-block-start: var(--bsy-space-6); }
	.bdc .bdc-vhead__mark { width: 128px; height: 128px; }
	.bdc-vhead__row { flex-direction: row; align-items: flex-end; gap: var(--bsy-space-6); padding: 0 var(--bsy-space-6); }
	.bdc .bdc-vhead__logo {
		position: static; flex: none;
		width: 96px; height: 96px; margin-block-start: -48px;
		border-width: 4px; border-radius: var(--bsy-radius-xl);
	}
	.bdc-vhead__tx { flex: 1 1 auto; padding-block: var(--bsy-space-4) var(--bsy-space-1); }
	.bdc-vhead__h { font-size: var(--bsy-text-h1); }
	.bdc-vhead__acts { flex: none; padding-block-end: var(--bsy-space-2); }
	.bdc-vhead__acts .bsy-btn { flex: none; }
	.bdc-vhead__loc { display: inline-flex; }
	.bdc-vhead__more { display: none; }
}

/* ── Body: main column (offers, branch card) + similar stores beside it */
.bdc-vgrid { display: flex; flex-direction: column; }
.bdc-vmain { min-width: 0; }
@media (min-width: 961px) {
	.bdc-vgrid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--bsy-space-12); align-items: start; }
}

/* ── Offers */
.bdc-offers__list { display: flex; flex-direction: column; gap: var(--bsy-space-3); margin: 0; padding: 0; list-style: none; }
.bdc-offer {
	display: flex; flex-direction: column; gap: var(--bsy-space-3);
	padding: var(--bsy-space-4);
	border: 1px solid var(--bsy-line); border-radius: var(--bsy-radius-lg);
}
.bdc-offer__desc, .bdc-offer__list { margin: 0; font-size: var(--bsy-text-base); line-height: var(--bsy-leading-relaxed); color: var(--bsy-fg2); }
.bdc-offer__list { padding-inline-start: var(--bsy-space-5); }
.bdc-offer__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bsy-space-2) var(--bsy-space-3); margin: 0; }
.bdc-offer__valid { font-size: var(--bsy-text-sm); color: var(--bsy-muted); }
.bdc-how {
	display: flex; flex-direction: column; gap: var(--bsy-space-1);
	margin-block-start: var(--bsy-space-3); padding: var(--bsy-space-4);
	border-radius: var(--bsy-radius-md); background: var(--bsy-grey-50);
}
.bdc-how p { margin: 0; font-size: var(--bsy-text-base); line-height: var(--bsy-leading-relaxed); color: var(--bsy-fg2); }
.bdc-how .bdc-how__t { font-weight: var(--bsy-fw-bold); line-height: 1.4; color: var(--bsy-ink); }

/* ── Branch card: map, then each fact once */
.bdc-branch { scroll-margin-block-start: calc(var(--bch-header-h, var(--bsy-size-header)) + var(--bsy-space-4)); }
.bdc-bc { border: 1px solid var(--bsy-line); border-radius: var(--bsy-radius-lg); overflow: hidden; }
.bdc-bc__body { display: flex; flex-direction: column; gap: var(--bsy-space-4); padding: var(--bsy-space-4); }
.bdc-bc__h { margin: 0; font-size: var(--bsy-text-md); font-weight: var(--bsy-fw-semibold); line-height: 1.35; }
.bdc-info { display: flex; flex-direction: column; gap: var(--bsy-space-4); margin: 0; padding: 0; list-style: none; }
.bdc-info > li { display: flex; align-items: flex-start; gap: var(--bsy-space-3); font-size: var(--bsy-text-base); line-height: 1.5; color: var(--bsy-ink); }
.bdc-info > li > .bdc-i { color: var(--bsy-muted); margin-block-start: 2px; }
.bdc-info small { display: block; margin-block-start: 2px; }
.bdc-info > .bdc-info__tel { align-items: center; } /* number and «نسخ الرقم» on one centre line */
.bdc-info__tel > a { color: var(--bsy-ink); text-decoration: none; }
.bdc-num { font-variant-numeric: tabular-nums; }
.bdc-copy {
	margin-inline-start: var(--bsy-space-2); flex: none; /* right after the number */
	height: var(--bsy-size-tap); padding-inline: var(--bsy-space-4);
	border: 1px solid var(--bsy-line-strong); border-radius: var(--bsy-radius-pill);
	background: var(--bsy-white); color: var(--bsy-ink);
	font-family: var(--bsy-font); font-size: var(--bsy-text-sm); font-weight: var(--bsy-fw-medium);
	cursor: pointer;
}
.bdc-copy:hover { background: var(--bsy-grey-50); }
.bdc-copy.is-done { color: var(--bsy-ok); }
.bdc-route { display: flex; gap: var(--bsy-space-2); }
.bdc-route .bsy-btn { flex: 1 1 0; min-width: 0; }
@media (min-width: 641px) {
	.bdc-bc__body { padding: var(--bsy-space-5); }
}

/* Chains: a row per branch (call + show on map), the chosen one with its route. */
.bdc-brs { margin: 0; padding: 0; list-style: none; }
.bdc-br { display: flex; flex-direction: column; gap: var(--bsy-space-3); padding-block: var(--bsy-space-3); border-block-start: 1px solid var(--bsy-line); }
.bdc-brs:first-child > .bdc-br:first-child { border-block-start: 0; padding-block-start: 0; }
.bdc-br.is-on { margin-inline: calc(var(--bsy-space-4) * -1); padding-inline: var(--bsy-space-4); background: var(--bsy-grey-50); }
.bdc-brs:first-child > .bdc-br.is-on:first-child { padding-block-start: var(--bsy-space-3); }
.bdc-br__top { display: flex; align-items: center; gap: var(--bsy-space-2); }
.bdc-br__tx { flex: 1 1 auto; min-width: 0; }
.bdc-br__n { margin: 0; font-size: var(--bsy-text-base); font-weight: var(--bsy-fw-semibold); line-height: 1.4; }
.bdc-br__a { margin: 2px 0 0; font-size: var(--bsy-text-sm); line-height: 1.5; color: var(--bsy-fg2); }
.bdc-br__hrs { white-space: nowrap; }
/* Phones: address on line 1, hours on line 2 (Comp-dc-branch-card). */
@media (max-width: 640px) {
	.bdc-br__sep { display: none; }
	.bdc-br__hrs { display: block; }
}
.bdc-brs__sum {
	display: flex; align-items: center; min-height: var(--bsy-size-tap);
	padding-block-start: var(--bsy-space-3); border-block-start: 1px solid var(--bsy-line);
	font-size: var(--bsy-text-base); font-weight: var(--bsy-fw-semibold); color: var(--bsy-brand);
	list-style: none; cursor: pointer;
}
.bdc-brs__sum::-webkit-details-marker { display: none; }
.bdc-brs__more:not([open]) .bdc-brs__hide,
.bdc-brs__more[open] .bdc-brs__show { display: none; }
@media (min-width: 641px) {
	.bdc-br.is-on { margin-inline: calc(var(--bsy-space-5) * -1); padding-inline: var(--bsy-space-5); }
}

/* The map: today's MapLibre + OpenFreeMap view (bdc-map.js), on --bsy-* tokens. */
.bdc-loc__vp { position: relative; height: 220px; background: var(--bsy-grey-100); overflow: hidden; isolation: isolate; } /* its layers never paint over the sticky header */
@media (min-width: 641px) {
	.bdc-loc__vp { height: 280px; }
}
/* Two classes on purpose: MapLibre's own .maplibregl-map sets position:relative
   and loads later — a single class would lose, collapsing the map. */
.bdc-loc .bdc-loc__map { position: absolute; inset: 0; z-index: 0; background: var(--bsy-grey-100); }
.bdc-loc__ui { position: absolute; z-index: 2; inset-block-start: var(--bsy-space-3); inset-inline-start: var(--bsy-space-3); display: flex; gap: var(--bsy-space-2); }
.bdc-loc__btn {
	display: flex; align-items: center; justify-content: center;
	width: var(--bsy-size-tap); height: var(--bsy-size-tap); padding: 0;
	border: 1px solid var(--bsy-line-strong); border-radius: var(--bsy-radius-pill);
	background: var(--bsy-white); color: var(--bsy-ink);
	cursor: pointer;
}
.bdc-loc__btn:hover { background: var(--bsy-grey-50); }
.bdc-loc__btn:disabled { color: var(--bsy-grey-300); cursor: default; }
.bdc-loc__attr {
	position: absolute; z-index: 2; inset-block-end: 6px; inset-inline-end: 10px;
	box-sizing: border-box; max-inline-size: calc(100% - 20px); /* wraps on phones, never clipped */
	padding-inline: var(--bsy-space-1); border-radius: var(--bsy-radius-sm); background: var(--bsy-white);
	direction: ltr; font-size: var(--bsy-text-xs); line-height: 1.5; color: var(--bsy-muted);
}
.bdc-loc__attr a { color: inherit; }
/* Map-engine chrome off — the card brings its own controls and credit (.bdc-loc__attr). Third-party
   rules set display themselves, hence !important. */
.bdc-loc :is(.maplibregl-ctrl-attrib, .maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left, .maplibregl-ctrl-logo, .leaflet-control-attribution, .leaflet-control-zoom) { display: none !important; }
.bdc-loc .leaflet-tile-pane { filter: grayscale(1) contrast(.85) brightness(1.08); }

/* Static pins (no ping loop): the store logo in a brand ring; small dots for the other branches. */
.bdc-pin { display: flex; flex-direction: column; align-items: center; width: 44px; height: 54px; cursor: default; }
.bdc-pin.is-tap { cursor: pointer; }
.bdc-pin__disc {
	display: block; box-sizing: border-box;
	width: 44px; height: 44px; border-radius: var(--bsy-radius-pill);
	border: 3px solid var(--bsy-brand); background: var(--bsy-white) center / cover no-repeat;
}
.bdc-pin__tip { width: 0; height: 0; margin-block-start: -1px; border-inline: 7px solid transparent; border-block-start: 10px solid var(--bsy-brand); }
.bdc-pin--sm { justify-content: flex-end; } /* keeps the 44×54 hit area; the dot is 20px */
.bdc-pin--sm .bdc-pin__disc { width: 20px; height: 20px; border-width: 0; background: var(--bsy-brand); }
.bdc-pin--sm .bdc-pin__tip { border-inline-width: 4px; border-block-start-width: 7px; }

/* ── Similar stores */
.bdc-sims { margin: 0; padding: 0; list-style: none; }
.bdc-simrow { display: flex; align-items: center; gap: var(--bsy-space-3); padding-block: var(--bsy-space-3); border-block-end: 1px solid var(--bsy-line); color: var(--bsy-ink); text-decoration: none; }
.bdc-sims > li:last-child .bdc-simrow { border-block-end: 0; }
.bdc .bdc-simrow img, .bdc-simrow__mono {
	flex: none; box-sizing: border-box;
	width: 48px; height: 48px; border: 1px solid var(--bsy-line); border-radius: var(--bsy-radius-sm);
	object-fit: cover; background: var(--bsy-white);
}
.bdc-simrow__mono { display: flex; align-items: center; justify-content: center; background: var(--bsy-grey-100); font-weight: var(--bsy-fw-bold); color: var(--bsy-fg2); }
.bdc-simrow__tx { display: flex; flex-direction: column; min-width: 0; }
.bdc-simrow__n { margin: 0; font-size: var(--bsy-text-base); font-weight: var(--bsy-fw-semibold); line-height: 1.4; }
.bdc-simrow__o { font-size: var(--bsy-text-sm); line-height: 1.5; color: var(--bsy-fg2); }
.bdc-simrow__o em { font-style: normal; font-weight: var(--bsy-fw-bold); color: var(--bsy-brand); font-variant-numeric: tabular-nums; }
.bdc-simrow:hover .bdc-simrow__n { color: var(--bsy-brand); }
.bdc-similar__all { width: 100%; margin-block-start: var(--bsy-space-4); }
