/* Baltic Clean — unified responsive & layout-shift fixes 2026 */

/* Prevent horizontal overflow */
html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Reserve space for fixed header — prevents CLS */
body > .h-20,
header + .h-20 {
  min-height: 5rem;
}

/* Container consistency */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

/* Header responsive */
@media (max-width: 1024px) {
  .container { padding-left: 1rem; padding-right: 1rem; }
  h1 { font-size: clamp(1.75rem, 5vw, 3.5rem) !important; }
  h2 { font-size: clamp(1.35rem, 4vw, 2.5rem) !important; }

  header .flex.items-center.gap-4 {
    gap: 0.5rem !important;
  }

  header .flex.items-center.bg-gray-100.rounded-3xl {
    max-width: calc(100vw - 180px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  header .flex.items-center.bg-gray-100.rounded-3xl::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero-bg {
    background-attachment: scroll !important;
    min-height: 70vh !important;
    height: auto !important;
    padding: 3rem 0 !important;
  }

  .map-container { height: 280px !important; }

  section.py-20 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }

  .text-5xl, .text-7xl {
    font-size: clamp(1.75rem, 7vw, 2.25rem) !important;
    line-height: 1.2 !important;
  }

  .text-2xl, .text-3xl {
    font-size: clamp(1.1rem, 4vw, 1.35rem) !important;
  }

  .px-12 {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  .grid.md\:grid-cols-3,
  .grid.md\:grid-cols-4,
  .grid.lg\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  .service-card, .price-card {
    padding: 1.5rem !important;
  }

  /* Mobile menu full width */
  #mobileMenu {
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
  }

  /* Forms */
  form input, form textarea, form select, form button {
    font-size: 16px !important; /* prevents iOS zoom */
  }

  /* Modals */
  .fixed.inset-0 .bg-white,
  #successModal > div {
    margin: 1rem !important;
    max-width: calc(100vw - 2rem) !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .grid.md\:grid-cols-3,
  .grid.lg\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .grid.md\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .h-screen {
    min-height: 65vh !important;
    height: auto !important;
    padding: 3.5rem 0 !important;
  }

  .price-card, .service-card {
    transform: none !important;
  }

  header .logo-font {
    font-size: 1.25rem !important;
  }

  header .w-12.h-12 {
    width: 2.5rem !important;
    height: 2.5rem !important;
    font-size: 1.25rem !important;
  }

  .flex.flex-col.sm\:flex-row {
    flex-direction: column !important;
  }

  a.inline-flex.px-12 {
    width: 100%;
    justify-content: center;
  }
}

/* Tablet landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .hero-bg.h-screen {
    min-height: 100vh !important;
    height: auto !important;
  }
}

/* Mobile LCP: avoid fixed parallax hero on touch devices */
@media (max-width: 768px) {
  .hero-bg {
    background-attachment: scroll !important;
    background-image: url('/images/bg.png') !important;
  }
}

/* Floating widgets — avoid overlap with chat */
#bc-consent-fab.bc-visible {
  bottom: 16px;
  left: 16px;
}

#bc-widgets {
  display: none !important;
}

.bc-widget-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  transition: transform .2s, box-shadow .2s;
}

.bc-widget-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  color: #fff;
}

.bc-widget-phone { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.bc-widget-telegram { background: #229ED9; }
.bc-widget-whatsapp { background: #25D366; }
.bc-widget-viber { background: #7360F2; }

@media (max-width: 480px) {
  #bc-widgets {
    bottom: 90px;
    left: 12px;
    gap: 8px;
  }
  .bc-widget-btn {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}

/* Chat + consent FAB spacing on mobile */
@media (max-width: 768px) {
  #bc-consent-fab {
    bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
    left: max(12px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
  }
  body.bc-chat-open #bc-consent-fab,
  body.bc-menu-open #bc-chat-fab.bc-hidden {
    display: none !important;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Print */
@media print {
  header, #bc-chat-root, #bc-widgets, #chat-toggle, .messenger-btn.floating {
    display: none !important;
  }
}