/*!
 * نادي كباتن بَلي — home + listings (handle `bdc-catalogue`, after `bdc`).
 * Boards: After-dc-home, After-dc-services, After-dc-mobile (listing),
 * Comp-dc-{offer-card,category-tiles,filter-chips,city-search,banner-slider}.
 */

/* ── Home hero: title + search on one side, the banner slider on the other */
.bdc-hero { display: flex; flex-direction: column; gap: var(--bsy-space-6); }
.bdc-hero__c { display: flex; flex-direction: column; gap: var(--bsy-space-6); min-width: 0; }
@media (min-width: 961px) {
	.bdc-hero:not(.bdc-hero--solo) {
		display: grid; grid-template-columns: minmax(0, 1fr) 560px;
		gap: var(--bsy-space-12); align-items: center;
	}
	.bdc-hero .bdc-bar { max-width: 600px; }
}

/* ── Search bar: one 48px row — field + city button (Comp-dc-city-search) */
.bdc-bar { display: flex; align-items: center; gap: var(--bsy-space-2); min-width: 0; }
.bdc-search { position: relative; flex: 1 1 auto; min-width: 0; margin: 0; }
.bdc-search__field {
	display: flex; align-items: center; gap: 10px;
	box-sizing: border-box;
	height: var(--bsy-size-field);
	padding-inline: var(--bsy-space-4) var(--bsy-space-2);
	border: 1px solid var(--bsy-field-line);
	border-radius: var(--bsy-radius-pill);
	background: var(--bsy-white);
	color: var(--bsy-muted);
}
.bdc-search__field:focus-within { outline: var(--bsy-focus-ring-width) solid var(--bsy-focus-ring-color); outline-offset: var(--bsy-focus-ring-offset); }
.bdc-search__ic { display: flex; flex: none; }
.bdc-search__input {
	flex: 1 1 auto; min-width: 0;
	height: 46px; margin: 0; padding: 0;
	border: 0; background: transparent;
	font-family: var(--bsy-font); font-size: var(--bsy-text-base); font-weight: var(--bsy-fw-regular);
	color: var(--bsy-ink);
	appearance: none;
}
/* The field draws the ring (focus-within), so the bare input does not. */
.bdc-search__input:focus-visible { outline: none; }
.bdc-search__input::placeholder { color: var(--bsy-muted); opacity: 1; }
.bdc-search__input::-webkit-search-cancel-button { appearance: none; }
.bdc-search__clear {
	position: relative;
	display: flex; align-items: center; justify-content: center; flex: none;
	width: 28px; height: 28px; padding: 0;
	border: 0; border-radius: var(--bsy-radius-pill);
	background: var(--bsy-grey-100); color: var(--bsy-fg2);
	cursor: pointer;
}
.bdc-search__clear::after { content: ""; position: absolute; inset: -8px; } /* 44px tap area */

/* Suggestions (combobox popup): grouped stores and services. */
.bdc-suggest {
	position: absolute; z-index: 30;
	inset-block-start: calc(100% + var(--bsy-space-2)); inset-inline: 0;
	box-sizing: border-box;
	max-height: 440px; overflow-y: auto;
	padding: var(--bsy-space-2);
	border: 1px solid var(--bsy-line);
	border-radius: var(--bsy-radius-lg);
	background: var(--bsy-white);
	box-shadow: var(--bsy-shadow-2);
}
.bdc-suggest__h {
	margin: 0; padding: var(--bsy-space-2) var(--bsy-space-3) var(--bsy-space-1);
	font-size: var(--bsy-text-sm); font-weight: var(--bsy-fw-medium); color: var(--bsy-muted);
}
.bdc-sugg {
	display: flex; align-items: center; gap: var(--bsy-space-3);
	min-height: 56px; padding: var(--bsy-space-2) var(--bsy-space-3);
	border-radius: var(--bsy-radius-md);
	cursor: pointer;
}
.bdc-sugg:hover, .bdc-sugg[aria-selected="true"] { background: var(--bsy-grey-50); }
.bdc-sugg__ic, .bdc .bdc-sugg img {
	flex: none; box-sizing: border-box;
	width: 40px; height: 40px; border-radius: var(--bsy-radius-sm);
	object-fit: cover; background: var(--bsy-white);
}
.bdc-sugg img { border: 1px solid var(--bsy-line); }
.bdc-sugg__ic { display: flex; align-items: center; justify-content: center; background: var(--bsy-grey-50); color: var(--bsy-ink); border-radius: var(--bsy-radius-pill); }
.bdc-sugg__tx { display: flex; flex-direction: column; min-width: 0; }
.bdc-sugg__n { font-size: var(--bsy-text-base); font-weight: var(--bsy-fw-semibold); line-height: 1.4; color: var(--bsy-ink); }
.bdc-sugg__m { font-size: var(--bsy-text-sm); line-height: 1.5; color: var(--bsy-muted); }
.bdc-suggest__empty { margin: 0; padding: var(--bsy-space-3); font-size: var(--bsy-text-sm); line-height: var(--bsy-leading-small); color: var(--bsy-fg2); }

/* City button + menu. */
.bdc-city { position: relative; flex: none; }
.bdc-city__btn {
	position: relative;
	display: inline-flex; align-items: center; justify-content: center; gap: var(--bsy-space-2);
	box-sizing: border-box;
	width: var(--bsy-size-field); height: var(--bsy-size-field); padding: 0;
	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-base); font-weight: var(--bsy-fw-regular);
	cursor: pointer;
}
.bdc-city__btn:hover { background: var(--bsy-grey-50); }
.bdc-city__pin { color: var(--bsy-fg2); }
.bdc-city__l, .bdc-city__chev { display: none; }
.bdc-city__btn[data-on] { background: var(--bsy-brand-lighter); }
.bdc-city__btn[data-on] .bdc-city__pin { color: var(--bsy-brand); }
/* Phones show only the pin: a dot on it says a city is picked. */
.bdc-city__btn[data-on]::after {
	content: ""; position: absolute; inset-block-start: 10px; inset-inline-end: 10px;
	width: 8px; height: 8px; border-radius: var(--bsy-radius-pill);
	background: var(--bsy-brand);
}
.bdc-city__pop {
	position: absolute; z-index: 40;
	inset-block-start: calc(100% + var(--bsy-space-2)); inset-inline-end: 0;
	box-sizing: border-box;
	width: min(300px, calc(100vw - 32px)); max-height: 360px; overflow-y: auto;
	padding: var(--bsy-space-2);
	border: 1px solid var(--bsy-line); border-radius: var(--bsy-radius-lg);
	background: var(--bsy-white); box-shadow: var(--bsy-shadow-2);
}
.bdc-city__opt {
	display: flex; align-items: center; gap: 10px;
	box-sizing: border-box; width: 100%;
	min-height: var(--bsy-size-tap); padding: 0 var(--bsy-space-3);
	border: 0; border-radius: var(--bsy-radius-sm);
	background: none; color: var(--bsy-ink);
	font-family: var(--bsy-font); font-size: var(--bsy-text-base); text-align: start;
	cursor: pointer;
}
.bdc-city__opt:hover, .bdc-city__opt:focus-visible { background: var(--bsy-grey-50); }
.bdc-city__opt--geo { color: var(--bsy-brand); font-weight: var(--bsy-fw-semibold); }
.bdc-city__ok { margin-inline-start: auto; color: var(--bsy-brand); visibility: hidden; }
.bdc-city__opt[aria-selected="true"] { font-weight: var(--bsy-fw-semibold); }
.bdc-city__opt[aria-selected="true"] .bdc-city__ok { visibility: visible; }
@media (min-width: 641px) {
	.bdc-city__btn { width: auto; padding-inline: var(--bsy-space-4); }
	.bdc-city__btn[data-on]::after { content: none; }
	.bdc-city__l, .bdc-city__chev { display: block; }
	.bdc-city__chev { color: var(--bsy-fg2); }
}

/* ── Category tiles: one component for the home row and the listing filter */
.bdc-tiles {
	display: flex; gap: var(--bsy-space-2);
	margin: 0 calc(var(--bsy-gutter) * -1); padding: 4px var(--bsy-gutter);
	list-style: none;
	overflow-x: auto; overscroll-behavior-x: contain;
	scroll-snap-type: x proximity; scroll-padding-inline: var(--bsy-gutter);
	scrollbar-width: none;
}
.bdc-tiles::-webkit-scrollbar { display: none; }
.bdc-tiles > li { flex: none; scroll-snap-align: start; }
.bdc-tile {
	display: flex; flex-direction: column; align-items: center; gap: 10px;
	box-sizing: border-box; min-width: 76px; min-height: 88px; padding: 2px var(--bsy-space-1);
	text-align: center; text-decoration: none; color: var(--bsy-ink);
}
.bdc-tile__ic {
	display: flex; align-items: center; justify-content: center;
	width: 56px; height: 56px; border-radius: var(--bsy-radius-pill);
	background: var(--bsy-grey-50); color: var(--bsy-ink);
}
.bdc-tile__l {
	font-size: var(--bsy-text-xs); font-weight: var(--bsy-fw-medium); line-height: 1.35;
	white-space: nowrap; /* one line: two-line labels made the row ragged */
}
.bdc-tile:hover .bdc-tile__ic { background: var(--bsy-grey-100); }
.bdc-tile[aria-current="page"] .bdc-tile__ic { background: var(--bsy-brand-lighter); color: var(--bsy-brand); box-shadow: inset 0 0 0 2px var(--bsy-brand); }
.bdc-tile[aria-current="page"] .bdc-tile__l { color: var(--bsy-brand); font-weight: var(--bsy-fw-semibold); }
/* The ring sits on the circle, not on the tile's square box. */
.bdc-tile:focus-visible { outline: none; }
.bdc-tile:focus-visible .bdc-tile__ic { outline: var(--bsy-focus-ring-width) solid var(--bsy-focus-ring-color); outline-offset: var(--bsy-focus-ring-offset); }
@media (min-width: 961px) {
	/* Tiles share the row (at least 88px each); it scrolls when they do not fit. */
	.bdc-tiles { gap: 0; margin-inline: 0; padding-inline: 0; scroll-padding-inline: 0; }
	.bdc-tiles > li { flex: 1 0 auto; display: flex; justify-content: center; }
	.bdc-tile { min-width: 80px; }
	/* Still too wide (e.g. 1101-1360): the row's end fades, so it reads as scrollable (class set by bdc.js). */
	.bdc-tiles.is-overflow { -webkit-mask-image: linear-gradient(to right, transparent 0, black 48px); mask-image: linear-gradient(to right, transparent 0, black 48px); }
	.bdc-tile__ic { width: 64px; height: 64px; }
}

/* ── Rails (home) and the grid (listings) */
.bdc-rail, .bdc-grid { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--bsy-space-3); }
.bdc-rail > li, .bdc-grid > li { display: flex; flex-direction: column; min-width: 0; }
.bdc-rail > li > *, .bdc-grid > li > * { flex: 1 1 auto; }
/* Phones: the first four of a rail as rows; «شوف الكل» opens the rest. */
@media (max-width: 640px) {
	.bdc-rail > li:nth-child(n+5) { display: none; }
}
@media (min-width: 641px) {
	.bdc-rail {
		grid-auto-flow: column; grid-auto-columns: calc((100% - var(--bsy-space-4)) / 2);
		gap: var(--bsy-space-4);
		margin-block: -4px; padding-block: 4px;
		overflow-x: auto; overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory; scrollbar-width: none;
	}
	.bdc-rail::-webkit-scrollbar { display: none; }
	.bdc-rail > li { scroll-snap-align: start; }
	.bdc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bsy-space-4); }
}
@media (min-width: 961px) {
	.bdc-rail { grid-auto-columns: calc((100% - 3 * var(--bsy-space-6)) / 4); gap: var(--bsy-space-6); }
	.bdc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--bsy-space-6); }
}
@media (prefers-reduced-motion: no-preference) {
	.bdc-rail { scroll-behavior: smooth; }
}

/* ── Offer card (Comp-dc-offer-card): a row on phones, a photo card from 641px */
.bdc-card {
	display: flex; flex-direction: column;
	box-sizing: border-box; min-width: 0;
	border: 1px solid var(--bsy-line); border-radius: var(--bsy-radius-lg);
	background: var(--bsy-white); color: var(--bsy-ink);
	text-decoration: none; overflow: hidden;
}
.bdc-card:hover { border-color: var(--bsy-line-strong); }
.bdc-card__media { display: none; }
/* The cover is cropped into its 16:10 box at every width (the feed's covers are 2:1). */
.bdc .bdc-card__cover { object-fit: cover; }
.bdc-card__body { display: flex; flex-direction: column; gap: var(--bsy-space-3); flex: 1 1 auto; padding: var(--bsy-space-4); }
.bdc-card__id { display: flex; align-items: center; gap: var(--bsy-space-3); min-width: 0; }
.bdc .bdc-card__thumb, .bdc-card__mono {
	flex: none; box-sizing: border-box;
	width: 64px; height: 64px; border-radius: var(--bsy-radius-sm);
	border: 1px solid var(--bsy-line); background: var(--bsy-white); object-fit: cover;
}
.bdc-card__thumb { display: block; }
.bdc-card__mono {
	display: flex; align-items: center; justify-content: center;
	background: var(--bsy-grey-100); color: var(--bsy-fg2);
	font-size: var(--bsy-text-lg); font-weight: var(--bsy-fw-bold);
}
.bdc-card__tx { display: flex; flex-direction: column; gap: var(--bsy-space-1); min-width: 0; }
.bdc-card__name {
	margin: 0;
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
	font-size: var(--bsy-text-md); font-weight: var(--bsy-fw-bold); line-height: 1.35;
	color: var(--bsy-ink);
}
.bdc-card__meta {
	display: flex; flex-wrap: wrap; align-items: center; gap: var(--bsy-space-1) var(--bsy-space-2);
	margin: 0;
	font-size: var(--bsy-text-sm); line-height: 1.5; color: var(--bsy-muted);
	font-variant-numeric: tabular-nums;
}
.bdc-card .bdc-stub { margin-block-start: auto; }
.bdc-card__meta [data-f="h"] { white-space: nowrap; }
@media (min-width: 641px) {
	.bdc-card__media {
		display: block; position: relative;
		aspect-ratio: 16 / 10; background: var(--bsy-grey-100);
	}
	/* The first card's cover sits in a <picture> (no phone download); the box stays the img's. */
	.bdc-card__media > picture { display: contents; }
	.bdc-card__media > .bdc-card__cover,
	.bdc-card__media > picture > .bdc-card__cover { display: block; width: 100%; height: 100%; }
	.bdc .bdc-card__logo {
		position: absolute; inset-block-end: -22px; inset-inline-start: var(--bsy-space-4);
		box-sizing: border-box; width: 48px; height: 48px;
		border: 2px solid var(--bsy-white); border-radius: var(--bsy-radius-sm);
		background: var(--bsy-white); object-fit: cover;
	}
	.bdc-card:not(.bdc-card--flat) .bdc-card__body { padding-block-start: 30px; }
	/* Every card has the media box here, so the name never needs the thumb. */
	.bdc-card :is(.bdc-card__thumb, .bdc-card__mono) { display: none; }
	/* No cover: the logo, 72px, centred in the neutral box. */
	.bdc .bdc-card--flat .bdc-card__logo {
		inset: 0; margin: auto;
		width: 72px; height: 72px;
		border: 1px solid var(--bsy-line); border-radius: var(--bsy-radius-lg);
	}
	/* A wordmark/logo cover is shown whole, never cropped («Tire Mal»). */
	.bdc .bdc-card__media--art > .bdc-card__cover,
	.bdc .bdc-card__media--art > picture > .bdc-card__cover { object-fit: contain; }
	/* The coupon in a 4-up grid: a fixed height, the text at most two lines. */
	.bdc-card .bdc-stub { min-height: 64px; }
	.bdc-card .bdc-stub__fig { padding-inline: var(--bsy-space-3); font-size: var(--bsy-text-md); }
	.bdc-card .bdc-stub__t {
		display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
		align-self: center; padding-block: 0;
		font-size: var(--bsy-text-sm); font-weight: var(--bsy-fw-semibold);
	}
}

/* ── Banner slider (Comp-dc-banner-slider): full 2:1 artwork, swipe on phones */
.bdc-slider { display: flex; flex-direction: column; gap: var(--bsy-space-4); min-width: 0; }
.bdc-slider__track {
	display: grid; grid-auto-flow: column; grid-auto-columns: calc(100% - var(--bsy-space-6));
	gap: var(--bsy-space-3);
	margin: 0; padding: 0; list-style: none;
	overflow-x: auto; overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory; scrollbar-width: none;
}
.bdc-slider__track::-webkit-scrollbar { display: none; }
.bdc-slide { scroll-snap-align: start; min-width: 0; }
.bdc-slide:only-child { grid-column: 1 / -1; }
.bdc-slider__track:has(> .bdc-slide:only-child) { grid-auto-columns: 100%; }
.bdc-slide__a { display: block; border-radius: var(--bsy-radius-lg); }
.bdc-slide img {
	display: block; width: 100%; height: auto; aspect-ratio: 2 / 1;
	border-radius: var(--bsy-radius-lg); background: var(--bsy-grey-100); object-fit: cover;
}
.bdc-slider__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--bsy-space-3); }
.bdc-slider__dots { display: flex; align-items: center; gap: 6px; }
.bdc-slider__dots i { display: block; width: 8px; height: 8px; border-radius: var(--bsy-radius-pill); background: var(--bsy-line-strong); }
.bdc-slider__dots i.is-on { width: 24px; background: var(--bsy-ink); }
.bdc-slider__arrows { display: none; gap: var(--bsy-space-2); }
@media (min-width: 641px) {
	.bdc-slider__track { grid-auto-columns: 100%; gap: var(--bsy-space-6); }
	.bdc-slider__arrows { display: inline-flex; }
}
@media (prefers-reduced-motion: no-preference) {
	.bdc-slider__track { scroll-behavior: smooth; }
}

/* ── Listing head, filters, controls */
.bdc-lhead { display: flex; flex-direction: column; gap: var(--bsy-space-4); }
.bdc-filters { margin-block-start: var(--bsy-space-4); }
@media (min-width: 961px) {
	.bdc-lhead { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: var(--bsy-space-8); }
	.bdc-lhead .bdc-bar { flex: 0 0 560px; }
	.bdc-filters { margin-block-start: var(--bsy-space-10); }
}
.bdc-controls {
	display: flex; flex-wrap: wrap; align-items: center; gap: var(--bsy-space-2);
	margin-block-start: var(--bsy-space-5);
}
.bdc-ctrl {
	position: relative;
	display: inline-flex; align-items: center; gap: var(--bsy-space-2);
	box-sizing: border-box; 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-ctrl:hover { background: var(--bsy-grey-50); }
.bdc-ctrl__k { display: none; }
.bdc-ctrl--sort select {
	margin: 0; padding: 0; padding-inline-end: var(--bsy-space-5);
	border: 0; background: transparent; color: inherit;
	font: inherit; cursor: pointer; appearance: none;
}
.bdc-ctrl--sort select:focus-visible { outline: none; }
.bdc-ctrl--sort:focus-within { outline: var(--bsy-focus-ring-width) solid var(--bsy-focus-ring-color); outline-offset: var(--bsy-focus-ring-offset); }
.bdc-ctrl__chev { position: absolute; inset-inline-end: var(--bsy-space-4); pointer-events: none; color: var(--bsy-fg2); }
.bdc-switch {
	position: relative; flex: none;
	width: 36px; height: 20px; border-radius: var(--bsy-radius-pill);
	background: var(--bsy-white); box-shadow: inset 0 0 0 2px var(--bsy-field-line);
}
.bdc-switch::after {
	content: ""; position: absolute; inset-block-start: 4px; inset-inline-start: 4px;
	width: 12px; height: 12px; border-radius: var(--bsy-radius-pill);
	background: var(--bsy-muted);
}
.bdc-ctrl[aria-checked="true"] .bdc-switch { background: var(--bsy-ok); box-shadow: none; }
.bdc-ctrl[aria-checked="true"] .bdc-switch::after { inset-block-start: 2px; inset-inline-start: auto; inset-inline-end: 2px; width: 16px; height: 16px; background: var(--bsy-white); }
.bdc-reset { margin-inline-start: var(--bsy-space-2); }
.bdc-note { margin: var(--bsy-space-3) 0 0; font-size: var(--bsy-text-sm); line-height: var(--bsy-leading-small); color: var(--bsy-fg2); }
.bdc-results { margin-block-start: var(--bsy-space-6); }
.bdc-pager { margin-block-start: var(--bsy-space-8); }
@media (min-width: 641px) {
	.bdc-ctrl { height: var(--bsy-size-btn-sm); }
	.bdc-ctrl__k { display: inline; }
}
@media (min-width: 961px) {
	.bdc-controls { justify-content: flex-end; margin-block-start: var(--bsy-space-8); padding-block-end: var(--bsy-space-6); border-block-end: 1px solid var(--bsy-line); }
	.bdc-results { margin-block-start: var(--bsy-space-8); }
	.bdc-pager { margin-block-start: var(--bsy-space-10); }
}
