/* Keep the existing layout tokens. These selectors cover physical RTL styles. */
html[lang="tr"] :is(
  .brand small,
  .header-search-panel,
  .phone-page,
  .pagination,
  .phones-pagination,
  .board-side-label,
  .icto-design-credit,
  .icto-certificate-url,
  .app-surface .hero-platforms .hero-fine,
  main section.page-width[dir="rtl"]
) {
  direction: ltr;
}

html[lang="tr"] :is(
  .header-search-panel,
  .brand-options button,
  .phone-list button,
  .fault-list article > button,
  .site-footer .copyright > .icto-design-credit,
  .site-footer .copyright > span:first-child,
  .site-footer .icto-footer-social__intro
) {
  text-align: start;
}

html[lang="tr"] :is(
  #home-solutions,
  .solution-nav-badge,
  .solution-mobile-link,
  .solution-setting-link,
  header a[href="/solutions"],
  header a[href="/tr/solutions"]
) {
  display: none !important;
}

html[lang="tr"] .signup-terms ol {
  list-style-type: decimal;
}

html[lang="tr"] .tr-spam-warning {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-block-start: 12px;
  padding: 14px;
  border: 2px solid #be760b;
  border-radius: 12px;
  background: #fff3cc;
  color: #693800;
  text-align: start;
  line-height: 1.5;
}

html[lang="tr"] .tr-spam-warning[hidden] {
  display: none;
}

.tr-spam-warning__icon {
  font-size: 32px;
  line-height: 1;
}

.tr-spam-warning__title,
.tr-spam-warning__text {
  display: block;
}

.tr-spam-warning__title {
  font-size: 16px;
  font-weight: 800;
}

.tr-spam-warning__text {
  margin-block-start: 3px;
  font-size: 13px;
  font-weight: 500;
}

.site-footer :is(.icto-trust-card, .enamad-link, .icto-certificate-url),
.site-footer :is(div,section):has(> .enamad-link) {
  display: none !important;
}

/* Use the Persian mobile header layout with the Turkish destination URLs. */
@media (max-width: 820px) {
  html[lang="tr"] .site-header,
  html[lang="tr"] .site-header .header-search-panel {
    direction: rtl;
  }

  html[lang="tr"] .site-header .header-search-panel input {
    direction: ltr;
    text-align: left;
  }

  :where(html[lang="tr"]) .site-header .topbar.page-width > nav > a:is([href="/tr/premium"], [href="/tr/app"]) {
    display: inline-flex;
    justify-content: center;
    min-height: 34px;
    min-width: 0;
    padding: 8px;
    gap: 3px;
    font-size: 11px;
    line-height: 1.2;
  }

  html[lang="tr"] #mobile-site-nav > a[href="/tr/boards"] {
    display: none;
  }
}

@media (max-width: 420px) {
  :where(html[lang="tr"]) .site-header .topbar.page-width > nav > a:is([href="/tr/premium"], [href="/tr/app"]) {
    min-height: 32px;
    padding: 7px 6px;
    font-size: 10px;
  }
}

@media (max-width: 350px) {
  :where(html[lang="tr"]) .site-header .topbar.page-width > nav > a:is([href="/tr/premium"], [href="/tr/app"]) {
    padding-inline: 4px;
    font-size: 9.5px;
  }
}

/* Shadow DOM styles for the existing support chat. */
:host([data-icto-locale="tr"]) {
  direction: ltr;
}

:host([data-icto-locale="tr"]) :is(.topic, .proactive, .member-message) {
  text-align: start;
}

:host([data-icto-locale="tr"]) .msg:not(.mine) {
  border-radius: 16px 16px 16px 3px;
}

:host([data-icto-locale="tr"]) .msg.mine {
  margin-left: auto;
  margin-right: 0;
  border-radius: 16px 16px 3px 16px;
}

:host([data-icto-locale="tr"]) .quote {
  border-left: 3px solid #91b440;
  border-right: 0;
}
#plans .premium-checkout .tr-usdt-primary {
  display: inline-grid;
  align-items: center;
  justify-items: start;
  gap: 2px;
  min-height: 52px;
  padding: 9px 16px;
  border: 1px solid #6389ff;
  border-radius: 12px;
  background: linear-gradient(132deg, #1748df, #1036b3);
  color: #fff;
  box-shadow: 0 5px 16px #173fba40;
  line-height: 1.35;
  text-align: start;
  text-decoration: none;
}
#plans .tr-usdt-primary strong { color: inherit; font-size: 16px; }
#plans .tr-usdt-primary small { color: #e2eaff; font-size: 13px; }
#plans .tr-usdt-primary:hover { background: #10329f; }
#plans .tr-usdt-primary:focus-visible { outline: 2px solid #8eacff; outline-offset: 3px; }
#plans :is(.premium-pay, .premium-gateways, .icto-coupon-form),
#plans #premium-admin-preview :is(.has-gateways, .premium-result),
#plans .premium-checkout.has-gateways > span > small {
  display: none !important;
}
@media (max-width: 600px) {
  #plans .premium-checkout .tr-usdt-primary { width: 100%; box-sizing: border-box; }
}

/* Turkish flag placement for desktop and mobile. */
html[lang="tr"] {
  --icto-tr-flag-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20120%2080%22%3E%3Cpath%20fill%3D%22%23e30a17%22%20d%3D%22M0%200h120v80H0z%22%2F%3E%3Ccircle%20fill%3D%22%23fff%22%20cx%3D%2240%22%20cy%3D%2240%22%20r%3D%2220%22%2F%3E%3Ccircle%20fill%3D%22%23e30a17%22%20cx%3D%2245%22%20cy%3D%2240%22%20r%3D%2216%22%2F%3E%3Cpolygon%20fill%3D%22%23fff%22%20points%3D%2255.67%2C40%2062.58%2C37.75%2062.58%2C30.49%2066.85%2C36.37%2073.76%2C34.12%2069.49%2C40%2073.76%2C45.88%2066.85%2C43.63%2062.58%2C49.51%2062.58%2C42.25%22%2F%3E%3C%2Fsvg%3E");
}
html[lang="tr"] .site-header .topbar > .brand::after {
  content: "";
  display: block;
  flex: 0 0 auto;
  width: 24px;
  height: 16px;
  margin-left: 3px;
  border-radius: 2px;
  background:
    linear-gradient(105deg, rgba(0, 0, 0, .14), transparent 30%, rgba(255, 255, 255, .16) 58%, transparent 85%) 20% 0 / 145% 100% no-repeat,
    var(--icto-tr-flag-image) center / contain no-repeat;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
  transform-origin: left center;
  animation: icto-tr-flag-wave 4.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes icto-tr-flag-wave {
  0%, 100% {
    background-position: 20% 0, center;
    transform: perspective(48px) rotateY(-7deg) rotateZ(-2deg) skewY(0);
  }

  50% {
    background-position: 75% 0, center;
    transform: perspective(48px) rotateY(8deg) rotateZ(2deg) skewY(-2deg);
  }
}

@media (max-width: 820px) {
  html[lang="tr"] .site-header .topbar > .brand::after {
    content: none;
  }

  html[lang="tr"] .site-header::after,
  html[lang="tr"] body:not(:has(.site-header))::after {
    content: "";
    left: max(6px, env(safe-area-inset-left));
    width: 18px;
    height: 12px;
    background: var(--icto-tr-flag-image) center / contain no-repeat;
    pointer-events: none;
  }

  html[lang="tr"] .site-header::after {
    position: absolute;
    top: calc(100% + 5px);
  }

  html[lang="tr"] body:not(:has(.site-header))::after {
    position: fixed;
    top: max(6px, env(safe-area-inset-top));
  }
}

@media (prefers-reduced-motion: reduce) {
  html[lang="tr"] .site-header .topbar > .brand::after {
    animation: none;
  }
}
