/**
 * BASE — Reset, RTL/LTR, utilities, a11y
 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

html[dir="rtl"] body { font-family: var(--font-fa); }
html[dir="ltr"] body { font-family: var(--font-en); }

body {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--neutral-900);
  background: var(--neutral-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* Part numbers — always LTR regardless of page direction */
.part-number,
.c-part-number,
.sku {
  font-family: var(--font-en);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  letter-spacing: 0.02em;
}

/* Technical EN labels — LTR only when page is English */
html[dir="ltr"] .c-en-label {
  font-family: var(--font-en);
  direction: ltr;
  unicode-bidi: isolate;
}
/* In FA/RTL, labels follow page direction and Vazir */
html[dir="rtl"] .c-en-label {
  font-family: inherit;
  direction: inherit;
  unicode-bidi: normal;
}

:focus-visible {
  outline: 3px solid var(--secondary-600);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

.c-skip-link {
  position: absolute;
  top: -100%;
  inset-inline-start: var(--space-4);
  z-index: 9999;
  background: var(--secondary-600);
  color: var(--neutral-0);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.875rem;
}
.c-skip-link:focus { top: var(--space-4); }

.c-container {
  width: min(100% - 40px, var(--container-max));
  margin-inline: auto;
  padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
}
@media (max-width: 1024px) {
  .c-container { width: min(100% - 72px, var(--container-max)); }
}
@media (max-width: 639px) {
  .c-container { width: min(100% - 40px, var(--container-max)); }
}

.c-grid { display: grid; gap: var(--space-6); }
.c-grid--2 { grid-template-columns: repeat(2, 1fr); }
.c-grid--3 { grid-template-columns: repeat(3, 1fr); }
.c-grid--4 { grid-template-columns: repeat(4, 1fr); }
.c-grid--5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1023px) {
  .c-grid--3, .c-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .c-grid--2 { grid-template-columns: 1fr; }
  .c-grid--3, .c-grid--4, .c-grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-grid { gap: var(--space-4); }
}
@media (max-width: 479px) {
  .c-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.u-muted { color: var(--neutral-500); }
.u-text-center { text-align: center; }
.u-mt-4 { margin-top: var(--space-4); }
.u-mb-4 { margin-bottom: var(--space-4); }
.u-flex { display: flex; }
.u-flex-wrap { flex-wrap: wrap; }
.u-items-center { align-items: center; }
.u-justify-between { justify-content: space-between; }
.u-gap-2 { gap: var(--space-2); }
.u-gap-3 { gap: var(--space-3); }
.u-gap-4 { gap: var(--space-4); }
.u-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Mega menu is direction-agnostic via inset-inline-* in main.css */

/* Language switcher */
.c-lang-switch {
  display: inline-flex;
  gap: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.c-lang-switch button {
  padding: 2px 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 4px;
  color: var(--neutral-300);
  transition: background var(--transition), color var(--transition);
}
.c-lang-switch button.is-active {
  background: var(--secondary-600);
  color: var(--neutral-0);
}

/* Brand-agnostic SVG placeholder */
.c-ph {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--primary-100), var(--neutral-100));
  border: 1px solid var(--neutral-200);
  overflow: hidden;
  position: relative;
}
.c-ph::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--neutral-200) 1px, transparent 1px),
    linear-gradient(90deg, var(--neutral-200) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.5;
}
.c-ph__label {
  position: relative;
  z-index: 1;
  font-family: var(--font-en);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--primary-700);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--space-2) var(--space-3);
  background: rgba(255,255,255,0.85);
  border-radius: var(--radius-sm);
  border: 1px solid var(--neutral-200);
}

/* Icon system — geometric, no emoji */
.c-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--secondary-50);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.c-icon svg { width: 22px; height: 22px; stroke: var(--secondary-600); fill: none; stroke-width: 1.75; }

/* Source · Solve · Deliver pillars */
.c-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
@media (max-width: 767px) { .c-pillars { grid-template-columns: 1fr; } }
.c-pillar {
  padding: var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-200);
  background: var(--neutral-0);
}
.c-pillar__label {
  font-family: var(--font-en);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-600);
  margin-bottom: var(--space-2);
}
.c-pillar h3 { font-size: 1.0625rem; margin-bottom: var(--space-2); }
.c-pillar p { font-size: 0.875rem; color: var(--neutral-500); }

/* WooCommerce-ready product wrapper hooks */
.woocommerce .product .summary { /* reserved for WP */ }
.product.type-product { /* static prototype hook */ }

/* WP: Arabic + heading inheritance */
html[lang^="ar"] body { font-family: var(--font-ar, var(--font-fa)); }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6 {
  font-family: var(--font-fa);
}


/* -------------------------------------------------------------------------- */
/* Directional arrows — follow document direction (RTL/LTR)                   */
/* -------------------------------------------------------------------------- */
.c-arrow {
	display: inline-block;
	line-height: 1;
	font-weight: 600;
}
/* Forward CTA arrow: points toward reading start (RTL ← / LTR →) */
.c-arrow::before {
	content: "→";
}
html[dir="rtl"] .c-arrow::before,
body.rtl .c-arrow::before,
.rtl .c-arrow::before {
	content: "←";
}
/* Back / previous arrow: opposite of forward */
.c-arrow--back::before,
.c-arrow--prev::before {
	content: "←";
}
html[dir="rtl"] .c-arrow--back::before,
html[dir="rtl"] .c-arrow--prev::before,
body.rtl .c-arrow--back::before,
body.rtl .c-arrow--prev::before,
.rtl .c-arrow--back::before,
.rtl .c-arrow--prev::before {
	content: "→";
}

/* -------------------------------------------------------------------------- */
/* WordPress core classes (Theme Check recommended)                           */
/* -------------------------------------------------------------------------- */
.alignleft {
	float: left;
	margin-right: 1.5em;
	margin-bottom: 1em;
}
.alignright {
	float: right;
	margin-left: 1.5em;
	margin-bottom: 1em;
}
.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 1em;
}
.wp-caption {
	max-width: 100%;
	margin-bottom: 1.5em;
}
.wp-caption img {
	display: block;
	margin: 0 auto;
}
.wp-caption-text,
.gallery-caption {
	font-size: 0.875em;
	line-height: 1.5;
	color: var(--neutral-600, #666);
	margin-top: 0.5em;
	text-align: center;
}
.sticky {
	/* Sticky posts — visual marker left to theme cards if needed */
}
.bypostauthor {
	/* Comment by post author — can be styled in comments template */
}
