/**
 * NedaBal Fun — base layer.
 *
 * Reset, RTL-first typography, layout primitives, focus management and
 * reduced-motion behavior. Everything is authored with CSS logical
 * properties — no rtl.css flip is used or needed.
 */

/* ------------------------------------------------------------------
 * Reset
 * ---------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--nbf-font-sans);
	font-size: var(--nbf-fs-md);
	font-weight: var(--nbf-fw-regular);
	line-height: var(--nbf-lh-body);
	color: var(--nbf-color-text);
	background-color: var(--nbf-color-surface-alt);
	overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-block: 0 var(--nbf-space-4);
	font-weight: var(--nbf-fw-black);
	line-height: var(--nbf-lh-heading);
	color: var(--nbf-color-text);
}

h1 { font-size: var(--nbf-fs-3xl); }
h2 { font-size: var(--nbf-fs-2xl); }
h3 { font-size: var(--nbf-fs-xl); }
h4 { font-size: var(--nbf-fs-lg); }
h5 { font-size: var(--nbf-fs-md); }
h6 { font-size: var(--nbf-fs-sm); }

p {
	margin-block: 0 var(--nbf-space-4);
}

a {
	color: var(--nbf-color-link);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

ul,
ol {
	margin-block: 0 var(--nbf-space-4);
	padding-inline-start: var(--nbf-space-6);
}

img,
svg,
video {
	max-inline-size: 100%;
	block-size: auto;
	vertical-align: middle;
}

figure {
	margin: 0;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-inline-size: 0;
}

legend {
	padding: 0;
}

table {
	border-collapse: collapse;
	inline-size: 100%;
}

hr {
	border: 0;
	border-block-start: 1px solid var(--nbf-color-border);
	margin-block: var(--nbf-space-6);
}

[hidden] {
	display: none !important;
}

/* Number glyphs: keep Persian-shaped digits where the content is Persian.
 * Latin contexts (codes, phone numbers) opt out with .nbf-latin. */
.nbf-latin {
	direction: ltr;
	unicode-bidi: isolate;
	font-feature-settings: normal;
}

/* ------------------------------------------------------------------
 * Focus management
 * ---------------------------------------------------------------- */
:focus {
	outline: none;
}

:focus-visible {
	outline: 2px solid var(--nbf-color-focus-ring);
	outline-offset: 2px;
	border-radius: var(--nbf-radius-xs);
}

/* ------------------------------------------------------------------
 * Layout primitives
 * ---------------------------------------------------------------- */
.nbf-container {
	inline-size: 100%;
	max-inline-size: var(--nbf-container-max);
	margin-inline: auto;
	padding-inline: var(--nbf-container-pad);
}

.nbf-section {
	margin-block-end: var(--nbf-section-gap);
}

/* Horizontal scroller that shows a partial next card (mobile carousels).
 * min/max inline-size keep it shrinkable inside grid/flex parents so its
 * intrinsic content width never widens the page.
 *
 * The native scrollbar is hidden: the carousel arrows are the visible
 * affordance at every breakpoint. Scrolling itself is untouched, so touch
 * swipe and keyboard scrolling still work. This clips inside the scroll
 * viewport only — never a page-level overflow-x: hidden. */
.nbf-scroller {
	display: grid;
	grid-auto-flow: column;
	gap: var(--nbf-space-3);
	min-inline-size: 0;
	max-inline-size: 100%;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	justify-content: start;
}

.nbf-scroller::-webkit-scrollbar {
	display: none;
}

.nbf-scroller > * {
	scroll-snap-align: start;
}

/* ------------------------------------------------------------------
 * Accessibility utilities
 * ---------------------------------------------------------------- */
.screen-reader-text,
.nbf-visually-hidden {
	position: absolute !important;
	/* Pin to the containing block: an unset static position inside a
	 * scrolled container would otherwise extend the page scroll area. */
	inset-block-start: 0;
	inset-inline-start: 0;
	inline-size: 1px;
	block-size: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.nbf-skip-link {
	position: absolute;
	inset-block-start: -100%;
	inset-inline-start: var(--nbf-space-4);
	z-index: var(--nbf-z-toast);
	padding: var(--nbf-space-2) var(--nbf-space-4);
	background: var(--nbf-color-primary-600);
	color: var(--nbf-color-text-inverse);
	border-radius: var(--nbf-radius-sm);
}

.nbf-skip-link:focus-visible {
	inset-block-start: var(--nbf-space-2);
}

/* ------------------------------------------------------------------
 * Text utilities
 * ---------------------------------------------------------------- */
.nbf-text-2 { color: var(--nbf-color-text-2); }
.nbf-text-3 { color: var(--nbf-color-text-3); }
.nbf-text-sm { font-size: var(--nbf-fs-sm); }
.nbf-text-xs { font-size: var(--nbf-fs-xs); }
.nbf-text-center { text-align: center; }

.nbf-clamp-1,
.nbf-clamp-2 {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.nbf-clamp-1 { -webkit-line-clamp: 1; }
.nbf-clamp-2 { -webkit-line-clamp: 2; }

/* ------------------------------------------------------------------
 * Reduced motion
 * ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ------------------------------------------------------------------
 * Page band — the single title area shared by cart, checkout and
 * account. WooCommerce pages render no other heading (see page.php), so
 * this is the one place a page names itself.
 * ---------------------------------------------------------------- */
.nbf-page-band {
	background:
		radial-gradient(120% 140% at 85% 0%, rgb(255 255 255 / 0.65) 0%, transparent 55%),
		linear-gradient(200deg, #e3f1fd 0%, #cbe4f8 100%);
	padding-block: var(--nbf-space-6) var(--nbf-space-8);
	margin-block-end: var(--nbf-space-6);
}

.nbf-page-band__title {
	margin-block: var(--nbf-space-2) var(--nbf-space-1);
	font-size: var(--nbf-fs-3xl);
}

.nbf-page-band__lead {
	margin: 0;
	color: var(--nbf-color-text-2);
}

@media (max-width: 767px) {
	.nbf-page-band {
		padding-block: var(--nbf-space-4) var(--nbf-space-5);
	}

	.nbf-page-band__title {
		font-size: var(--nbf-fs-2xl);
	}
}
