/* Belbaza global layout & performance fixes */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: clip;
  margin: 0;
  padding-bottom: 72px;
}

#root {
  overflow-x: clip;
  width: 100%;
  min-height: 100dvh;
}

img {
  content-visibility: auto;
  contain-intrinsic-size: 300px 200px;
  max-width: 100%;
}

img[loading="lazy"] {
  background: #0f172a;
}

/* Equal-height card grids */
.grid {
  align-items: stretch;
}

.grid > a,
.grid > div {
  min-height: 0;
}

a[class*="rounded-2xl"],
a[class*="rounded-xl"],
a[class*="rounded-3xl"] {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Card text alignment */
.grid h3,
a[class*="rounded-2xl"] h3,
a[class*="rounded-xl"] h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  min-height: 2.7em;
}

/* Page headings */
h1 {
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Horizontal filter rows */
[class*="overflow-x-auto"] {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

[class*="overflow-x-auto"]::-webkit-scrollbar {
  display: none;
}

/* Map popup thumbnails */
[style*="z-index: 999999"] img {
  object-fit: cover !important;
  background: #0f172a;
  min-width: 56px;
  min-height: 56px;
}

/* Map price markers */
[style*="border-radius: 50%"][style*="cursor: pointer"] {
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

[style*="border-radius: 50%"][style*="cursor: pointer"]:hover {
  transform: scale(1.15) !important;
  box-shadow: 0 3px 10px rgba(0, 212, 170, 0.35) !important;
}

/* Hero sections */
[style*="kenBurns"] {
  will-change: transform;
}

/* Map containers */
[class*="rounded-2xl"][class*="overflow-hidden"] {
  min-height: 280px;
}

/* Footer full width */
footer {
  width: 100%;
}

@media (max-width: 767px) {
  body {
    padding-bottom: 88px;
  }

  h1 {
    font-size: clamp(1.25rem, 5.5vw, 1.75rem) !important;
  }

  [class*="flex-[60]"] {
    min-height: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  [style*="kenBurns"] {
    animation: none !important;
  }

  * {
    scroll-behavior: auto !important;
  }
}
