/* ==========================================================================
   Site-specific additions on top of the theme (styles.css).
   Accessibility, Arabic/RTL support and components added for this site.
   ========================================================================== */

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: 8px;
  z-index: 10000;
  padding: 10px 16px;
  background: var(--Onsurface);
  color: var(--White);
  border-radius: 4px;
}
.skip-link:focus { color: var(--White); }

:focus-visible {
  outline: 2px solid var(--Primary);
  outline-offset: 2px;
}
#main-content:focus { outline: none; }

@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;
  }
}

/* ---------- Arabic typography ---------- */
html[lang="ar"] body,
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3,
html[lang="ar"] h4, html[lang="ar"] h5, html[lang="ar"] h6,
html[lang="ar"] p, html[lang="ar"] a, html[lang="ar"] li,
html[lang="ar"] input, html[lang="ar"] textarea, html[lang="ar"] button,
html[lang="ar"] .tf-btn {
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
}
html[lang="ar"] body { line-height: 1.8; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.4; letter-spacing: 0; }

/* Keep inherently left-to-right values readable inside Arabic text. */
.ltr-value {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* ---------- RTL corrections for the theme ---------- */
[dir="rtl"] .page-title .content .breadcrumb li:not(:last-child)::after {
  right: auto;
  left: -17px;
  transform: scaleX(-1);
}
[dir="rtl"] .tf-breadcrumb-list .icon-right,
[dir="rtl"] .icon-arrow-up-right {
  display: inline-block;
  transform: scaleX(-1);
}
footer .footer-left { border-inline-end: 1px solid rgba(255, 255, 255, 0.1); }
[dir="rtl"] .text-start { text-align: right !important; }
[dir="rtl"] .text-end { text-align: left !important; }

/* ---------- Header / language switch ---------- */
.lang-switch {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.lang-switch a { color: inherit; opacity: 0.75; }
.lang-switch a[aria-current="true"] { opacity: 1; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.mobile-menu-btn {
  background: none;
  border: 0;
  padding: 4px;
  line-height: 0;
}
.nav-icon-item { background: none; border: 0; padding: 0; }

/* ---------- Page headings ---------- */
.page-title .content .title { margin-bottom: 12px; }
.heading-section h1.h3 { font-size: inherit; }

/* ---------- Forms ---------- */
.form-leave-comment label.form-label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--Secondary);
}
.form-leave-comment .is-invalid,
.form-leave-comment [aria-invalid="true"] { border-color: var(--Critical) !important; }
.field-error { color: var(--Critical); font-size: 14px; margin-top: 4px; }
.alert-site {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.alert-site.success { background: #eaf7e6; color: #1f5f12; border: 1px solid #b7e0ab; }
.alert-site.error { background: #fdecec; color: #8a1c1c; border: 1px solid #f3b9b9; }
/* Clip-based hiding: an off-screen left offset would widen the page in RTL. */
.hp-field { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- Product & blog grids ---------- */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 30px 24px;
}
.catalog-grid .card-product .image-wrap { aspect-ratio: 4 / 5; overflow: hidden; display: block; }
.catalog-grid .card-product .image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.catalog-empty { text-align: center; padding: 60px 0; color: var(--Secondary); }
.category-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.category-chips a {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
}
.category-chips a[aria-current="page"] { background: var(--Onsurface); color: var(--White); border-color: var(--Onsurface); }
.pagination-wrap { margin-top: 40px; display: flex; justify-content: center; }
.pagination-wrap .pagination { flex-wrap: wrap; gap: 4px; }
.pagination-wrap .page-link { color: var(--Onsurface); border-radius: 6px; }
.pagination-wrap .page-item.active .page-link { background: var(--Onsurface); border-color: var(--Onsurface); color: var(--White); }

/* Rich text coming from the admin editor. */
.rich-text { overflow-wrap: anywhere; }
.rich-text img { max-width: 100%; height: auto; }
.rich-text p { margin-bottom: 1em; }

/* ---------- Legal pages ---------- */
.legal-page { padding: 60px 0 80px; }
.legal-page .legal-meta { color: var(--Secondary); font-size: 14px; margin-bottom: 24px; }
.legal-page .legal-notice {
  background: var(--Surface);
  border-inline-start: 4px solid var(--Yellow);
  padding: 12px 16px;
  margin-bottom: 32px;
  font-size: 14px;
}
.legal-page nav.legal-toc { margin-bottom: 40px; }
.legal-page nav.legal-toc ol { padding-inline-start: 20px; list-style: decimal; }
.legal-page nav.legal-toc li { margin-bottom: 6px; list-style: decimal; }
.legal-page section { margin-bottom: 36px; scroll-margin-top: 100px; }
.legal-page h2 { font-size: 24px; line-height: 1.4; margin-bottom: 14px; }
.legal-page p { margin-bottom: 12px; color: var(--Secondary); }
.legal-page ul { padding-inline-start: 22px; margin-bottom: 12px; }
.legal-page ul li { list-style: disc; margin-bottom: 8px; color: var(--Secondary); }

/* ---------- Error pages ---------- */
.error-page { padding: 120px 0; text-align: center; }
.error-page .code { font-size: 96px; line-height: 1; color: var(--Primary); margin-bottom: 16px; }

/* ---------- Home category tiles ---------- */
.wrap-cls-img .cls-img-item h3 a { font-size: clamp(18px, 2.4vw, 32px); }
@media (max-width: 575px) {
  .wrap-cls-img .cls-img-item.hover-img { width: 100%; }
}
