/**
 * ANZO Store — Reset, typography, native form elements, utilities.
 *
 * Everything here uses CSS logical properties (inline/block) so the Arabic RTL
 * layout is correct by construction rather than by mirroring rules later.
 */

/* ---------------------------------------------------------------
 * Reset
 * --------------------------------------------------------------- */

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

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-block-start: calc(var(--header-offset) + var(--space-4));
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	background-color: var(--surface);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: var(--text-base);
	line-height: var(--leading-normal);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	min-block-size: 100vh;
	overflow-x: hidden;
	text-rendering: optimizeSpeed;
}

body.is-locked {
	overflow: hidden;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-inline-size: 100%;
	block-size: auto;
}

svg {
	fill: currentColor;
}

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

button {
	background: none;
	border: 0;
	cursor: pointer;
	padding: 0;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
}

ul[class],
ol[class] {
	list-style: none;
	padding: 0;
}

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

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

/* ---------------------------------------------------------------
 * Typography
 * --------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-display);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--tracking-tight);
	line-height: var(--leading-tight);
	color: var(--color-ink-900);
	text-wrap: balance;
}

h1 {
	font-size: var(--text-3xl);
}

h2 {
	font-size: var(--text-2xl);
}

h3 {
	font-size: var(--text-xl);
}

h4 {
	font-size: var(--text-lg);
	line-height: var(--leading-snug);
}

h5,
h6 {
	font-size: var(--text-md);
	line-height: var(--leading-snug);
}

p {
	text-wrap: pretty;
}

a {
	color: inherit;
	text-decoration-color: var(--border-strong);
	text-underline-offset: 0.2em;
	transition: color var(--duration-fast) var(--ease);
}

a:hover {
	color: var(--color-accent);
}

strong,
b {
	font-weight: var(--weight-semibold);
}

small {
	font-size: var(--text-sm);
}

code,
kbd,
pre {
	font-family: var(--font-mono);
	font-size: 0.9em;
}

code {
	background: var(--surface-sunken);
	border-radius: var(--radius-xs);
	padding: 0.15em 0.4em;
}

pre {
	background: var(--surface-sunken);
	border-radius: var(--radius-md);
	overflow-x: auto;
	padding: var(--space-4);
}

blockquote {
	border-inline-start: 3px solid var(--color-accent);
	color: var(--text-muted);
	font-size: var(--text-lg);
	padding-inline-start: var(--space-5);
}

/* ---------------------------------------------------------------
 * Focus — always visible, never removed.
 * --------------------------------------------------------------- */

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

:focus:not(:focus-visible) {
	outline: none;
}

/* ---------------------------------------------------------------
 * Native form controls
 * --------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select,
.input {
	background-color: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-md);
	color: var(--text);
	inline-size: 100%;
	line-height: 1.4;
	padding-block: 0.7rem;
	padding-inline: var(--space-4);
	transition: border-color var(--duration-fast) var(--ease),
		box-shadow var(--duration-fast) var(--ease);
}

input::placeholder,
textarea::placeholder {
	color: var(--text-subtle);
}

input:focus,
textarea:focus,
select:focus,
.input:focus {
	border-color: var(--color-accent);
	box-shadow: var(--ring);
	outline: none;
}

input[aria-invalid="true"],
.woocommerce-invalid input {
	border-color: var(--color-danger);
}

textarea {
	min-block-size: 8rem;
	resize: vertical;
}

select {
	appearance: none;
	/* Chevron drawn with a gradient-free inline SVG; flipped via logical position. */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right var(--space-4) center;
	padding-inline-end: var(--space-10);
}

[dir="rtl"] select {
	background-position: left var(--space-4) center;
}

label {
	display: inline-block;
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	margin-block-end: var(--space-2);
}

fieldset {
	border: 0;
	padding: 0;
}

/* ---------------------------------------------------------------
 * Utilities
 * --------------------------------------------------------------- */

.u-visually-hidden {
	border: 0;
	clip-path: inset(50%);
	block-size: 1px;
	inline-size: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
}

.u-muted {
	color: var(--text-muted);
}

.u-center {
	text-align: center;
}

.u-eyebrow {
	color: var(--color-accent);
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--tracking-wider);
	text-transform: uppercase;
}

.u-truncate-2 {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.u-stack > * + * {
	margin-block-start: var(--space-4);
}

.anzo-sprite {
	display: none;
}

/* Skip link (markup class comes from style.css). */
.skip-link:focus {
	z-index: var(--z-modal);
}

/* Prose: long-form editorial content from the editor. */
.prose {
	line-height: var(--leading-relaxed);
	max-inline-size: 72ch;
}

.prose > * + * {
	margin-block-start: var(--space-5);
}

.prose h2,
.prose h3 {
	margin-block-start: var(--space-10);
}

.prose ul,
.prose ol {
	padding-inline-start: var(--space-6);
}

.prose li + li {
	margin-block-start: var(--space-2);
}

.prose img {
	border-radius: var(--radius-md);
}

.prose a {
	color: var(--color-accent);
	text-decoration: underline;
}
