/* ============================================
   PureLink Chemicals - Modern Corporate Site
   Design: Agritrade-inspired, B2B Chemical
   Fonts: Playfair Display + Inter
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #333;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: color 0.3s ease; }
ul, ol { list-style: none; }

/* --- CSS Variables --- */
:root {
  --primary: #0D6B5E;
  --primary-dark: #095349;
  --primary-light: #16A085;
  --secondary: #1A1A2E;
  --accent: #5EEAD4;
  --light-bg: #F0FAF8;
  --white: #FFFFFF;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #E5E7EB;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-primary: 0 6px 20px rgba(13,107,94,0.25);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --container: 1200px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--secondary);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.6rem); }
h4 { font-size: 1.2rem; }

p { margin-bottom: 1rem; color: var(--text-light); }

.section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: block;
}

.section-title { margin-bottom: 1rem; }

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  line-height: 1.8;
}

.section-subtitle.centered { margin-left: auto; margin-right: auto; text-align: center; }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
}

.section--light { background: var(--light-bg); }
.section--dark {
  background: var(--secondary);
  color: var(--white);
}
.section--dark h2, .section--dark h3, .section--dark h4 { color: var(--white); }
.section--dark p { color: rgba(255,255,255,0.7); }
.section--dark .section-label { color: var(--accent); }

.section--gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--white);
}
.section--gradient h2, .section--gradient h3 { color: var(--white); }
.section--gradient p { color: rgba(255,255,255,0.85); }

.text-center { text-align: center; }
.text-white { color: var(--white) !important; }

.grid {
  display: grid;
  gap: 30px;
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex--center { align-items: center; justify-content: center; }
.flex--between { align-items: center; justify-content: space-between; }
.flex--gap { gap: 30px; }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 14px 36px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.btn--primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn--primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.btn--secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn--secondary:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.btn--white {
  background: var(--white);
  color: var(--primary);
  border-color: var(--white);
}
.btn--white:hover {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
  transform: translateY(-2px);
}

.btn--outline-white {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}
.btn--outline-white:hover {
  background: var(--white);
  color: var(--primary);
  transform: translateY(-2px);
}

/* --- Top Bar --- */
.topbar {
  background: var(--secondary);
  padding: 8px 0;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.topbar a {
  color: rgba(255,255,255,0.7);
  transition: color 0.3s ease;
}
.topbar a:hover { color: var(--accent); }

.topbar__left { display: flex; gap: 24px; align-items: center; }
.topbar__right { display: flex; gap: 16px; align-items: center; }

.topbar__item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar__item svg {
  width: 14px;
  height: 14px;
  stroke: var(--accent);
  flex-shrink: 0;
}

.topbar__social { display: flex; gap: 12px; }
.topbar__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  transition: all 0.3s ease;
}
.topbar__social a:hover {
  background: var(--primary);
  transform: translateY(-2px);
}
.topbar__social svg { width: 14px; height: 14px; fill: #fff; }

/* --- Header / Navigation --- */
.header {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition);
}

.header--scrolled {
  box-shadow: var(--shadow-md);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  max-width: var(--container);
  margin: 0 auto;
  height: 80px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header__logo img {
  height: 38px;
  width: auto;
}

.header__logo-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

.header__logo-text span {
  color: var(--primary);
}

.nav { display: flex; align-items: center; gap: 36px; }

.nav__link {
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  position: relative;
  padding: 8px 0;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav__link:hover, .nav__link--active {
  color: var(--primary);
}

.nav__link:hover::after, .nav__link--active::after {
  width: 100%;
}

.nav__cta {
  padding: 10px 24px;
  font-size: 0.85rem;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 6px 0;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* --- Hero Banner --- */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(13,107,94,0.9) 0%, rgba(26,26,46,0.95) 100%),
              url('../images/hero-bg.jpg') center/cover no-repeat;
  color: var(--white);
  overflow: hidden;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero__label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1.25rem;
  display: block;
}

.hero__title {
  color: var(--white);
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero__text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2.5rem;
  max-width: 550px;
}

.hero__buttons { display: flex; gap: 16px; flex-wrap: wrap; }

.hero__decoration {
  position: absolute;
  right: -10%;
  top: 50%;
  transform: translateY(-50%);
  width: 500px;
  height: 500px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.06);
  z-index: 1;
}

.hero__decoration::before {
  content: '';
  position: absolute;
  inset: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.04);
}

/* Page Hero (inner pages) */
.page-hero {
  position: relative;
  padding: 120px 0 80px;
  background: linear-gradient(135deg, rgba(13,107,94,0.9) 0%, rgba(26,26,46,0.95) 100%);
  color: var(--white);
  text-align: center;
}

.page-hero__title {
  color: var(--white);
  margin-bottom: 1rem;
}

.page-hero__breadcrumb {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}

.page-hero__breadcrumb a { color: var(--accent); }
.page-hero__breadcrumb a:hover { text-decoration: underline; }

/* --- Marquee --- */
.marquee {
  background: var(--secondary);
  padding: 20px 0;
  overflow: hidden;
  white-space: nowrap;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.marquee--dragging {
  cursor: grabbing;
}

.marquee__inner {
  display: inline-flex;
  flex-shrink: 0;
  animation: marquee 30s linear infinite;
  will-change: transform;
  min-width: 200%;
}

.marquee__inner--paused {
  animation-play-state: paused;
}

.marquee__item {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: rgba(255,255,255,0.12);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 20px;
  flex-shrink: 0;
}

.marquee__item span {
  color: rgba(255,255,255,0.25);
  margin: 0 16px;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Feature Cards --- */
.feature-card {
  background: var(--white);
  padding: 40px 30px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  text-align: center;
  transition: all var(--transition);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(13,107,94,0.1);
  border-color: rgba(13,107,94,0.2);
}

.feature-card__icon {
  width: 64px;
  height: 64px;
  background: var(--light-bg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  transition: all var(--transition);
}

.feature-card:hover .feature-card__icon {
  background: var(--primary);
}

.feature-card__icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 1.5;
  transition: all var(--transition);
}

.feature-card:hover .feature-card__icon svg { stroke: var(--white); }

.feature-card__title {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--secondary);
}

.feature-card__text {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0;
}

/* --- Stats --- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  text-align: center;
}

.stat__value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.stat__label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
}

/* --- Product/Category Cards --- */
.category-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.category-card__image {
  height: 220px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.category-card__image svg {
  width: 64px;
  height: 64px;
  stroke: var(--white);
  fill: none;
  stroke-width: 1.2;
  opacity: 0.8;
}

.category-card__body {
  padding: 24px;
}

.category-card__title {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 8px;
}

.category-card__text {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.category-card__link {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-card__link:hover { gap: 10px; }

.category-card__link svg {
  width: 16px;
  height: 16px;
  stroke: var(--primary);
  fill: none;
  transition: all 0.3s ease;
}

/* --- Alternating Content Sections --- */
.content-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.content-row--reverse { direction: rtl; }
.content-row--reverse > * { direction: ltr; }

.content-row__image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  background-size: cover;
  background-position: center;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.content-row__image svg {
  width: 120px;
  height: 120px;
  stroke: rgba(255,255,255,0.3);
  fill: none;
  stroke-width: 0.8;
}

.content-row__body h2 { margin-bottom: 1rem; }
.content-row__body p { margin-bottom: 1.5rem; }

.content-row__list {
  margin-bottom: 2rem;
}

.content-row__list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  color: var(--text-light);
  font-size: 0.95rem;
}

.content-row__list li svg {
  width: 20px;
  height: 20px;
  stroke: var(--primary);
  fill: none;
  flex-shrink: 0;
  margin-top: 2px;
}

/* --- Process Steps --- */
.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  position: relative;
}

.process-steps::before {
  content: '';
  position: absolute;
  top: 48px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.process-step {
  text-align: center;
  position: relative;
  z-index: 1;
}

.process-step__number {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  transition: all var(--transition);
}

.process-step:hover .process-step__number {
  background: var(--primary);
}

.process-step__number svg {
  width: 36px;
  height: 36px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 1.5;
  transition: all var(--transition);
}

.process-step:hover .process-step__number svg { stroke: var(--white); }

.process-step__title {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 8px;
}

.process-step__text {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* --- Timeline --- */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  transform: translateX(-50%);
}

.timeline__item {
  position: relative;
  padding: 0 0 50px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.timeline__dot {
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 3px var(--primary);
  z-index: 1;
}

.timeline__content {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.timeline__year {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.timeline__item:nth-child(odd) .timeline__content { grid-column: 1; text-align: right; }
.timeline__item:nth-child(even) .timeline__content { grid-column: 2; }

/* --- CTA Banner --- */
.cta-banner {
  position: relative;
  padding: 80px 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--white);
  text-align: center;
  overflow: hidden;
}

.cta-banner h2 { color: var(--white); margin-bottom: 1rem; }
.cta-banner p { color: rgba(255,255,255,0.8); max-width: 600px; margin: 0 auto 2rem; }

/* --- Contact Form --- */
.contact-form {
  display: grid;
  gap: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  transition: all 0.3s ease;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,107,94,0.1);
}

.form-group textarea { min-height: 150px; resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* --- Contact Info Card --- */
.contact-info {
  background: var(--secondary);
  color: var(--white);
  padding: 40px;
  border-radius: var(--radius-md);
}

.contact-info h3 {
  color: var(--white);
  margin-bottom: 8px;
}

.contact-info > p {
  color: rgba(255,255,255,0.6);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.contact-info__item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.contact-info__item:last-child { border-bottom: none; }

.contact-info__icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info__icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  fill: none;
}

.contact-info__text strong {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  color: rgba(255,255,255,0.5);
}

.contact-info__text a,
.contact-info__text p {
  color: var(--white);
  font-size: 0.95rem;
  margin: 0;
}

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

/* --- Footer --- */
.footer {
  background: #0F0F1A;
  color: rgba(255,255,255,0.6);
  padding: 80px 0 0;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer__brand-text {
  font-size: 0.9rem;
  line-height: 1.8;
  margin-top: 16px;
  max-width: 320px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer__logo img {
  height: 32px;
  width: auto;
}

.footer__logo-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  white-space: nowrap;
}

.footer__logo-text span {
  color: var(--accent);
}

.footer__title {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white);
  margin-bottom: 20px;
}

.footer__links li { margin-bottom: 10px; }

.footer__links a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  transition: all 0.3s ease;
}

.footer__links a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.footer__contact-item {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.footer__contact-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent);
  fill: none;
  flex-shrink: 0;
  margin-top: 3px;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  font-size: 0.85rem;
}

.footer__bottom > p {
  margin: 0;
}


.footer__credit-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.footer__credit-link:hover {
  color: rgba(255,255,255,0.7);
}

.footer__credit-link svg {
  width: 16px;
  height: 16px;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-primary);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  stroke: var(--white);
  fill: none;
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.7s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.7s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- Mission/Vision Cards --- */
.mv-card {
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.mv-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
}

.mv-card__icon {
  width: 56px;
  height: 56px;
  background: var(--light-bg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.mv-card__icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
  fill: none;
}

.mv-card h3 { margin-bottom: 12px; }

/* --- Why Choose Us --- */
.why-card {
  display: flex;
  gap: 20px;
  padding: 30px;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.why-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.why-card__number {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--light-bg);
  line-height: 1;
  flex-shrink: 0;
  -webkit-text-stroke: 1px var(--primary);
}

.why-card h4 { margin-bottom: 8px; }

.why-card p { font-size: 0.9rem; margin-bottom: 0; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .process-steps { grid-template-columns: repeat(2, 1fr); }
  .process-steps::before { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .content-row { gap: 40px; }
}

@media (max-width: 768px) {
  .section { padding: 60px 0; }

  .category-card[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
  }

  .category-card[style*="grid-template-columns"] .category-card__image {
    height: 180px !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
  }

  .topbar .flex--between { flex-direction: column; gap: 8px; text-align: center; }
  .topbar__left { flex-direction: column; gap: 6px; }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    padding: 100px 30px 30px;
    gap: 0;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    align-items: flex-start;
  }

  .nav.open { right: 0; }

  .nav__link {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  .nav__cta { margin-top: 20px; }

  .nav-toggle { display: block; }

  .header__logo img { height: 28px; }
  .header__logo-text { font-size: 1.15rem; }

  .hero { min-height: 70vh; padding: 100px 0 60px; }
  .hero__decoration { display: none; }
  .hero__buttons { flex-direction: column; }

  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .grid--4 { grid-template-columns: 1fr; }

  .content-row { grid-template-columns: 1fr; }
  .content-row--reverse { direction: ltr; }
  .content-row__image { min-height: 280px; }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  .process-steps { grid-template-columns: 1fr 1fr; }

  .timeline::before { left: 20px; }
  .timeline__item { grid-template-columns: 1fr; padding-left: 50px; }
  .timeline__dot { left: 20px; }
  .timeline__item:nth-child(odd) .timeline__content { grid-column: 1; text-align: left; }

  .form-row { grid-template-columns: 1fr; }

  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; gap: 16px; text-align: center; }

  .page-hero { padding: 100px 0 60px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .stat__value { font-size: 2.2rem; }
  .process-steps { grid-template-columns: 1fr; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-left, .reveal-right { opacity: 1; transform: none; }
}

/* --- Language Switcher (top bar, LTR + RTL) --- */
.topbar__lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  margin-right: 12px;
}
.topbar__lang:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================
   RTL (Arabic) Overrides
   Activated by <html dir="rtl"> on *-ar.html pages.
   Fully scoped — cannot leak into LTR pages.
   ============================================ */

/* Fonts: Tajawal for body, Cairo for headings */
[dir="rtl"] body {
  font-family: 'Tajawal', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[dir="rtl"] .stat__value,
[dir="rtl"] .timeline__year,
[dir="rtl"] .why-card__number,
[dir="rtl"] .marquee__item {
  font-family: 'Cairo', 'Tajawal', 'Playfair Display', Georgia, serif;
}

/* Keep brand wordmark in Latin — it's a proper noun */
[dir="rtl"] .header__logo-text,
[dir="rtl"] .footer__logo-text {
  font-family: 'Playfair Display', Georgia, serif;
  direction: ltr;
  unicode-bidi: isolate;
}

/* Tighten letter-spacing — Arabic doesn't want wide tracking */
[dir="rtl"] .section-label,
[dir="rtl"] .hero__label,
[dir="rtl"] .nav__link,
[dir="rtl"] .btn,
[dir="rtl"] .footer__title,
[dir="rtl"] .stat__label,
[dir="rtl"] .category-card__link,
[dir="rtl"] .process-step__title {
  letter-spacing: 0;
}

/* Language switcher margin flip */
[dir="rtl"] .topbar__lang {
  margin-right: 0;
  margin-left: 12px;
}

/* --- .content-row--reverse conflict resolution ---
   style.css:656 sets `direction: rtl` as a layout flip trick and
   style.css:657 resets children to `direction: ltr`. Under a page-level
   RTL document, line 657 would force Arabic text back to LTR inside
   reverse rows. Neutralize it and use explicit grid-column placement. */
[dir="rtl"] .content-row--reverse > * { direction: rtl; }
[dir="rtl"] .content-row > .content-row__image { grid-column: 2; }
[dir="rtl"] .content-row > .content-row__body  { grid-column: 1; }
[dir="rtl"] .content-row--reverse > .content-row__image { grid-column: 1; }
[dir="rtl"] .content-row--reverse > .content-row__body  { grid-column: 2; }

/* Back-to-top button: was right: 30px -> left: 30px */
[dir="rtl"] .back-to-top {
  right: auto;
  left: 30px;
}

/* Timeline odd-child text alignment (style.css:826) */
[dir="rtl"] .timeline__item:nth-child(odd) .timeline__content {
  text-align: left;
}

/* Footer link hover slide direction (style.css:1017) */
[dir="rtl"] .footer__links a:hover {
  padding-left: 0;
  padding-right: 4px;
}

/* Category-card "Learn More →" arrow — flip horizontally */
[dir="rtl"] .category-card__link svg {
  transform: scaleX(-1);
}

/* Products page: 4 category cards use inline
   `grid-template-columns: 200px 1fr` with inline
   `border-radius: var(--radius-md) 0 0 var(--radius-md)` on the image.
   In RTL the rounded corners must flip to the right side.
   !important is required to beat the inline style. */
[dir="rtl"] .category-card[style*="grid-template-columns: 200px"] .category-card__image {
  border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
}

/* Mirror reveal-left / reveal-right entry animations */
[dir="rtl"] .reveal-left  { transform: translateX(40px); }
[dir="rtl"] .reveal-right { transform: translateX(-40px); }

/* Mobile (<=768px) RTL overrides */
@media (max-width: 768px) {
  /* Mobile nav slides in from the LEFT, not the right (style.css:1240-1256) */
  [dir="rtl"] .nav {
    right: auto;
    left: -100%;
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
  }
  [dir="rtl"] .nav.open {
    right: auto;
    left: 0;
  }

  /* Line 1281: .content-row--reverse { direction: ltr } mobile reset.
     Keep RTL on Arabic pages. */
  [dir="rtl"] .content-row--reverse { direction: rtl; }

  /* Timeline mobile layout flip (style.css:1288-1291) */
  [dir="rtl"] .timeline::before { left: auto; right: 20px; }
  [dir="rtl"] .timeline__item {
    padding-left: 0;
    padding-right: 50px;
  }
  [dir="rtl"] .timeline__dot { left: auto; right: 20px; }
  [dir="rtl"] .timeline__item:nth-child(odd) .timeline__content {
    text-align: right;
  }
}
