/* custom.css — глобальні кастомні стилі (після Webflow CSS) */

/* Прибираємо підкреслення з усіх посилань */
a { text-decoration: none; }

/* FAQ accordion — padding-bottom: 0 перекриває Webflow CSS (32px) при закритому стані */
.question-ansver {
  max-height: 0;
  overflow: hidden;
  padding-bottom: 0;
  transition: max-height 0.35s ease-in-out, padding-bottom 0.35s ease-in-out;
}
.faq-accordion.is-open .question-ansver {
  max-height: 2000px;
  padding-bottom: 32px;
}
.faq-arrow {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.35s ease-in-out;
}
.faq-accordion.is-open .faq-arrow {
  transform: rotate(90deg);
}
.faq-trigger {
  cursor: pointer;
}

/* ─── RTL support (Arabic) ─────────────────────────────────────────────────── */
/*
 * IMPORTANT: Browsers auto-reverse flex-row direction when dir="rtl".
 * Do NOT add flex-direction: row-reverse — it would cancel the auto-reversal
 * and keep the layout LTR.
 *
 * Only override:
 *  - Physical properties (padding-left/right, margin-left/right, border-radius)
 *  - Asymmetric transforms (FAQ arrow)
 *  - Elements that explicitly set text-align: left in Webflow CSS
 */

/* FAQ arrow: в LTR вказує вправо (→), в RTL — вліво (←) */
[dir="rtl"] .faq-arrow {
  transform: rotate(180deg);
}
[dir="rtl"] .faq-accordion.is-open .faq-arrow {
  transform: rotate(90deg);
}

/* Dropdown icon: mirror margin-right → margin-left */
[dir="rtl"] .icon {
  margin-right: 0;
  margin-left: auto;
}

/* Webflow base .w-dropdown-toggle має text-align: left — фіксуємо */
[dir="rtl"] .w-dropdown-toggle {
  text-align: right;
}

/* Who-list pills: flip asymmetric padding (LTR: 12 20 12 12 → RTL: 12 12 12 20) */
[dir="rtl"] .who-list-item {
  padding: 12px 12px 12px 20px;
}

/* Hero badge: flip asymmetric padding (LTR: 2 12 2 2 → RTL: 2 2 2 12) */
[dir="rtl"] .div-block-71 {
  padding: 2px 2px 2px 12px;
}

/*
 * Steps, KZ, Footer columns: `align-items: flex-start` in column layouts
 * already resolves to inline-start = RIGHT in RTL. No override needed.
 */

/* Centered headers: safety net — завжди по центру */
[dir="rtl"] .centered-header {
  text-align: center;
}

/* Hero section: центроване — лишаємо як є (text-align: center вже є у Webflow CSS) */

/* Partners text block */
[dir="rtl"] .div-block-2 {
  text-align: right;
}

/* ─── RTL: mirror background images in "3 Steps" & "Why KZ" sections ─────── */
/*
 * These sections have a background image with a person on the RIGHT side.
 * In RTL the flex content auto-reverses (text → right), but the bg stays right,
 * so text overlaps the person. Fix: mirror the bg via ::before + scaleX(-1).
 * At tablet (≤991px) the layout is vertical → no overlap, so we revert.
 */

/* --- Steps section --- */
[dir="rtl"] .section-bg-wraper.steps {
  background-image: none;
}
[dir="rtl"] .section-bg-wraper.steps::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url('../images/Frame-1597882649.avif');
  background-position: 100%;
  background-size: cover;
  transform: scaleX(-1);
  border-radius: inherit;
  z-index: 0;
}
[dir="rtl"] .section-bg-wraper.steps .content-width {
  position: relative;
  z-index: 1;
}

/* --- KZ section --- */
[dir="rtl"] .section-bg-wraper.kz {
  background-image: none;
  position: relative;
}
[dir="rtl"] .section-bg-wraper.kz::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url('../images/Frame-1597882652.avif');
  background-position: 100%;
  background-size: cover;
  transform: scaleX(-1);
  border-radius: inherit;
  z-index: 0;
}
[dir="rtl"] .section-bg-wraper.kz .content-width {
  position: relative;
  z-index: 1;
}

/* Tablet & below: layout is vertical, no overlap → revert to original bg */
@media screen and (max-width: 991px) {
  [dir="rtl"] .section-bg-wraper.steps {
    background-image: url('../images/iPhone-14--15-Pro-Max---2_1.avif');
    background-position: 50% 100%;
  }
  [dir="rtl"] .section-bg-wraper.steps::before {
    display: none;
  }
  [dir="rtl"] .section-bg-wraper.kz {
    background-image: url('../images/iPhone-14--15-Pro-Max---6.avif');
    background-position: 50% 100%;
    background-size: cover;
  }
  [dir="rtl"] .section-bg-wraper.kz::before {
    display: none;
  }
}

/* --- Pricing: swap price order in RTL (discounted price first in reading order) --- */
[dir="rtl"] .price-amount .div-block-69 {
  order: 1;
}

/* ─── Footer dropdown: open upward ────────────────────────────────────────── */
/* Footer is near the bottom of the page, so the dropdown must open upward */
.card-section.footer .w-dropdown {
  position: relative;
}
.card-section.footer .w-dropdown-list {
  bottom: 100%;
  top: auto;
  margin-bottom: 4px;
  margin-top: 0;
}
/* ─── Language dropdown redesign ────────────────────────────────────────── */

/* White panel — overrides dark Webflow default (.dropdown-list.w--open in Webflow CSS) */
.dropdown-list.w--open {
  background: #ffffff;
  border: 1px solid #e4e5e6;
  border-radius: 12px;
  padding: 6px;
  min-width: 150px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Items: clean list links, not button-style */
.w-locales-item a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: #111112;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
}
.w-locales-item a:hover {
  background: #f9f9f9;
}
.w-locales-item a[aria-current="page"] {
  color: #01a3d1;
  font-weight: 500;
}
[dir="rtl"] .w-locales-item a {
  text-align: right;
}

/* ─── Store badges (outlined) in QR block ──────────────────────────────── */
.store-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.store-badges img {
  opacity: 1;
}

/* Mobile native select: hidden by default, shown on small screens */
.lang-select-mobile {
  display: none;
}
@media screen and (max-width: 767px) {
  .header .w-dropdown,
  .card-section.footer .w-dropdown {
    display: none;
  }
  /* Footer: column-reverse → logo needs highest order to stay on top visually */
  .footer-left-column .logo-link {
    order: 10;
  }
  .lang-select-mobile {
    display: block;
    -webkit-appearance: none;
    appearance: none;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394979a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center;
    border: 1px solid #e4e5e6;
    border-radius: 8px;
    padding: 7px 28px 7px 10px;
    font-family: inherit;
    font-size: 16px;
    color: #94979a;
    cursor: pointer;
  }
  /* Footer: dark background → use dark border instead of light */
  .card-section.footer .lang-select-mobile {
    border-color: #2e2f30;
  }
}
