/* Floating decorative images — shared across Khayam Mall variants */

html {
  overflow-x: clip;
  max-width: 100%;
}

.section-with-floats {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.section-with-floats > :not(.float-layer) {
  position: relative;
  z-index: 1;
}

.float-img {
  position: absolute;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  opacity: 0.42;
  will-change: transform;
  animation: kmFloatDrift var(--float-dur, 14s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.float-img.size-xs { width: clamp(56px, 14vw, 88px); height: clamp(56px, 14vw, 88px); }
.float-img.size-sm { width: clamp(72px, 18vw, 120px); height: clamp(72px, 18vw, 120px); }
.float-img.size-md { width: clamp(96px, 22vw, 160px); height: clamp(96px, 22vw, 160px); }
.float-img.size-lg { width: clamp(120px, 26vw, 200px); height: clamp(120px, 26vw, 200px); }

.float-img.pos-tl { top: 8%; left: 4%; --rot: -6deg; }
.float-img.pos-tr { top: 10%; right: 3%; --rot: 5deg; }
.float-img.pos-bl { bottom: 12%; left: 6%; --rot: 4deg; }
.float-img.pos-br { bottom: 10%; right: 5%; --rot: -4deg; }
.float-img.pos-mid-r { top: 38%; right: 2%; --rot: 3deg; }
.float-img.pos-mid-l { top: 42%; left: 2%; --rot: -3deg; }

.float-img.delay-1 { --float-delay: 0s; --float-dur: 13s; }
.float-img.delay-2 { --float-delay: -4s; --float-dur: 16s; }
.float-img.delay-3 { --float-delay: -8s; --float-dur: 18s; }
.float-img.delay-4 { --float-delay: -2s; --float-dur: 15s; }

@keyframes kmFloatDrift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--rot, 0deg)); }
  50% { transform: translate3d(0, -14px, 0) rotate(calc(var(--rot, 0deg) + 2deg)); }
}

/* Light theme variants */
[data-theme="light"] .float-img,
html[data-theme="light"] .float-img {
  opacity: 0.38;
  border-color: rgba(12, 74, 58, 0.15);
  box-shadow: 0 12px 36px rgba(12, 74, 58, 0.12);
}

/* Tablet: fewer, smaller */
@media (max-width: 1024px) {
  .float-img.size-lg { width: clamp(88px, 20vw, 140px); height: clamp(88px, 20vw, 140px); }
  .float-img.size-md { width: clamp(72px, 18vw, 110px); height: clamp(72px, 18vw, 110px); }
  .float-img.pos-mid-r, .float-img.pos-mid-l { opacity: 0.28; }
}

/* Mobile: compact floats, hide extras */
@media (max-width: 640px) {
  .float-img { opacity: 0.26; }
  .float-img.size-lg,
  .float-img.size-md { width: clamp(64px, 22vw, 96px); height: clamp(64px, 22vw, 96px); }
  .float-img.hide-mobile { display: none; }
  .float-img.pos-mid-r,
  .float-img.pos-mid-l { display: none; }
}

@media (max-width: 380px) {
  .float-img.size-sm.hide-xs { display: none; }
  .float-img { opacity: 0.22; }
}

@media (prefers-reduced-motion: reduce) {
  .float-img { animation: none; }
}

/* Phone numbers — always LTR inside RTL pages */
.tel-num,
.phone-ltr,
a[href^="tel:"] .tel-num {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  display: inline-block;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.contact-phone-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  text-align: center;
}

.contact-phone-btn .tel-label {
  direction: rtl;
  unicode-bidi: isolate;
}

.contact-meta .tel-num,
.contact-info-card .tel-num {
  margin-top: 0.35rem;
}

/* Language switcher — fa / en / ar */

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  background: color-mix(in srgb, currentColor 6%, transparent);
}

.lang-btn {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: center;
  min-width: 2.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  color: inherit;
  opacity: 0.72;
  transition: background 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.lang-btn:hover {
  opacity: 1;
}

.lang-btn.is-active {
  opacity: 1;
  background: color-mix(in srgb, currentColor 14%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent);
}

.lang-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, currentColor 55%, transparent);
  outline-offset: 2px;
}

html[dir="ltr"] .lang-switcher {
  direction: ltr;
}

html[dir="rtl"] .lang-switcher {
  direction: rtl;
}

@media (max-width: 767px) {
  .lang-switcher {
    margin-inline: 0.25rem;
  }

  .lang-btn {
    min-width: 2rem;
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
  }
}
