/*
 * Beseha Brand Page 2.0
 *
 * One stylesheet for both directions. Every horizontal value is written as a
 * logical property (inline-start / inline-end), so the Arabic and English
 * pages are the same CSS mirrored by the browser rather than two files that
 * drift apart.
 *
 * Scoped to .bsb-* class names only. Nothing here selects a theme class, so
 * a GreenMart update cannot break it and it cannot break GreenMart.
 */

:root {
	--bsb-brand: #4f8a63;
	--bsb-brand-800: #35624a;
	--bsb-brand-050: #eef6f1;
	--bsb-gold: #b8893b;
	--bsb-ink: #1d2721;
	--bsb-ink-60: #5b6660;
	--bsb-line: #e3e8e5;
	--bsb-bg: #fff;
	--bsb-soft: #f7faf8;
	--bsb-r: 14px;
	--bsb-r-sm: 9px;
	--bsb-shadow: 0 1px 2px rgba(29, 39, 33, .06), 0 8px 24px rgba(29, 39, 33, .06);
}

/* ===========================================================================
 * 1 — The ad strip
 *
 * An image and a link. The only complexity here is reserving the right box
 * before the image arrives: --bsb-ad-ar and --bsb-ad-ar-m are written into
 * the page from the two sizes on the settings screen, so the grid below
 * never moves when the creative loads.
 * ======================================================================== */

.bsb-ads {
	--bsb-ad-ar: 1600 / 400;
	--bsb-ad-ar-m: 800 / 800;
	margin: 0 0 clamp(18px, 3vw, 30px);
	position: relative;
}

.bsb-ads-view {
	position: relative;
	border-radius: var(--bsb-r);
	overflow: hidden;
}

.bsb-ads-track {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-inline: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.bsb-ads-track::-webkit-scrollbar {
	display: none;
}

.bsb-ads-track:focus-visible {
	outline: 2px solid var(--bsb-brand);
	outline-offset: 2px;
}

.bsb-ad {
	flex: 0 0 100%;
	min-width: 0;
	scroll-snap-align: center;
	scroll-snap-stop: always;
}

.bsb-ad-link {
	display: block;
	text-decoration: none;
	border: 0;
}

.bsb-ad-pic {
	display: block;
}

/* Mobile first: the phone crop is the one most visitors see. */
.bsb-ad img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--bsb-ad-ar-m);
	object-fit: cover;
	background: var(--bsb-soft);
}

@media (min-width: 768px) {
	.bsb-ad img {
		aspect-ratio: var(--bsb-ad-ar);
	}
}

/* --- controls ------------------------------------------------------- */

.bsb-ads-arrow {
	position: absolute;
	inset-block-start: 50%;
	transform: translateY(-50%);
	z-index: 2;
	display: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: var(--bsb-ink);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(29, 39, 33, .18);
}

.bsb-ads-arrow:hover {
	background: #fff;
}

.bsb-ads-arrow.is-prev {
	inset-inline-start: 12px;
}

.bsb-ads-arrow.is-next {
	inset-inline-end: 12px;
}

/* The arrows point along the reading direction, so they flip with it. */
[dir="rtl"] .bsb-ads-arrow.is-prev,
[dir="rtl"] .bsb-ads-arrow.is-next {
	transform: translateY(-50%) scaleX(-1);
}

@media (min-width: 768px) {
	.bsb-ads.is-multi .bsb-ads-arrow {
		display: block;
	}
}

.bsb-ads-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-block-start: 10px;
}

.bsb-ads-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--bsb-line);
	cursor: pointer;
	transition: width .18s ease, background .18s ease;
}

.bsb-ads-dot[aria-current="true"] {
	width: 22px;
	border-radius: 5px;
	background: var(--bsb-brand);
}

@media (prefers-reduced-motion: no-preference) {
	.bsb-ads-track {
		scroll-behavior: smooth;
	}
}

/* ===========================================================================
 * 2 — Brand header
 * ======================================================================== */

.bsb-head {
	display: flex;
	align-items: center;
	gap: clamp(12px, 2.5vw, 22px);
	flex-wrap: wrap;
	margin: 0 0 14px;
}

.bsb-head-logo {
	flex: 0 0 auto;
	width: clamp(56px, 12vw, 84px);
	aspect-ratio: 1;
	display: grid;
	place-items: center;
	padding: 8px;
	border: 1px solid var(--bsb-line);
	border-radius: var(--bsb-r-sm);
	background: #fff;
}

.bsb-head-logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.bsb-head-main {
	flex: 1 1 260px;
	min-width: 0;
}

.bsb-head-tag {
	margin: 0 0 8px;
	font-size: clamp(15px, 2.1vw, 18px);
	line-height: 1.5;
	color: var(--bsb-ink-60);
}

.bsb-head-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 8px;
	padding: 0;
	list-style: none;
}

.bsb-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--bsb-soft);
	border: 1px solid var(--bsb-line);
	font-size: 13px;
	line-height: 1.4;
	color: var(--bsb-ink);
}

.bsb-badge.is-ok {
	background: var(--bsb-brand-050);
	border-color: color-mix(in srgb, var(--bsb-brand) 30%, transparent);
	color: var(--bsb-brand-800);
	font-weight: 600;
}

.bsb-badge.is-gold {
	background: color-mix(in srgb, var(--bsb-gold) 12%, #fff);
	border-color: color-mix(in srgb, var(--bsb-gold) 35%, transparent);
	color: var(--bsb-gold);
	font-weight: 600;
}

.bsb-head-stat {
	margin: 0;
	font-size: 14px;
	color: var(--bsb-ink-60);
}

.bsb-head-stat b {
	color: var(--bsb-ink);
}

/* ===========================================================================
 * 3 — Direct answer
 *
 * Deliberately plain: a bordered callout reads as an ad and gets skipped.
 * This paragraph is what an assistant lifts, so it should look like the
 * first sentence of the page, because that is what it is.
 * ======================================================================== */

.bsb-answer {
	margin: 0 0 clamp(14px, 2.5vw, 22px);
	padding-inline-start: 14px;
	border-inline-start: 3px solid var(--bsb-brand);
	max-width: 68ch;
}

.bsb-answer p {
	margin: 0 0 .5em;
	font-size: clamp(15px, 2.1vw, 17px);
	line-height: 1.75;
	color: var(--bsb-ink);
}

.bsb-answer p:last-child {
	margin-bottom: 0;
}

/* ===========================================================================
 * 4 — Everything below the grid
 * ======================================================================== */

.bsb-after {
	margin-block-start: clamp(28px, 5vw, 52px);
	display: grid;
	gap: clamp(26px, 4.5vw, 44px);
}

.bsb-after > section > h2 {
	margin: 0 0 14px;
	font-size: clamp(19px, 2.8vw, 25px);
	line-height: 1.35;
	color: var(--bsb-ink);
}

/* --- the brand description (rich HTML) ------------------------------ */

.bsb-desc {
	max-width: 74ch;
	font-size: clamp(15px, 2.1vw, 17px);
	line-height: 1.8;
	color: var(--bsb-ink);
}

.bsb-desc h2 {
	margin: 1.6em 0 .5em;
	font-size: clamp(19px, 2.8vw, 25px);
	line-height: 1.35;
}

.bsb-desc h2:first-child {
	margin-block-start: 0;
}

.bsb-desc h3 {
	margin: 1.4em 0 .4em;
	font-size: clamp(16px, 2.3vw, 19px);
	line-height: 1.4;
}

.bsb-desc h4 {
	margin: 1.2em 0 .35em;
	font-size: clamp(15px, 2.1vw, 17px);
}

.bsb-desc p {
	margin: 0 0 1em;
}

.bsb-desc ul,
.bsb-desc ol {
	margin: 0 0 1em;
	padding-inline-start: 1.4em;
}

.bsb-desc li {
	margin-block-end: .4em;
}

.bsb-desc a {
	color: var(--bsb-brand-800);
	text-underline-offset: 2px;
}

.bsb-desc img {
	max-width: 100%;
	height: auto;
	border-radius: var(--bsb-r-sm);
}

.bsb-desc blockquote {
	margin: 1.2em 0;
	padding-inline-start: 16px;
	border-inline-start: 3px solid var(--bsb-line);
	color: var(--bsb-ink-60);
}

.bsb-desc table {
	width: 100%;
	margin: 0 0 1.2em;
	border-collapse: collapse;
	font-size: .95em;
}

.bsb-desc th,
.bsb-desc td {
	padding: 9px 12px;
	border: 1px solid var(--bsb-line);
	text-align: start;
	vertical-align: top;
}

.bsb-desc thead th {
	background: var(--bsb-soft);
	font-weight: 600;
}

/* --- facts table ----------------------------------------------------- */

.bsb-facts-table {
	width: 100%;
	max-width: 720px;
	border-collapse: collapse;
	font-size: 15px;
	background: #fff;
	border: 1px solid var(--bsb-line);
	border-radius: var(--bsb-r-sm);
	overflow: hidden;
}

.bsb-facts-table th,
.bsb-facts-table td {
	padding: 11px 14px;
	text-align: start;
	vertical-align: top;
	border-block-end: 1px solid var(--bsb-line);
	line-height: 1.6;
}

.bsb-facts-table tr:last-child th,
.bsb-facts-table tr:last-child td {
	border-block-end: 0;
}

.bsb-facts-table th {
	width: 38%;
	font-weight: 600;
	color: var(--bsb-ink-60);
	background: var(--bsb-soft);
}

@media (max-width: 480px) {
	.bsb-facts-table th {
		width: 45%;
	}
}

/* --- FAQ -------------------------------------------------------------- */

.bsb-faq-item {
	border: 1px solid var(--bsb-line);
	border-radius: var(--bsb-r-sm);
	background: #fff;
	margin-block-end: 8px;
}

.bsb-faq-item > summary {
	cursor: pointer;
	list-style: none;
	padding: 13px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.bsb-faq-item > summary::-webkit-details-marker {
	display: none;
}

.bsb-faq-item > summary::after {
	content: "+";
	margin-inline-start: auto;
	font-size: 20px;
	line-height: 1;
	color: var(--bsb-ink-60);
	flex: 0 0 auto;
}

.bsb-faq-item[open] > summary::after {
	content: "−";
}

.bsb-faq-item > summary h3 {
	margin: 0;
	font-size: clamp(15px, 2.1vw, 17px);
	line-height: 1.5;
	font-weight: 600;
	display: inline;
}

.bsb-faq-a {
	padding: 0 16px 14px;
	font-size: 15px;
	line-height: 1.75;
	color: var(--bsb-ink);
	max-width: 70ch;
}

.bsb-faq-a p {
	margin: 0 0 .7em;
}

.bsb-faq-a p:last-child {
	margin-bottom: 0;
}

/* --- related brands --------------------------------------------------- */

.bsb-related-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bsb-related-item a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 14px 10px;
	border: 1px solid var(--bsb-line);
	border-radius: var(--bsb-r-sm);
	background: #fff;
	text-align: center;
	text-decoration: none;
	color: var(--bsb-ink);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.bsb-related-item a:hover {
	border-color: var(--bsb-brand);
	box-shadow: var(--bsb-shadow);
}

.bsb-related-item img {
	width: 46px;
	height: 46px;
	object-fit: contain;
}

.bsb-related-item b {
	font-size: 14px;
	line-height: 1.4;
}

.bsb-related-item em {
	font-style: normal;
	font-size: 12px;
	color: var(--bsb-ink-60);
}

/* ===========================================================================
 * Print — the ad is not part of the document
 * ======================================================================== */

@media print {
	.bsb-ads,
	.bsb-related {
		display: none;
	}

	.bsb-faq-item {
		break-inside: avoid;
	}

	.bsb-faq-a {
		display: block !important;
	}
}
