/* ============================================================
   Webify Component Library — Components
   Every block renders correctly in LTR and RTL from one
   codebase (logical properties + [dir] hooks in rtl.css).
   ============================================================ */

/* ---------- Sticky header ---------- */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-header);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-block-end: 1px solid transparent;
  transition: box-shadow var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}
.site-header.is-scrolled {
  box-shadow: var(--shadow-md);
  border-block-end-color: var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: var(--space-xs); font-family: var(--font-heading); font-weight: 700; color: var(--text-strong); }
.brand__logo { height: 2.2rem; width: auto; }
.brand__name { font-size: var(--fs-lg); }

.nav { margin-inline-start: auto; }
.nav__list { display: flex; align-items: center; gap: var(--space-lg); }
.nav__link {
  position: relative;
  font-weight: 500;
  color: var(--text-body);
  padding-block: 0.25rem;
}
.nav__link::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: -2px;
  height: 2px;
  background: var(--brand-accent);
  transform: scaleX(0);
  transform-origin: inline-start;
  transition: transform var(--transition-base);
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--text-strong); }
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }

.header__actions { display: flex; align-items: center; gap: var(--space-sm); }

/* Language toggle */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0.4rem 0.85rem;
  font-weight: 600;
  font-size: var(--fs-sm);
  border-radius: var(--radius-full);
  box-shadow: inset 0 0 0 1.5px var(--border);
  color: var(--text-body);
  transition: color var(--transition-fast), box-shadow var(--transition-fast);
}
.lang-toggle:hover { color: var(--brand-accent); box-shadow: inset 0 0 0 1.5px var(--brand-accent); }
.lang-toggle__globe { width: 1.05em; height: 1.05em; }

/* Mobile menu button + drawer */
.nav-toggle { display: none; }
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
  content: ""; display: block; width: 22px; height: 2px;
  background: var(--text-strong); border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}
.nav-toggle__bar { position: relative; }
.nav-toggle__bar::before { position: absolute; inset-block-start: -7px; inset-inline-start: 0; }
.nav-toggle__bar::after  { position: absolute; inset-block-start: 7px;  inset-inline-start: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after  { transform: translateY(-7px) rotate(-45deg); }

/* Back to the library default of 860px. It was raised to 1080px while the
   nav carried 7 top-level items; folding the three products into the
   Solutions dropdown took it to 5, and the row now measures 761px at its
   narrowest in English (742px in Arabic) — so 860px clears it with ~100px
   spare. Keep this in sync with the min-width blocks in webify.css
   ("Header fit") and the Solutions dropdown/accordion blocks. */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
  .nav {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(80vw, 20rem);
    margin: 0;
    padding: var(--space-xl) var(--space-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    overflow-y: auto;
  }
  [dir="rtl"] .nav { transform: translateX(-100%); }
  .nav.is-open { transform: translateX(0); }
  .nav__list { flex-direction: column; align-items: stretch; gap: var(--space-xs); }
  .nav__link { padding: var(--space-sm) var(--space-xs); font-size: var(--fs-lg); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(3.5rem, 10vw, 7rem);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--brand-primary-dark) 92%, transparent), color-mix(in srgb, var(--brand-primary) 78%, transparent)),
    var(--brand-primary);
  color: var(--color-gray-100);
  overflow: clip;
}
.hero__bg {
  position: absolute; inset: 0;
  object-fit: cover; width: 100%; height: 100%;
  opacity: 0.22; mix-blend-mode: luminosity;
  z-index: 0;
}
.hero__inner { position: relative; z-index: 1; display: grid; gap: var(--space-2xl); align-items: center; }
@media (min-width: 900px) { .hero__inner { grid-template-columns: 1.1fr 0.9fr; } }
.hero__eyebrow { color: var(--brand-accent-light); }
.hero__title { color: #fff; font-size: var(--fs-4xl); }
.hero__title .accent {
  background: linear-gradient(90deg, var(--brand-accent-light), var(--brand-accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead { margin-block: var(--space-lg); font-size: var(--fs-lg); color: color-mix(in srgb, #fff 82%, transparent); max-width: 40ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-md); }
.hero__stats { display: flex; flex-wrap: wrap; gap: var(--space-xl); margin-block-start: var(--space-2xl); }
.hero__stat-value { font-family: var(--font-heading); font-size: var(--fs-2xl); font-weight: 700; color: #fff; }
.hero__stat-label { font-size: var(--fs-sm); color: color-mix(in srgb, #fff 70%, transparent); }
.hero__card {
  background: color-mix(in srgb, #fff 8%, transparent);
  border: 1px solid color-mix(in srgb, #fff 16%, transparent);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-lg);
}

/* ---------- Generic card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  height: 100%;
}
.card:hover { transform: translateY(var(--lift-hover-y)); box-shadow: var(--lift-hover-shadow); border-color: color-mix(in srgb, var(--brand-accent) 40%, var(--border)); }
.card__icon {
  display: inline-grid; place-items: center;
  width: 3rem; height: 3rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand-accent) 14%, var(--surface));
  color: var(--brand-accent-dark);
  margin-block-end: var(--space-md);
}
.card__icon svg { width: 1.6rem; height: 1.6rem; }
.card__title { font-size: var(--fs-lg); margin-block-end: var(--space-xs); }
.card__text { color: var(--text-muted); font-size: var(--fs-sm); }

/* ---------- Catalog / product grid ---------- */
.product {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.product:hover { transform: translateY(var(--lift-hover-y)); box-shadow: var(--lift-hover-shadow); }
.product__media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-muted); overflow: hidden; }
.product__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-slow); }
.product:hover .product__media img { transform: scale(1.05); }
.product__tag {
  position: absolute; inset-block-start: var(--space-sm); inset-inline-start: var(--space-sm);
  background: var(--brand-primary); color: #fff;
  font-size: var(--fs-xs); font-weight: 600;
  padding: 0.25rem 0.65rem; border-radius: var(--radius-full);
}
.product__body { padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-2xs); flex: 1; }
.product__name { font-family: var(--font-heading); font-weight: 600; font-size: var(--fs-lg); color: var(--text-strong); }
.product__spec { font-size: var(--fs-sm); color: var(--text-muted); }
.product__cta { margin-block-start: var(--space-md); }
.product__cta .btn { width: 100%; }

/* Catalog filter (progressive; JS filters) */
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--space-xs); justify-content: center; margin-block-end: var(--space-xl); }
.filter-bar__btn {
  padding: 0.45rem 1.1rem; font-weight: 600; font-size: var(--fs-sm);
  border-radius: var(--radius-full); color: var(--text-body);
  box-shadow: inset 0 0 0 1.5px var(--border); transition: all var(--transition-fast);
}
.filter-bar__btn.is-active, .filter-bar__btn:hover { background: var(--brand-primary); color: #fff; box-shadow: none; }

/* ---------- Split / About ---------- */
.split { display: grid; gap: var(--space-2xl); align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } .split--reverse .split__media { order: 2; } }
.split__media img { border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: 100%; }
.split__list { display: grid; gap: var(--space-sm); margin-block-start: var(--space-lg); }
.split__list li { display: flex; gap: var(--space-sm); align-items: flex-start; }
.split__check { flex: none; width: 1.4rem; height: 1.4rem; color: var(--brand-accent); margin-block-start: 0.15rem; }

/* ---------- Team ---------- */
.member { text-align: center; }
.member__photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-lg); margin-block-end: var(--space-md); }
.member__name { font-family: var(--font-heading); font-weight: 600; color: var(--text-strong); }
.member__role { font-size: var(--fs-sm); color: var(--brand-accent-dark); }

/* ---------- Testimonials ---------- */
.quote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: var(--space-md); height: 100%;
}
.quote-card__mark { font-family: Georgia, serif; font-size: 3rem; line-height: 0.6; color: var(--brand-accent); }
.quote-card__text { color: var(--text-body); font-size: var(--fs-lg); }
.quote-card__author { display: flex; align-items: center; gap: var(--space-sm); margin-block-start: auto; }
.quote-card__avatar { width: 2.75rem; height: 2.75rem; border-radius: var(--radius-full); object-fit: cover; }
.quote-card__name { font-weight: 600; color: var(--text-strong); }
.quote-card__meta { font-size: var(--fs-sm); color: var(--text-muted); }

/* ---------- FAQ accordion ---------- */
.faq { max-width: 48rem; margin-inline: auto; }
.faq__item { border-block-end: 1px solid var(--border); }
.faq__trigger {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  width: 100%; text-align: start;
  padding-block: var(--space-lg);
  font-family: var(--font-heading); font-weight: 600; font-size: var(--fs-lg); color: var(--text-strong);
}
.faq__icon { flex: none; width: 1.4rem; height: 1.4rem; transition: transform var(--transition-base); color: var(--brand-accent); }
.faq__trigger[aria-expanded="true"] .faq__icon { transform: rotate(45deg); }
.faq__panel { overflow: hidden; height: 0; transition: height var(--transition-base); }
.faq__panel-inner { padding-block-end: var(--space-lg); color: var(--text-muted); }

/* ---------- Quote-request form (B2B wedge) ---------- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 4vw, var(--space-2xl));
  box-shadow: var(--shadow-md);
}
.field { display: flex; flex-direction: column; gap: var(--space-2xs); margin-block-end: var(--space-md); }
.field__label { font-weight: 600; font-size: var(--fs-sm); color: var(--text-strong); }
.field__label .req { color: var(--danger); }
.field__control {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-size: var(--fs-base);
  color: var(--text-strong);
  background: var(--surface-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.field__control:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 22%, transparent);
}
textarea.field__control { min-height: 7rem; resize: vertical; }
.field__error { font-size: var(--fs-xs); color: var(--danger); min-height: 1em; }
.field__control[aria-invalid="true"] { border-color: var(--danger); }
.form-grid { display: grid; gap: 0 var(--space-md); }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }
.form-status {
  margin-block-start: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  display: none;
}
.form-status.is-success { display: block; background: color-mix(in srgb, var(--success) 12%, var(--surface)); color: var(--success); }
.form-status.is-error   { display: block; background: color-mix(in srgb, var(--danger) 12%, var(--surface));  color: var(--danger); }

/* ---------- PDF catalog block (B2B wedge) ---------- */
.pdf-block {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}
.pdf-block__icon {
  flex: none; display: grid; place-items: center;
  width: 4rem; height: 4rem; border-radius: var(--radius-lg);
  background: var(--brand-wash);
  color: var(--brand-primary);
}
.pdf-block__icon svg { width: 2rem; height: 2rem; }
.pdf-block__body { flex: 1 1 16rem; }
.pdf-block__title { font-family: var(--font-heading); font-weight: 700; color: var(--text-strong); font-size: var(--fs-lg); }
.pdf-block__meta { font-size: var(--fs-sm); color: var(--text-muted); }
.pdf-block__cta { margin-inline-start: auto; }

/* ---------- Distributor / branch finder (B2B wedge) ---------- */
.finder { display: grid; gap: var(--space-xl); }
@media (min-width: 900px) { .finder { grid-template-columns: 0.9fr 1.1fr; } }
.finder__controls { display: flex; flex-direction: column; gap: var(--space-md); }
.finder__list { display: grid; gap: var(--space-md); max-height: 30rem; overflow-y: auto; padding-inline-end: var(--space-2xs); }
.branch {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-lg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.branch.is-active, .branch:hover { border-color: var(--brand-accent); box-shadow: var(--shadow-sm); }
.branch__city { font-family: var(--font-heading); font-weight: 600; color: var(--text-strong); }
.branch__addr { font-size: var(--fs-sm); color: var(--text-muted); margin-block: var(--space-2xs); }
.branch__links { display: flex; flex-wrap: wrap; gap: var(--space-md); font-size: var(--fs-sm); font-weight: 600; }
.branch__links a { color: var(--brand-primary); }
.branch__links a:hover { color: var(--brand-accent); }
.finder__map { border-radius: var(--radius-lg); overflow: hidden; min-height: 22rem; box-shadow: var(--shadow-md); }
.finder__map iframe { width: 100%; height: 100%; min-height: 22rem; border: 0; }
.finder[hidden] { display: none; }

/* ---------- Contact + map ---------- */
.contact { display: grid; gap: var(--space-2xl); }
@media (min-width: 900px) { .contact { grid-template-columns: 1fr 1fr; } }
.contact__info { display: grid; gap: var(--space-lg); align-content: start; }
.info-item { display: flex; gap: var(--space-md); align-items: flex-start; }
.info-item__icon { flex: none; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: var(--radius-md); background: color-mix(in srgb, var(--brand-accent) 14%, var(--surface)); color: var(--brand-accent-dark); }
.info-item__icon svg { width: 1.25rem; height: 1.25rem; }
.info-item__label { font-size: var(--fs-sm); color: var(--text-muted); }
.info-item__value { font-weight: 600; color: var(--text-strong); }
.map-embed { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); min-height: 18rem; }
.map-embed iframe { width: 100%; height: 100%; min-height: 18rem; border: 0; }

/* ---------- WhatsApp click-to-chat float ---------- */
.wa-float {
  position: fixed;
  inset-block-end: var(--space-lg);
  inset-inline-end: var(--space-lg);
  z-index: var(--z-overlay);
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.5rem; height: 3.5rem;
  border-radius: var(--radius-full);
  /* WhatsApp teal-green, not the #25D366 brand green: a white glyph on
     #25D366 is 1.98:1, under the 3:1 WCAG 1.4.11 asks of an icon button.
     #128C7E is 4.14:1 and is in WhatsApp's own palette. */
  background: #128c7e; color: #fff;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-base);
}
.wa-float:hover { transform: scale(1.08); color: #fff; background: #075e54; }
.wa-float svg { width: 1.9rem; height: 1.9rem; }
.wa-float__pulse { position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(18,140,126,0.5); animation: wa-pulse 2.4s infinite; }
@keyframes wa-pulse { 100% { box-shadow: 0 0 0 16px rgba(18,140,126,0); } }
@media (prefers-reduced-motion: reduce) { .wa-float__pulse { animation: none; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface-inverse); color: var(--color-gray-300); padding-block: var(--space-3xl) var(--space-xl); }
.footer__grid { display: grid; gap: var(--space-2xl); grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.footer__brand .brand__name { color: #fff; }
.footer__about { margin-block-start: var(--space-md); font-size: var(--fs-sm); max-width: 28ch; color: var(--color-gray-400); }
.footer__col-title { font-family: var(--font-heading); font-weight: 600; color: #fff; margin-block-end: var(--space-md); font-size: var(--fs-base); }
.footer__links { display: grid; gap: var(--space-xs); }
.footer__links a { font-size: var(--fs-sm); color: var(--color-gray-300); }
.footer__links a:hover { color: var(--link-hover-on-dark); }
.footer__social { display: flex; gap: var(--space-sm); margin-block-start: var(--space-md); }
.footer__social a { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: var(--radius-full); background: color-mix(in srgb, #fff 8%, transparent); color: #fff; transition: background var(--transition-fast); }
.footer__social a:hover { background: var(--brand-accent); color: var(--brand-on-accent); }
.footer__social svg { width: 1.15rem; height: 1.15rem; }
.footer__bottom { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); justify-content: space-between; align-items: center; margin-block-start: var(--space-2xl); padding-block-start: var(--space-lg); border-block-start: 1px solid color-mix(in srgb, #fff 12%, transparent); font-size: var(--fs-sm); color: var(--color-gray-400); }
.footer__bottom p { color: inherit; }
.footer__legal a { color: inherit; text-decoration: underline; text-underline-offset: 0.2em; }
.footer__legal a:hover { color: var(--color-white); }
/* The fixed WhatsApp float sits over the end of the last footer line on a
   phone. Padding the footer by the float's height + offset keeps the © line
   clear of it when scrolled to the very bottom. */
@media (max-width: 47.999rem) { .site-footer { padding-block-end: calc(3.5rem + 2 * var(--space-lg)); } }
.footer__made a { color: var(--brand-accent-light); font-weight: 600; }
