/* ============================================
   Mahraj Scaffoldings — Modern Design System v2
   ============================================ */
:root {
  --brand-red: #dc2626;
  --brand-red-dark: #b91c1c;
  --brand-red-deep: #7f1d1d;
  --brand-ink: #0b1220;
  --brand-ink-2: #0f172a;
  --brand-amber: #f59e0b;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.font-display {
  font-family: 'Barlow Condensed', 'Inter', sans-serif;
  letter-spacing: -0.01em;
}

html { scroll-behavior: smooth; }

/* ============================================
   PAGE PRELOADER — fast, minimal
   ============================================ */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background:
    radial-gradient(circle at 50% 38%, #141e33 0%, var(--brand-ink) 55%, #070b14 100%);
  transition: opacity 0.5s var(--ease-out-expo), visibility 0.5s var(--ease-out-expo);
  overflow: hidden;
}
#page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#page-loader.loaded .loader-stage { transform: scale(0.92); }

/* Soft brand aura behind the mark */
.loader-aura {
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220,38,38,0.28) 0%, rgba(220,38,38,0.08) 40%, transparent 70%);
  filter: blur(12px);
  animation: loaderAura 3.2s ease-in-out infinite;
  z-index: 0;
}
@keyframes loaderAura {
  0%, 100% { opacity: 0.55; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.08); }
}

.loader-grid { display: none; }

/* Rotating progress ring + centered icon */
.loader-stage {
  position: relative;
  z-index: 1;
  transition: transform 0.5s var(--ease-out-expo);
}
.loader-ring {
  position: relative;
  width: 120px;
  height: 120px;
}
.loader-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  animation: loaderSpin 1.6s linear infinite;
}
.loader-ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 5;
}
.loader-ring-progress {
  fill: none;
  stroke: var(--brand-red);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 230;
  filter: drop-shadow(0 0 6px rgba(220,38,38,0.6));
  animation: loaderDash 1.6s ease-in-out infinite;
}
@keyframes loaderSpin { to { transform: rotate(270deg); } }
@keyframes loaderDash {
  0% { stroke-dashoffset: 300; }
  50% { stroke-dashoffset: 90; }
  100% { stroke-dashoffset: 300; }
}
.loader-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader-icon {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(220,38,38,0.4);
  animation: loaderPulse 1.8s ease-in-out infinite;
}
@keyframes loaderPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Wordmark */
.loader-wordmark {
  height: 46px;
  width: auto;
  object-fit: contain;
  z-index: 1;
  filter: brightness(0) invert(1);
  opacity: 0.96;
  animation: loaderFade 0.7s ease-out both;
}
@keyframes loaderFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 0.96; transform: translateY(0); }
}

/* Thin indeterminate progress bar */
.loader-track {
  position: relative;
  width: 180px;
  max-width: 60vw;
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
  z-index: 1;
}
.loader-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--brand-red), var(--brand-amber));
  animation: loaderSlide 1.3s var(--ease-out-expo) infinite;
}
@keyframes loaderSlide {
  0% { left: -40%; width: 40%; }
  50% { width: 55%; }
  100% { left: 100%; width: 40%; }
}

.loader-text {
  z-index: 1;
  color: #94a3b8;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: 12px;
}
.loader-text b { color: var(--brand-red); margin: 0 2px; }

@media (prefers-reduced-motion: reduce) {
  .loader-aura, .loader-ring-svg, .loader-ring-progress, .loader-icon, .loader-bar { animation: none !important; }
  .loader-ring-progress { stroke-dashoffset: 170; }
}

/* ============================================
   TICKER BAR — fixed overflow, smooth
   ============================================ */
.ticker-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(90deg, var(--brand-red-deep) 0%, var(--brand-red) 50%, var(--brand-red-deep) 100%);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 13px;
  padding: 8px 0;
  z-index: 60;
  will-change: auto;
  contain: layout style;
}
.ticker-shine { display: none; }
.ticker-track {
  display: flex;
  width: max-content;
  animation: tickerScroll 60s linear infinite;
  will-change: transform;
}
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }
@keyframes tickerScroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
.ticker-content {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
  font-size: inherit;
}
.ticker-icon {
  margin-right: 8px;
  color: #fde68a;
  font-size: 12px;
}
.ticker-sep {
  display: inline-block;
  color: rgba(255,255,255,0.35);
  font-size: 8px;
  padding: 0 4px;
}
@media (max-width: 640px) {
  .ticker-wrap { font-size: 11px; padding: 6px 0; }
  .ticker-item { padding: 0 14px; }
}

/* ============================================
   HEADER — glassmorphism sticky
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* ============================================
   MOBILE NAV — full-screen overlay
   ============================================ */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(11, 18, 32, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-nav-overlay.open {
  opacity: 1;
  visibility: visible;
}
.mobile-nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 101;
  width: min(320px, 85vw);
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out-expo);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-nav-panel.open {
  transform: translateX(0);
}
.mobile-nav-panel .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s, color 0.2s;
}
.mobile-nav-panel .nav-link:hover,
.mobile-nav-panel .nav-link.active {
  background: #fef2f2;
  color: var(--brand-red);
}
.mobile-nav-panel .nav-link i {
  width: 20px;
  text-align: center;
  color: var(--brand-red);
}

/* ============================================
   HERO SLIDER — modern crossfade + Ken Burns
   ============================================ */
.hero-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--brand-ink);
}
.hero-slides {
  position: relative;
  width: 100%;
  min-height: 520px;
}
@media (min-width: 768px) { .hero-slides { min-height: 640px; } }
@media (min-width: 1024px) { .hero-slides { min-height: 700px; } }

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
  will-change: opacity;
}
.hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

/* Background with Ken Burns zoom */
.hero-slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.12);
  transition: transform 8s ease-out;
  will-change: transform;
}
.hero-slide.active .hero-slide-bg {
  transform: scale(1);
}

/* Dark overlay — fixed gradient for text readability */
.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 18, 32, 0.93) 0%, rgba(11, 18, 32, 0.75) 50%, rgba(11, 18, 32, 0.5) 100%);
}
@media (max-width: 768px) {
  .hero-slide-overlay {
    background:
      linear-gradient(180deg, rgba(11, 18, 32, 0.88) 0%, rgba(11, 18, 32, 0.7) 60%, rgba(11, 18, 32, 0.88) 100%);
  }
}

/* Grid pattern */
.hero-slide-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Content entry animation */
.hero-slide-content {
  position: relative;
  z-index: 3;
  opacity: 0;
  transform: translateY(20px);
}
.hero-slide.active .hero-slide-content {
  animation: heroFadeIn 0.7s ease-out 0.15s forwards;
}
@keyframes heroFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Slider dots — modern pill style */
.hero-dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 6;
}
.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  cursor: pointer;
  transition: all 0.35s var(--ease-out-expo);
  padding: 0;
}
.hero-dot.active {
  width: 32px;
  background: var(--brand-red);
  border-color: var(--brand-red);
}
.hero-dot:hover:not(.active) {
  border-color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.15);
}

/* Slider arrows — modern frosted */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.25s ease;
}
.hero-arrow:hover {
  background: var(--brand-red);
  border-color: var(--brand-red);
  transform: translateY(-50%) scale(1.05);
}
.hero-arrow.prev { left: 16px; }
.hero-arrow.next { right: 16px; }
@media (min-width: 1024px) { .hero-arrow { display: flex; } }

/* Progress bar */
.hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  z-index: 6;
}
.hero-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand-red), var(--brand-amber));
  border-radius: 0 2px 2px 0;
}
.hero-progress-bar.run {
  animation: heroProgress 5s linear forwards;
}
@keyframes heroProgress {
  from { width: 0; }
  to { width: 100%; }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-shine {
  position: relative;
  overflow: hidden;
}
.btn-shine::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.btn-shine:hover::after { left: 120%; }

/* ============================================
   CARD LIFT — smooth hover
   ============================================ */
.card-lift {
  transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s ease, border-color 0.35s ease;
}
.card-lift:hover { transform: translateY(-5px); }

/* ============================================
   LINE CLAMP
   ============================================ */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   SCROLLBAR — subtle red
   ============================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f8fafc; }
::-webkit-scrollbar-thumb { background: #dc2626; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b91c1c; }

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s var(--ease-out-expo);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ============================================
   RESPONSIVE MAP
   ============================================ */
iframe { display: block; }

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-slide-bg { transform: none !important; }
  .ticker-track { animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================
   DESKTOP MEGA MENU
   ============================================ */
.mega-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s var(--ease-out-expo);
  pointer-events: none;
}
.group:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ============================================
   FEATURED STRIP
   ============================================ */
.features-strip {
  background: linear-gradient(135deg, var(--brand-red) 0%, #ef4444 100%);
}

/* ============================================
   COUNTERS (homepage)
   ============================================ */
.counter-value {
  font-variant-numeric: tabular-nums;
}

/* ============================================
   STORE v2 — utilities & components
   ============================================ */
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

.mh-toast { opacity: 0; transform: translate(-50%, 14px); transition: opacity .25s ease, transform .25s var(--ease-out-expo, ease); }
.mh-toast.show { opacity: 1; transform: translate(-50%, 0); }

.pulse-once { animation: mhPulse .45s ease; }
@keyframes mhPulse { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }

.js-compare.is-active { color: #0f172a; background: #e2e8f0; border-color: #cbd5e1; }

.product-card .card-actions { transform: translateX(6px); transition: opacity .25s ease, transform .25s ease; }
.product-card:hover .card-actions { transform: translateX(0); }
@media (hover: none) { .product-card .card-actions { opacity: 1 !important; transform: none; } }

.zoom-container { cursor: zoom-in; }
.zoom-img { transition: transform .15s ease-out; will-change: transform; }

.drawer-panel { transform: translateX(100%); transition: transform .3s var(--ease-out-expo, ease); }
#filter-drawer.open .drawer-panel { transform: translateX(0); }

.qv-panel { animation: qvIn .25s var(--ease-out-expo, ease); }
@keyframes qvIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@media (max-width: 639px) {
  .qv-panel { animation: qvInMobile .25s ease; }
  @keyframes qvInMobile { from { opacity: 0; transform: translateY(-46%); } to { opacity: 1; transform: translateY(-50%); } }
}

details > summary::-webkit-details-marker { display: none; }

mark { color: inherit; }

#sticky-cta { padding-bottom: calc(.625rem + env(safe-area-inset-bottom)); }

/* Print: spec sheet / quote list */
@media print {
  .ticker-wrap, #site-header, #mobile-panel, #mobile-overlay, #wa-float, footer, #sticky-cta, #compare-bar, #back-to-top, #page-loader, .hero-slider, #quote-form, #product-tabs .tab-btn, nav[aria-label="Breadcrumb"] { display: none !important; }
  .tab-panel { display: block !important; }
  body { background: #fff; }
  a { text-decoration: none; color: inherit; }
}
