/**
 * URETECH 3D Monitor Hero — CSS
 * Real Elementor section transformed via CSS matrix3d onto 3D monitor
 */

/* ── Header floats above the 3D hero, doesn't push it down ── */
body:has(.mon3d-hero) [data-elementor-type="header"],
body:has(.mon3d-hero) .elementor-location-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 20 !important;
  pointer-events: auto;
}
/* Account for WP admin bar */
body.admin-bar:has(.mon3d-hero) [data-elementor-type="header"],
body.admin-bar:has(.mon3d-hero) .elementor-location-header {
  top: 32px !important;
}
@media screen and (max-width: 782px) {
  body.admin-bar:has(.mon3d-hero) [data-elementor-type="header"],
  body.admin-bar:has(.mon3d-hero) .elementor-location-header {
    top: 46px !important;
  }
}

/* ── Hero container (scroll space) ── */
.mon3d-hero {
  position: relative;
  height: 200vh;
  background: #060510;
  z-index: 10;
}

/* Hide existing apostrophe 3D */
.mon3d-hero ~ .three-canvas,
body:has(.mon3d-hero) .three-canvas,
body:has(.mon3d-hero) > .scroll-hint,
body:has(.mon3d-hero) > .progress-bar {
  display: none !important;
}

/* ── Sticky viewport ── */
.mon3d-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #060510;
}

/* ── Three.js canvas ── */
.mon3d-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  transition: none;
}

/* ═══════════════════════════════════════════
   CSS ORBS — floating gradient blurs over 3D scene
   ═══════════════════════════════════════════ */
.mon3d-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.mon3d-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  will-change: transform;
}
.mon3d-orb-1 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(234,136,222,.6) 0%, transparent 70%);
  top: 5%;
  left: 2%;
  animation: mon3dOrb1 22s ease-in-out infinite;
}
.mon3d-orb-2 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(193,191,230,.55) 0%, transparent 70%);
  top: 10%;
  right: 2%;
  animation: mon3dOrb2 28s ease-in-out infinite;
}
.mon3d-orb-3 {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(245,176,236,.5) 0%, transparent 70%);
  bottom: 20%;
  left: 15%;
  animation: mon3dOrb3 25s ease-in-out infinite;
}
.mon3d-orb-4 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(176,102,167,.5) 0%, transparent 70%);
  bottom: 10%;
  right: 12%;
  animation: mon3dOrb4 20s ease-in-out infinite;
}

@keyframes mon3dOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, 30px) scale(1.08); }
  50% { transform: translate(-20px, 50px) scale(0.92); }
  75% { transform: translate(30px, -20px) scale(1.05); }
}
@keyframes mon3dOrb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-30px, 40px) scale(1.06); }
  66% { transform: translate(20px, -30px) scale(0.94); }
}
@keyframes mon3dOrb3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(25px, -35px) scale(1.1); }
  50% { transform: translate(-15px, 25px) scale(0.9); }
  75% { transform: translate(35px, 15px) scale(1.04); }
}
@keyframes mon3dOrb4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-20px, -25px) scale(1.08); }
  66% { transform: translate(25px, 20px) scale(0.95); }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
  .ure-monitor3d { min-height: 600px; }
  .ure-monitor3d__screen { transform: scale(0.85); }
}

/* Mobile: smaller orbs */
@media (max-width: 767px) {
  .mon3d-hero { height: 160vh; }
  .mon3d-orb-1 { width: 250px; height: 250px; top: -3%; left: -12%; }
  .mon3d-orb-2 { width: 200px; height: 200px; top: 8%; right: -10%; }
  .mon3d-orb-3 { width: 180px; height: 180px; bottom: 20%; left: 5%; }
  .mon3d-orb-4 { width: 140px; height: 140px; bottom: 8%; right: 5%; }
}

/* ═══════════════════════════════════════════
   CLIPPED — real Elementor section, fixed overlay,
   projected onto 3D monitor via CSS matrix3d
   ═══════════════════════════════════════════ */
.mon3d-clipped {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 12;
  isolation: isolate;
  margin: 0 !important;
  /* Override Elementor padding: physical + logical to win the cascade */
  padding: 0 !important;
  padding-block: 32px 0 !important;
  padding-inline: 16px !important;
  gap: 0 !important;
  transform-origin: 0 0 !important;
  backface-visibility: hidden !important;
  will-change: auto;
  transition: none !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  /* Hidden until JS applies valid matrix3d and adds .mon3d-visible */
  clip-path: inset(100%) !important;
  -webkit-clip-path: inset(100%) !important;
}
.mon3d-clipped.mon3d-visible {
  clip-path: none !important;
  -webkit-clip-path: none !important;
}

/* Hide "Numero fantastico" placeholder title from counter widgets on mon3d pages */
body:has(.mon3d-hero) .elementor-counter-title {
  display: none !important;
}

/* Stat cards: number left, text right on mobile (mon3d pages) */
@media (max-width: 767px) {
  body:has(.mon3d-hero) .e-con.e-child:has(.elementor-widget-counter) > .e-con-inner {
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
  }
  body:has(.mon3d-hero) .e-con.e-child:has(.elementor-widget-counter) .elementor-widget-counter {
    flex-shrink: 0;
    width: auto !important;
  }
  body:has(.mon3d-hero) .e-con.e-child:has(.elementor-widget-counter) .elementor-widget-text-editor {
    flex: 1;
    min-width: 0;
  }
}

/* Override Elementor min-height so section fills exactly 100vh */
.mon3d-clipped,
.mon3d-clipped.e-con {
  min-height: 100vh !important;
  min-height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
}

/* Boxed layout: let inner expand to full width when fullscreen */
.mon3d-clipped.e-con-boxed > .e-con-inner {
  max-width: 100% !important;
}

/* ── Section chromebar (absolute overlay, doesn't affect flex layout) ── */
.mon3d-section-chrome {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 10;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', sans-serif;
  transition: opacity 0.3s;
}

/* Desktop chrome: traffic lights + URL */
.mon3d-sc-dots {
  height: 36px;
  background: #0B0A1A;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 7px;
}
.mon3d-sc-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mon3d-sc-url {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.mon3d-sc-url span {
  color: rgba(255,255,255,.25);
  font-size: 11px;
  white-space: nowrap;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  padding: 3px 20px;
}

/* Mobile chrome: status bar + URL bar */
.mon3d-sc-status {
  height: 44px;
  background: rgba(11,10,26,.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.mon3d-sc-time {
  color: rgba(255,255,255,.6);
  font-size: 15px;
  font-weight: 600;
}
.mon3d-sc-icons {
  display: flex;
  gap: 6px;
  align-items: center;
}
.mon3d-sc-urlbar {
  height: 36px;
  background: rgba(11,10,26,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mon3d-sc-urlbar-inner {
  background: rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 4px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mon3d-sc-urlbar-inner span {
  color: rgba(255,255,255,.3);
  font-size: 12px;
}

/* ── Grid pattern inside firstSection ── */
.mon3d-section-grid {
  position: absolute !important;
  inset: 0 !important;
  background-image:
    linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none !important;
  z-index: 0 !important;
}
@media (max-width: 767px) {
  .mon3d-section-grid {
    background-size: 30px 30px;
  }
}

/* ── Orbs inside firstSection ── */
.mon3d-section-orbs {
  position: absolute !important;
  inset: 0 !important;
  pointer-events: none !important;
  z-index: 0 !important;
  overflow: hidden;
}
.mon3d-sorb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}
.mon3d-sorb-1 {
  width: 35%;
  max-width: 450px;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(234,136,222,.14) 0%, transparent 70%);
  top: -10%;
  left: -8%;
  animation: mon3dOrb1 20s ease-in-out infinite;
}
.mon3d-sorb-2 {
  width: 28%;
  max-width: 350px;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(193,191,230,.1) 0%, transparent 70%);
  top: 8%;
  right: -5%;
  animation: mon3dOrb2 25s ease-in-out infinite;
}
.mon3d-sorb-3 {
  width: 22%;
  max-width: 280px;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(245,176,236,.08) 0%, transparent 70%);
  bottom: 5%;
  left: 15%;
  animation: mon3dOrb3 28s ease-in-out infinite;
}

/* ── Scroll hint ── */
.mon3d-scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  transition: opacity 0.5s;
}
.mon3d-scroll-hint span {
  color: rgba(250,250,250,0.5);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}
.mon3d-scroll-hint svg {
  animation: mon3d-bounce 2s ease-in-out infinite;
}

@keyframes mon3d-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(4px); opacity: 0.3; }
}

/* ── Page content scrolls OVER the fixed section 1 ── */
.mon3d-hero ~ [data-elementor-type="wp-page"],
.mon3d-hero ~ .elementor[data-elementor-id] {
  position: relative;
  z-index: 15;
}

/* ── Screen iframes (projected onto 3D objects via matrix3d) ── */
.mon3d-screen-iframe {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  z-index: 2;
  overflow: hidden;
  backface-visibility: hidden;
  will-change: transform;
  border: none;
  transition: opacity 0.3s;
  background: #060510;
  pointer-events: auto;
}

/* Ensure all sections inside wp-page (except section 1) are positioned for z-stacking */
.mon3d-hero ~ [data-elementor-type="wp-page"] > .elementor-element:not(.mon3d-clipped) {
  position: relative;
  z-index: 1;
}

