/* RTL adjustments on top of the original theme */

/* Infinite marquees animate with translateX(-50%) and must keep LTR flow */
.yg-swiper-image-marquee {
  direction: ltr;
}
.yg-swiper-image-marquee .swiper-slide {
  direction: rtl;
}

/* Direction icons were rendered for LTR — mirror them (the theme does this with .reverse-icon) */
[dir='rtl'] :is(.icon-chevron-left, .icon-chevron-right, .icon-arrow-left, .icon-arrow-right):not(.reverse-icon, .swiper *, [style*='direction: ltr'] *),
[dir='rtl'] :is([is='prev-button'], [is='next-button']) svg:not(.swiper *) {
  transform: scaleX(-1);
}

/* Custom Swiper carousels position their arrows with physical left/right, so keep them in
   LTR mode exactly like the original; slide content stays right-to-left. */
.swiper {
  direction: ltr;
}
.swiper .swiper-slide,
.swiper > :not(.swiper-wrapper) {
  direction: rtl;
}
/* prev/next button pairs laid out in a row keep their LTR order (only pure control rows) */
:has(> [class*='button-prev']):has(> [class*='button-next']):not(:has(> :not([class*='button'], [class*='pagination'], [class*='progress'], [class*='counter'], .swiper-notification))) {
  direction: ltr;
}

/* "Buy now" button (replaces Shopify's accelerated checkout), styled like the sticky bar's Buy it Now */
buy-buttons .button.lavenne-buy-now {
  background: #db0f27 !important;
  border-color: #db0f27 !important;
  color: #fff !important;
  --button-background: 219 15 39;
  --button-text-color: 255 255 255;
  --button-outline-color: 219 15 39;
}
buy-buttons .button.lavenne-buy-now:hover {
  background: #b90b20 !important;
  border-color: #b90b20 !important;
}

/* ---------- Checkout (new page, built with the theme's tokens) ---------- */
.lavenne-checkout {
  display: grid;
  gap: var(--spacing-10, 40px);
  align-items: start;
}
@media screen and (min-width: 1000px) {
  .lavenne-checkout {
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: var(--spacing-16, 64px);
  }
  .lavenne-checkout__summary {
    position: sticky;
    top: calc(var(--sticky-area-height, 0px) + 24px);
  }
}
@media screen and (max-width: 999px) {
  .lavenne-checkout__summary {
    order: -1;
  }
}
.lavenne-checkout fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
.lavenne-checkout legend {
  margin-bottom: 12px;
}
.lavenne-checkout__summary {
  background: rgb(var(--secondary-background, 246 246 246));
  border-radius: var(--rounded, 12px);
  padding: 24px;
}
.lavenne-checkout__option {
  display: flex;
  justify-content: space-between;
  border: 1px solid rgb(var(--text-color) / 0.15);
  border-radius: var(--rounded-sm, 8px);
  padding: 14px 16px;
}
.lavenne-checkout__thumb {
  position: relative;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #fff;
}
.lavenne-checkout__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lavenne-checkout__thumb .count-bubble {
  position: absolute;
  top: -8px;
  inset-inline-start: -8px;
}
.lavenne-checkout input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: rgb(var(--text-color));
  flex: none;
}
.lavenne-form-message {
  margin-top: 8px;
}

/* No customer accounts on this store */
a[href^='/account'] {
  display: none !important;
}
shopify-account,
li:has(> shopify-account),
.panel-footer__localization-wrapper {
  display: none !important;
}

/* Never allow sideways page scrolling on touch devices (a few full-bleed theme blocks overshoot by
   the container gutter — also on the original site). `clip` keeps position: sticky working. */
html,
body {
  overflow-x: clip;
}

/* Home "Support beyond the chair": mirror the delivery photo so the (now right-aligned) title sits on the
   light part of the image, as in the original composition */
[dir='rtl'] #shopify-section-template--27713374486571__yg_grid_v2_cbYUAE .yg-grid-v2__item:first-child .yg-grid-v2__item-background-image img {
  transform: scaleX(-1);
}

/* ---------- Product reviews (replaces the Judge.me widget, same look) ---------- */
.lavenne-reviews {
  max-width: 640px;
  margin-inline: auto;
  padding: 64px var(--container-gutter, 20px);
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}
.lavenne-reviews__title {
  font-family: var(--heading-font-family);
  font-weight: var(--heading-font-weight, 500);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
}
.lavenne-reviews__empty {
  font-size: 18px;
}
.lavenne-reviews__toggle {
  border-radius: 999px;
  --button-background: 46 46 46;
}
.lavenne-reviews__form {
  width: 100%;
  display: grid;
  gap: 12px;
  text-align: start;
  margin-top: 8px;
}
.lavenne-reviews__form[hidden] {
  display: none;
}
.lavenne-reviews__stars {
  display: flex;
  flex-direction: row-reverse; /* highlight from the first star (right side in RTL) */
  justify-content: center;
  gap: 4px;
  font-size: 30px;
}
.lavenne-reviews__stars input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.lavenne-reviews__stars label {
  cursor: pointer;
  color: rgb(var(--text-color) / 0.2);
  transition: color 0.15s;
}
.lavenne-reviews__stars label:hover,
.lavenne-reviews__stars label:hover ~ label,
.lavenne-reviews__stars input:checked ~ label {
  color: #f0c417;
}

/* Pre-order page: "0 / 100" counter reads left-to-right; CTA arrow points forward (left) */
.lv2-count-number:not(:has(.lv2-count-suffix)) {
  direction: ltr;
  unicode-bidi: isolate;
}
[dir='rtl'] .lv2-cta svg {
  transform: scaleX(-1);
}
[dir='rtl'] :is(.yg-card-mega-menu__card, .yg-card-mega-menu-mobile__card) [class*='arrow'] svg {
  transform: scaleX(-1);
}

/* Full search page results */
.lavenne-search-page {
  width: 100%;
  max-width: 720px;
  margin: 40px auto 0;
  text-align: start;
}

[dir='rtl'] .lv2-count-row p {
  text-align: start;
}

/* Pre-order "switcher" tabs: the script positions the pill with translateX(offset from the LEFT edge),
   so anchor the pill to the left padding edge instead of its RTL static position (right). */
.smart_chair_feature_tabs .tab-buttons {
  position: relative;
}
.smart_chair_feature_tabs .tab-indicator {
  left: 6px;
  right: auto;
}
@media screen and (max-width: 768px) {
  .smart_chair_feature_tabs .tab-indicator {
    left: 4px;
  }
}

/* JS-driven horizontal rails that move with translateX(-n) keep LTR geometry; their cards stay RTL */
.lr9v-rail,
.lr9v-track {
  direction: ltr;
}
.lr9v-track > * {
  direction: rtl;
}

/* Benefits bar: the theme sizes its grid track by content; the shorter Hebrew copy shrank it.
   Give it the full row like the original. */
.text-with-icons {
  grid-template-columns: minmax(0, 1fr);
}
