/* ==========================================================================
   Eshcol Organic Farm - 3D Product Launch Announcement Popup ("Tradition, Reimagined")
   Production Optimized: High-End Compact Centered Modal over Translucent Blurred Homepage
   Responsive for Desktop, Tablets, Standard Mobile (390-430px) & Small Mobile (320-375px)
   ========================================================================== */

/* 1. Backdrop Overlay: Soft Translucent Dark Veil showing the actual Homepage */
.eshcol-launch-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99995;
  background: rgba(6, 18, 11, 0.62); /* Translucent dark tint, NOT solid color */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.eshcol-launch-backdrop.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 2. 3D Viewport with Proportional Compact Width (Desktop ~680px, Mobile ~92%) */
.eshcol-launch-viewport {
  perspective: 1200px;
  width: 92%;
  max-width: 680px; /* Compact desktop width (within 650-750px range) */
  display: flex;
  justify-content: center;
  margin: auto;
}

/* 3. Cinematic 3D Stage Card: Centered Modal */
.eshcol-launch-stage {
  position: relative;
  width: 100%;
  max-height: calc(100dvh - 48px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 30%), #19442d 0%, #0d291a 45%, #05140b 95%);
  border-radius: 28px;
  border: 1px solid rgba(138, 204, 163, 0.28);
  box-shadow: 
    0 30px 90px -15px rgba(0, 0, 0, 0.75),
    0 0 50px rgba(35, 95, 65, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform-style: preserve-3d;
  will-change: transform;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 26px 26px;
  gap: 12px;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.35s ease;
}

.eshcol-launch-backdrop.is-active .eshcol-launch-stage {
  transform: scale(1);
  opacity: 1;
}

/* Custom minimal scrollbar for stage if content exceeds small mobile height */
.eshcol-launch-stage::-webkit-scrollbar {
  width: 4px;
}
.eshcol-launch-stage::-webkit-scrollbar-track {
  background: transparent;
}
.eshcol-launch-stage::-webkit-scrollbar-thumb {
  background: rgba(138, 204, 163, 0.3);
  border-radius: 4px;
}

/* Dynamic Cursor Spotlight Effect (Desktop) */
.eshcol-launch-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle 380px at var(--mouse-x, 50%) var(--mouse-y, 30%), rgba(116, 198, 157, 0.16), transparent 70%);
  transform: translateZ(15px);
  mix-blend-mode: screen;
  z-index: 1;
}

/* Ambient Floating Botanical Leaves (Background Depth Layer) */
.eshcol-launch-leaves {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: translateZ(25px);
  z-index: 2;
  overflow: hidden;
}

.eshcol-launch-leaf {
  position: absolute;
  color: rgba(138, 204, 163, 0.24);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
}

.eshcol-leaf-1 {
  top: 12%;
  left: 6%;
  width: 38px;
  height: 38px;
  animation: eshcolLeafFloat1 8.5s ease-in-out infinite;
}

.eshcol-leaf-2 {
  bottom: 14%;
  left: 7%;
  width: 30px;
  height: 30px;
  animation: eshcolLeafFloat2 10s ease-in-out infinite 1s;
}

.eshcol-leaf-3 {
  top: 14%;
  right: 7%;
  width: 40px;
  height: 40px;
  animation: eshcolLeafFloat3 11s ease-in-out infinite 0.5s;
}

.eshcol-leaf-4 {
  bottom: 16%;
  right: 7%;
  width: 28px;
  height: 28px;
  animation: eshcolLeafFloat1 9.5s ease-in-out infinite 2s;
}

@keyframes eshcolLeafFloat1 {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(14deg); }
}

@keyframes eshcolLeafFloat2 {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(12px) rotate(-16deg); }
}

@keyframes eshcolLeafFloat3 {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(-12deg); }
}

/* Minimalist Circular Close Button at Top-Right Corner */
.eshcol-launch-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
  transform: translateZ(90px);
  transition: background 0.25s ease, 
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.25s ease, 
              color 0.25s ease,
              box-shadow 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.eshcol-launch-close:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateZ(90px) rotate(90deg) scale(1.08);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.3);
}

.eshcol-launch-close svg {
  width: 16px;
  height: 16px;
}

/* Editorial Header Typography */
.eshcol-launch-header {
  position: relative;
  z-index: 10;
  transform: translateZ(45px);
  transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 520px;
}

.eshcol-launch-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #74c69d;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transform: translateZ(20px);
}

.eshcol-launch-label::before,
.eshcol-launch-label::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #52b788;
  box-shadow: 0 0 6px #52b788;
}

.eshcol-launch-headline {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-transform: uppercase;
  transform: translateZ(40px);
  background: linear-gradient(135deg, #ffffff 45%, #b7e4c7 95%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  margin: 0;
}

.eshcol-launch-subtitle {
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(220, 240, 228, 0.88);
  max-width: 450px;
  transform: translateZ(25px);
  margin: 0;
}

/* Center Dual Floating 3D Showcase Stage */
.eshcol-launch-stage-center {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 245px;
  margin: 2px 0 4px;
  transform: translateZ(75px);
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pedestal Ambient Light Reflection */
.eshcol-launch-pedestal {
  position: absolute;
  bottom: 0px;
  width: 340px;
  height: 48px;
  background: radial-gradient(ellipse at center, rgba(82, 183, 136, 0.48) 0%, rgba(27, 67, 50, 0.2) 55%, transparent 75%);
  border-radius: 50%;
  filter: blur(12px);
  transform: translateZ(10px) rotateX(65deg);
  pointer-events: none;
}

/* Pouch 1: Kanji Mix (Deeper Layer - Left/Center) */
.eshcol-pouch-kanji {
  position: absolute;
  left: calc(50% - 165px);
  top: 5px;
  width: 170px;
  height: 228px;
  transform: translateZ(65px);
  transform-style: preserve-3d;
  animation: eshcolFloatKanji 6s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.eshcol-pouch-kanji:hover {
  transform: translateZ(90px) scale(1.05);
  z-index: 25;
}

/* Pouch 2: Puttu Mix (Foreground Overlapping Layer - Right/Center) */
.eshcol-pouch-puttu {
  position: absolute;
  left: calc(50% - 10px);
  bottom: 5px;
  width: 174px;
  height: 232px;
  transform: translateZ(110px);
  transform-style: preserve-3d;
  animation: eshcolFloatPuttu 5.2s ease-in-out infinite 0.5s;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 20;
}

.eshcol-pouch-puttu:hover {
  transform: translateZ(135px) scale(1.05);
}

@keyframes eshcolFloatKanji {
  0%, 100% { transform: translateZ(65px) translateY(0) rotate(-3.5deg); }
  50% { transform: translateZ(65px) translateY(-12px) rotate(-1deg); }
}

@keyframes eshcolFloatPuttu {
  0%, 100% { transform: translateZ(110px) translateY(0) rotate(3deg); }
  50% { transform: translateZ(110px) translateY(-13px) rotate(0.5deg); }
}

/* Luxury Pouch Tablet Container */
.eshcol-pouch-tablet {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #fbf7f2;
  border: 1.5px solid rgba(220, 195, 140, 0.45);
  box-shadow: 
    0 24px 50px -10px rgba(0, 0, 0, 0.7),
    0 10px 20px -5px rgba(0, 0, 0, 0.4),
    0 0 28px rgba(220, 195, 140, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.eshcol-pouch-tablet img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.eshcol-pouch-tablet:hover img {
  transform: scale(1.03);
}

/* Pouch Floating Badges */
.eshcol-pouch-tag {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 3px 8px;
  background: rgba(14, 38, 25, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 9999px;
  border: 1px solid rgba(138, 204, 163, 0.45);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #95d5b2;
  text-transform: uppercase;
  z-index: 5;
}

.eshcol-pouch-save {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 3px 8px;
  background: linear-gradient(135deg, #c84c17 0%, #a4380c 100%);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 0.62rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.04em;
  z-index: 5;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Editorial Pricing Bar */
.eshcol-launch-pricing {
  position: relative;
  z-index: 10;
  transform: translateZ(50px);
  transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.eshcol-pricing-strip {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 6px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(138, 204, 163, 0.24);
  border-radius: 9999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.eshcol-pricing-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.eshcol-pricing-name {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: #e5f4ec;
  text-transform: uppercase;
}

.eshcol-pricing-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: #52b788;
}

.eshcol-pricing-mrp {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: line-through;
}

.eshcol-pricing-dot {
  color: rgba(138, 204, 163, 0.45);
  font-size: 0.75rem;
}

.eshcol-pricing-subnote {
  font-size: 0.75rem;
  color: rgba(183, 228, 199, 0.75);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0;
}

/* Call To Action Button */
.eshcol-launch-actions {
  position: relative;
  z-index: 10;
  transform: translateZ(75px);
  margin-top: 2px;
}

.eshcol-launch-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 32px;
  min-height: 46px;
  background: linear-gradient(135deg, #2d6a4f 0%, #40916c 45%, #52b788 100%);
  color: #ffffff !important;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 
    0 10px 28px -5px rgba(45, 106, 79, 0.7),
    0 0 20px rgba(82, 183, 136, 0.4);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.25s ease, 
              background 0.25s ease;
  will-change: transform;
}

.eshcol-launch-cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 15px 35px -5px rgba(45, 106, 79, 0.85),
    0 0 35px rgba(82, 183, 136, 0.55);
  background: linear-gradient(135deg, #357a5b 0%, #4ca77c 45%, #64cf9b 100%);
  color: #ffffff !important;
}

.eshcol-launch-cta svg {
  width: 15px;
  height: 15px;
  transition: transform 0.25s ease;
}

.eshcol-launch-cta:hover svg {
  transform: translateX(4px);
}

/* ==========================================================================
   Tablet Responsive Adaptation (769px - 1024px)
   ========================================================================== */
@media (max-width: 1024px) and (min-width: 769px) {
  .eshcol-launch-viewport {
    width: 90%;
    max-width: 640px;
  }
}

/* ==========================================================================
   Mobile Responsive Adaptation (<= 768px, iPhones & Standard Androids 390-430px)
   Compact 92% width modal with visible homepage borders
   ========================================================================== */
@media (max-width: 768px) {
  .eshcol-launch-backdrop {
    padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .eshcol-launch-viewport {
    width: 92%;
    max-width: 440px;
  }
  
  .eshcol-launch-stage {
    padding: 24px 14px 18px;
    gap: 9px;
    border-radius: 24px;
    transform: scale(0.96);
  }

  .eshcol-launch-label {
    font-size: 0.62rem;
    letter-spacing: 0.16em;
  }

  .eshcol-launch-headline {
    font-size: 1.55rem;
    line-height: 1.15;
  }

  .eshcol-launch-subtitle {
    font-size: 0.8rem;
    line-height: 1.35;
    padding: 0 4px;
  }

  .eshcol-launch-stage-center {
    height: 195px;
    max-width: 310px;
    margin: 0;
  }

  .eshcol-launch-pedestal {
    width: 250px;
    height: 38px;
  }

  .eshcol-pouch-kanji {
    left: calc(50% - 130px);
    top: 0;
    width: 130px;
    height: 180px;
  }

  .eshcol-pouch-puttu {
    left: calc(50% - 8px);
    bottom: 0;
    width: 134px;
    height: 184px;
  }

  .eshcol-pouch-tablet {
    border-radius: 16px;
  }

  .eshcol-pricing-strip {
    gap: 12px;
    border-radius: 9999px;
    padding: 5px 12px;
  }

  .eshcol-pricing-name {
    font-size: 0.76rem;
  }

  .eshcol-pricing-val {
    font-size: 0.92rem;
  }

  .eshcol-pricing-mrp {
    font-size: 0.7rem;
  }

  .eshcol-launch-cta {
    width: 100%;
    max-width: 260px;
    padding: 11px 22px;
    font-size: 0.82rem;
  }

  .eshcol-launch-close {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
  .eshcol-launch-close svg {
    width: 15px;
    height: 15px;
  }
}

/* ==========================================================================
   Small Mobile Adaptation (<= 375px, iPhone SE, iPhone 12 mini, Galaxy A)
   ========================================================================== */
@media (max-width: 375px) {
  .eshcol-launch-viewport {
    width: 94%;
  }

  .eshcol-launch-stage {
    padding: 20px 10px 16px;
    gap: 7px;
    border-radius: 20px;
  }

  .eshcol-launch-headline {
    font-size: 1.35rem;
    line-height: 1.1;
  }

  .eshcol-launch-subtitle {
    font-size: 0.75rem;
    line-height: 1.3;
  }

  .eshcol-launch-stage-center {
    height: 165px;
    max-width: 270px;
  }

  .eshcol-launch-pedestal {
    width: 210px;
    height: 30px;
  }

  .eshcol-pouch-kanji {
    left: calc(50% - 110px);
    width: 112px;
    height: 154px;
  }

  .eshcol-pouch-puttu {
    left: calc(50% - 6px);
    width: 116px;
    height: 158px;
  }

  .eshcol-pouch-tag,
  .eshcol-pouch-save {
    padding: 2px 6px;
    font-size: 0.56rem;
    top: 6px;
  }
  .eshcol-pouch-tag { left: 6px; }
  .eshcol-pouch-save { right: 6px; }

  .eshcol-pricing-strip {
    gap: 8px;
    padding: 4px 10px;
  }

  .eshcol-pricing-name {
    font-size: 0.72rem;
  }

  .eshcol-pricing-val {
    font-size: 0.86rem;
  }

  .eshcol-pricing-mrp {
    font-size: 0.66rem;
  }

  .eshcol-pricing-subnote {
    font-size: 0.7rem;
  }

  .eshcol-launch-cta {
    padding: 10px 18px;
    font-size: 0.78rem;
    max-width: 240px;
  }
}

/* ==========================================================================
   Reduced Motion Accessibility (prefers-reduced-motion: reduce)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .eshcol-launch-backdrop,
  .eshcol-launch-stage,
  .eshcol-launch-close,
  .eshcol-launch-cta,
  .eshcol-pouch-kanji,
  .eshcol-pouch-puttu,
  .eshcol-launch-leaf {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transform: none !important;
  }
  .eshcol-launch-backdrop.is-active .eshcol-launch-stage {
    transform: none !important;
  }
}
