/* ============================================================
   Arapça RTL (sağdan-sola) override stil dosyası
   Dosya yolu: /assets/css/rtl.css
   Enqueue: sadece [dir="rtl"] olan sayfalarda yüklenir
   Bu dosya styles.css'den SONRA yüklenir ve yön-bağımlı 
   özellikleri aynalar.
   ============================================================ */

/* ========== TEMEL YÖN ========== */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
}

html[dir="rtl"] body {
  overflow-x: hidden;
  max-width: 100vw;
}

[dir="rtl"] body {
  font-family: "IBM Plex Sans Arabic", "Segoe UI", "Tahoma", "Arial", sans-serif;
}

/* Monospace Arapça için - mümkünse latin karakterleri mono kullan, arapçayı normal */
[dir="rtl"] .mono,
[dir="rtl"] .eyebrow,
[dir="rtl"] .code,
[dir="rtl"] .meta,
[dir="rtl"] nav.primary,
[dir="rtl"] .tag-ping,
[dir="rtl"] .cat-card .num,
[dir="rtl"] .cat-card .count,
[dir="rtl"] .prod-card .code,
[dir="rtl"] .prod-card .meta,
[dir="rtl"] .prod-card .arrow-row,
[dir="rtl"] .hero-meta .item,
[dir="rtl"] .footer a,
/* Sayılar ve latin kodlar için tasrif düzeltmeleri */
[dir="rtl"] .code,
[dir="rtl"] .str-code {
  unicode-bidi: plaintext;
}

/* ========== TOPBAR ========== */
[dir="rtl"] .topbar-inner {
  /* grid yön değişmez (auto 1fr auto), içerik otomatik aynalanır */
}

[dir="rtl"] .brand {
  flex-direction: row;  /* logo yine yanyana */
}

[dir="rtl"] nav.primary {
  /* gap korunur, RTL için justify center ok */
}

[dir="rtl"] .btn .arrow {
  transform: scaleX(-1) translateX(0);  /* okun yönünü aynala */
}

[dir="rtl"] .btn:hover .arrow {
  transform: scaleX(-1) translateX(-4px);
}

/* Nav underline'ın sol/sağ pozisyonu */
[dir="rtl"] nav.primary a.active::after {
  /* left/right zaten 0/0 */
}


/* ========== HERO ========== */
[dir="rtl"] .hero h1,
[dir="rtl"] .hero .lede {
  text-align: right;
}

[dir="rtl"] .hero-meta {
  direction: rtl;  /* 4 column korunur ama başlangıç sağdan */
}

[dir="rtl"] .corners::before {
  right: 16px;
  left: auto;
  border-top: 1px solid;
  border-right: 1px solid;
  border-left: none;
}

[dir="rtl"] .corners::after {
  left: 16px;
  right: auto;
  border-top: 1px solid;
  border-left: 1px solid;
  border-right: none;
}

[dir="rtl"] .corners > .c1 {
  right: 16px;
  left: auto;
  border-bottom: 1px solid;
  border-right: 1px solid;
  border-left: none;
}

[dir="rtl"] .corners > .c2 {
  left: 16px;
  right: auto;
  border-bottom: 1px solid;
  border-left: 1px solid;
  border-right: none;
}

/* ========== SECTION HEAD ========== */
[dir="rtl"] .section-head {
  grid-template-columns: 2fr 1fr;  /* default: 1fr 2fr - aynala */
}
[dir="rtl"] .section-head > div:first-child { grid-column: 2; }
[dir="rtl"] .section-head > div:last-child { grid-column: 1; text-align: left; }

@media(max-width: 900px) {
  [dir="rtl"] .section-head {
    grid-template-columns: 1fr;
  }
  [dir="rtl"] .section-head > div { grid-column: 1; text-align: right; }
}

/* ========== BREADCRUMB ========== */
[dir="rtl"] .crumbs {
  direction: rtl;
}

[dir="rtl"] .crumbs .sep {
  /* separator / kalabilir, otomatik okunur */
  margin: 0 8px;
}

/* ========== KATEGORİ GRID ========== */
[dir="rtl"] .cat-grid {
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

[dir="rtl"] .cat-card {
  border-left: 1px solid var(--line);
  border-right: none;
}

[dir="rtl"] .cat-card:last-child {
  /* grid son eleman */
}

/* ========== ÜRÜN GRİD & KARTLAR ========== */
[dir="rtl"] .prod-card {
  text-align: right;
}

[dir="rtl"] .prod-card .arrow-row {
  flex-direction: row;  /* View detail | → kalsın ama → aynalansın */
}

[dir="rtl"] .prod-card .arrow-row span:last-child {
  transform: scaleX(-1);  /* → okunu ← yap */
}

/* ========== PDP (ÜRÜN DETAY) ========== */
[dir="rtl"] .pdp-layout {
  grid-template-columns: 1fr 1fr;  /* yapı değişmez */
}

[dir="rtl"] .pdp-info {
  text-align: right;
}

[dir="rtl"] .pdp-features {
  padding-right: 0;
  padding-left: 0;
  list-style: none;
}

[dir="rtl"] .pdp-features li {
  padding-right: 24px;
  padding-left: 0;
  position: relative;
}

[dir="rtl"] .pdp-features li::before {
  right: 0;
  left: auto;
}

[dir="rtl"] .pdp-cta {
  justify-content: flex-start;
}

[dir="rtl"] .spec-table {
  direction: rtl;
}

[dir="rtl"] .spec-table th {
  text-align: right;
}

[dir="rtl"] .spec-table td {
  text-align: left;  /* değerler latin sayı olduğu için */
  unicode-bidi: plaintext;
}

/* ========== FOOTER ========== */
[dir="rtl"] .site footer,
[dir="rtl"] footer.site {
  direction: rtl;
}

[dir="rtl"] .foot-inner {
  text-align: right;
}

[dir="rtl"] .foot-inner h4 {
  text-align: right;
}

[dir="rtl"] .foot-inner ul {
  padding: 0;
  list-style: none;
}

[dir="rtl"] .legal {
  flex-direction: row;  /* copyright | version */
}

/* ========== COOKIE BANNER ========== */
[dir="rtl"] .cookie-banner {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .cookie-actions {
  flex-direction: row;
}

/* ========== WHATSAPP FLOAT ========== */
[dir="rtl"] .sm-wa-float {
  right: auto;
  left: 24px;
}

[dir="rtl"] .sm-wa-label {
  right: auto;
  left: 100%;
  margin-right: 0;
  margin-left: 12px;
}

/* ========== EXP-ANIM (expandable ürün animasyonu) ========== */
[dir="rtl"] .exp-anim {
  direction: ltr;  /* diyagram LTR kalsın, aynalamak çizimi bozar */
}

[dir="rtl"] .exp-anim .phase {
  /* phase etiketleri sabit pozisyonda */
}

/* ========== LANGUAGE SWITCHER ========== */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-inline-start: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.15s ease;
}

.lang-switcher:hover {
  border-color: var(--ink);
}

.lang-switcher .lang-flag {
  font-weight: 600;
  color: var(--ink);
}

.lang-switcher .lang-sep {
  color: var(--muted-2);
  margin: 0 2px;
}

.lang-switcher .lang-alt {
  color: var(--muted);
}

.lang-switcher .lang-alt:hover {
  color: var(--accent-ink);
}

/* mobile'da language switcher */
@media (max-width: 900px) {
  .lang-switcher {
    margin-inline-start: 0;
  }
}

/* ========== SVG İÇERİKLERİ LTR KALSIN ========== */
[dir="rtl"] svg,
[dir="rtl"] svg * {
  direction: ltr !important;
  unicode-bidi: embed;
}

[dir="rtl"] svg {
  max-width: 100%;
}

[dir="rtl"] .prod-card .media,
[dir="rtl"] .pdp-gallery {
  direction: ltr;  /* teknik çizim SVG'leri asla aynalanmasın */
}

/* ========== SİTE.JS TİCKER LATIN STRINGLERİ ========== */
/* ========== ARKA PLAN GRID & MOCK ELEMENTS ========== */
/* Grid, mock placeholder ve teknik çizim öğeleri aynalanmamalı */
[dir="rtl"] .ph,
[dir="rtl"] .exp-anim,
[dir="rtl"] .grid-bg {
  direction: ltr;
}

/* ========== HR VE AYIRICLAR ========== */
[dir="rtl"] hr.rule {
  /* border-top değişmez */
}

/* ========== FORM ALANLARI ========== */
[dir="rtl"] input[type="text"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] textarea {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="url"] {
  /* email/phone için direction: ltr isteyebiliriz ama text-align sağa */
  direction: ltr;
  text-align: right;
}

[dir="rtl"] label {
  text-align: right;
  display: block;
}

[dir="rtl"] .form-row {
  flex-direction: row;  /* yapı korunsun */
}

/* ========== ALGORITHMS - Arrow, Chevron Flips ========== */
[dir="rtl"] .arrow {
  display: inline-block;
  transform: scaleX(-1);
}

/* ========== ÖNEMLİ OVERRIDE: SAYI İÇEREN BLOCKLAR ========== */
[dir="rtl"] .hero-meta .item b,
[dir="rtl"] .factory-stats b,
[dir="rtl"] .stat-big {
  unicode-bidi: plaintext;
}


/* ========== HERO MEDIA SVG — RTL'de sıkı constraint ========== */
[dir="rtl"] .hero-media {
  overflow: hidden;
  max-width: 100vw;
  left: 0;
  right: 0;
}

[dir="rtl"] .hero-media svg {
  max-width: 100vw !important;
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  right: 0 !important;
  position: absolute !important;
}

[dir="rtl"] .hero-media svg * {
  /* SVG içeriği viewBox ile sınırlı olmalı */
  transform: none;
}

/* SVG'nin scrollWidth'i genişlemesin */
[dir="rtl"] .hero {
  contain: layout paint;
}

/* ========== TICKER — RTL'de GİZLE (scroll-width taşmasını tamamen önler) ========== */
[dir="rtl"] .ticker {
  display: none !important;
}
