/* ==========================================================================
   АТЛАС — Завод модульных зданий
   Специальные стили для автономной HTML версии (анимации, модалы, калькулятор)
   Работает совместно с atlas-theme.css (полная дизайн-система Tailwind v4)
   ========================================================================== */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
}

/* Atlas Corporate Button with Shine effect like on atlas-vagon.ru */
.btn-atlas-primary {
  background: linear-gradient(135deg, #B71010 0%, #E11C25 50%, #8E0317 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(183, 16, 16, 0.35);
}

.btn-atlas-primary:hover {
  background: linear-gradient(135deg, #c71c27 0%, #eb2c35 50%, #9a0b14 100%);
  box-shadow: 0 6px 20px rgba(183, 16, 16, 0.45);
  transform: translateY(-1px);
}

.btn-atlas-primary:active {
  transform: translateY(0);
}

.btn-atlas-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(30deg);
  pointer-events: none;
  transition: all 0.75s ease;
}

.btn-atlas-primary:hover::after {
  left: 120%;
}

/* Animations */
@keyframes pulseGlow {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.15);
  }
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background-color: #ef4444;
  animation: pulseGlow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.pulse-dot-emerald {
  background-color: #10b981;
}

/* Custom Calculator Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  height: 6px;
  border-radius: 9999px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: #c81717;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(200, 23, 23, 0.4);
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: #c81717;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(200, 23, 23, 0.4);
}

/* Drawer Transitions & High Z-Index Layering */
.mobile-drawer-wrapper,
#mobileDrawer {
  z-index: 99999999 !important;
  position: fixed !important;
  inset: 0 !important;
  transition: opacity 0.3s ease;
}

#mobileDrawer > div:first-child {
  z-index: 99999998 !important;
  position: fixed !important;
  inset: 0 !important;
}

#mobileDrawer > div:nth-child(2) {
  z-index: 100000000 !important;
  position: relative !important;
}

/* Modals & Lightbox Z-index Layering */
#imageLightbox {
  z-index: 999999999 !important;
  position: fixed !important;
  inset: 0 !important;
  cursor: zoom-out;
}

#calculatorModal,
#callbackModal,
#plantVisitModal,
#caseStudyModal,
#bookletModal {
  z-index: 90000000 !important;
  position: fixed !important;
  inset: 0 !important;
}

#calculatorModal.hidden,
#callbackModal.hidden,
#plantVisitModal.hidden,
#caseStudyModal.hidden,
#bookletModal.hidden,
#imageLightbox.hidden {
  display: none !important;
}

#calculatorModal.flex,
#callbackModal.flex,
#plantVisitModal.flex,
#caseStudyModal.flex,
#bookletModal.flex,
#imageLightbox.flex {
  display: flex !important;
}

/* Line clamp support to ensure blog article titles and descriptions are always visible */
.line-clamp-2 {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis;
}

.line-clamp-3 {
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis;
}

header {
  z-index: 99999 !important;
  position: fixed !important;
}

#mobileMenuToggle,
header button[aria-label="Меню"] {
  z-index: 100000 !important;
  position: relative !important;
}

/* Zoomable image cards and gallery overlays */
.cursor-zoom-in {
  cursor: zoom-in !important;
}

.cursor-zoom-in .pointer-events-none {
  pointer-events: none !important;
}

/* Product detail tabs */
[role="tab"] {
  cursor: pointer;
  user-select: none;
}

/* Lightbox */
#imageLightbox img {
  cursor: default;
}
