/* ─────────────────────────────────────────────────────────────────
   demo.css — styles for the live "Try CARTaja" emulator hero.
   Originally inlined in index.html; extracted so landing.html can
   reuse the same demo block.

   Notes on conflicts with home.css:
   - body / html / a / img / button resets are intentionally OMITTED
     so home.css continues to govern the page chrome around the demo.
   - .nav, .nav-logo, .nav-right, .lang-switch, .lang-toggle,
     .lang-menu, .lb are also OMITTED — pages that use the demo
     keep their own nav and language switcher.
   - .hero, .hero-left, .hero-right, .hero-headline, .hero-sub,
     .eyebrow apply to the demo's new hero only (the previous .hero
     element is replaced wherever this file is used).
   ───────────────────────────────────────────────────────────────── */

/* ── Tokens ── */
:root {
  --bg-main: #0a8a8e;
  --bg-deep: #065e61;
  --bg-darkest: #043a3c;
  --heading-color: #441639;
  --text-primary: #2A3C42;
  --ivory: #F5F1E5;
  --ivory-warm: #EDE8D8;
  --crimson: #441639;
  --crimson-dark: #2D0E26;
  --terracotta: #D76F4B;
  --whatsapp: #25D366;
  --white: #FFFFFF;
  --border-glass: rgba(255,255,255,0.13);
  --glass-bg: rgba(255,255,255,0.07);
}

/* ── Background ──
   Absolute (not fixed) so when used inside a host like landing.html the
   image is bounded to its parent (.demo-stage) and doesn't bleed across
   the page's other sections. On index.html the parent is the body's
   initial containing block, so absolute behaves like fixed visually. */
.page-bg{
  position:absolute;inset:0;z-index:0;
  overflow:hidden;
}
.page-bg::before{
  content:'';position:absolute;inset:0;
  background:url('../assets/cothon-shopping-cart-graphic.jpg') 70% center / cover no-repeat;
}
.page-bg::after{
  content:'';position:absolute;inset:0;
  background:linear-gradient(
    90deg,
    rgba(4,58,60,0.93) 0%,
    rgba(10,138,142,0.85) 30%,
    rgba(10,138,142,0.55) 55%,
    rgba(4,58,60,0.7) 100%
  );
}

/* ── Buttons ── */
.btn-primary-cta{
  padding:12px 22px;border-radius:12px;
  background:var(--ivory);color:var(--heading-color);
  font-size:14px;font-weight:700;letter-spacing:.01em;
  cursor:pointer;transition:all .25s cubic-bezier(.4,0,.2,1);
  border:none;
}
.btn-primary-cta:hover{background:var(--white);transform:translateY(-2px);box-shadow:0 8px 24px rgba(0,0,0,.2)}
.btn-ghost{
  padding:10px 18px;border-radius:10px;
  background:transparent;color:rgba(255,255,255,.85);
  font-size:13px;font-weight:600;
  border:1px solid rgba(255,255,255,.18);
  cursor:pointer;transition:all .2s;
}
.btn-ghost:hover{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.3);color:var(--white)}

/* ── Demo Hero (Two-Zone) ── */
.demo-stage{
  position:relative;z-index:1;
  display:flex;flex-direction:column;
  min-height:100vh;min-height:100dvh;
}
.demo-stage .hero{
  flex:1;display:grid;
  grid-template-columns: minmax(0,1.05fr) minmax(0,420px);
  gap:48px;
  padding:8px 60px 40px;
  align-items:center;
  max-width:1280px;width:100%;margin:0 auto;
}
.demo-stage .hero-left{display:flex;flex-direction:column;gap:18px;min-width:0}
.demo-stage .eyebrow{
  font-size:11px;font-weight:700;letter-spacing:.18em;text-transform:uppercase;
  color:rgba(255,255,255,.55);
}
.demo-stage .hero-headline{
  font-family:'Bricolage Grotesque',sans-serif;
  font-size:clamp(28px,3.6vw,46px);font-weight:400;
  line-height:1.05;letter-spacing:-.02em;
  color:var(--ivory);
}
.demo-stage .hero-headline em{font-style:italic;color:rgba(255,255,255,.6);font-size:.55em;display:block;margin-top:14px;line-height:1.4}
.demo-stage .hero-sub{
  font-size:16px;line-height:1.6;
  color:rgba(255,255,255,.7);
  max-width:520px;
}

/* ── Use-Case Picker ── */
.use-case-picker{
  display:flex;flex-wrap:wrap;gap:8px;
  margin-top:6px;
}
.uc-pill{
  padding:9px 16px;border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  color:rgba(255,255,255,.75);
  font-size:13px;font-weight:600;letter-spacing:.01em;
  cursor:pointer;transition:all .2s;
  white-space:nowrap;
}
.uc-pill:hover{background:rgba(255,255,255,.12);color:var(--white);border-color:rgba(255,255,255,.22)}
.uc-pill.active{
  background:var(--ivory);color:var(--heading-color);
  border-color:var(--ivory);
}
.uc-description{
  font-size:14px;line-height:1.55;
  color:rgba(255,255,255,.6);
  margin-top:4px;
  min-height:42px;
}
.uc-meta{
  font-size:12px;color:rgba(255,255,255,.4);
  display:flex;align-items:center;gap:8px;
  letter-spacing:.02em;
}
.uc-meta i,
.uc-meta .uc-meta-icon{font-size:14px;color:var(--whatsapp);opacity:.85;font-variation-settings:'FILL' 1}

/* ── Hero Actions ── */
.hero-actions{
  display:flex;flex-wrap:wrap;gap:12px;
  margin-top:8px;
}

/* ── Perks ── */
.hero-perks{
  display:flex;flex-wrap:wrap;gap:18px;
  margin-top:14px;padding-top:14px;
  border-top:1px solid rgba(255,255,255,.08);
}
.perk{
  font-size:12px;font-weight:500;
  color:rgba(255,255,255,.5);
  display:flex;align-items:center;gap:6px;
}
.perk::before{
  content:'';width:6px;height:6px;
  border-radius:50%;background:var(--terracotta);
  flex-shrink:0;
}

/* ── Right Zone: Emulator + 3D phone ── */
.demo-stage .hero-right{display:flex;justify-content:center;align-items:center;min-width:0;perspective:1600px}

.iphone-frame{
  position:relative;
  width:390px;height:780px;
  background:#0a0a0a;
  border-radius:55px;
  padding:12px;
  box-sizing:border-box;
  box-shadow:
    0 0 0 2px #222,
    0 30px 60px -15px rgba(0,0,0,.6),
    0 0 120px rgba(30,200,180,.1);
  /* Zoom-in entrance: scales from 10% to 100% while spinning a full turn
     about its vertical axis. Runs once after the page settles. */
  animation:phoneZoomIn 1.4s cubic-bezier(.16,1,.3,1) .5s 1 both;
  transform-style:preserve-3d;
}
@keyframes phoneZoomIn{
  0%   { transform: scale(0.1) rotateY(-360deg); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}
.iphone-frame::before{
  content:"";position:absolute;
  top:22px;left:50%;transform:translateX(-50%);
  width:120px;height:34px;background:#000;border-radius:20px;z-index:10;
}
/* True 3D phone faces — front face = .iphone-frame body + .iphone-screen,
   the four side faces and back form the rest of the slab so the spin
   reads as a real solid box. Hidden after the spin completes (0.5s delay
   + 1.4s duration = 1.9s) — at front-facing rest, the faces are meant to
   project edge-on but Chrome leaves them at sub-pixel sizes when [dir=rtl]
   forces a 3D-context re-evaluation, which paints a visible flat slab
   around the bezel. Hiding them post-animation makes EN/AR identical. */
.face{
  position:absolute;
  pointer-events:none;
  background:linear-gradient(135deg,#1a1a1a,#050505 50%,#0d0d0d);
  animation:hidePhoneFace 0s linear 1.9s 1 forwards;
}
@keyframes hidePhoneFace{ to { visibility: hidden; } }
.face-back{
  inset:0;
  border-radius:55px;
  transform:translateZ(-20px);
  box-shadow:inset 0 0 50px rgba(0,0,0,.6);
}
.face-left{
  top:0;left:0;width:20px;height:100%;
  transform-origin:left center;
  transform:rotateY(90deg);
}
.face-right{
  top:0;right:0;width:20px;height:100%;
  transform-origin:right center;
  transform:rotateY(-90deg);
}
.face-top{
  top:0;left:0;width:100%;height:20px;
  transform-origin:center top;
  transform:rotateX(-90deg);
}
.face-bottom{
  bottom:0;left:0;width:100%;height:20px;
  transform-origin:center bottom;
  transform:rotateX(90deg);
}
.iphone-screen{
  width:100%;height:100%;
  border-radius:43px;overflow:hidden;
  background:#fff;position:relative;
  /* Push the screen ~1px forward in 3D space so it's unambiguously in front
     of the back face, even if the browser's 3D sorting is loose. */
  transform:translateZ(1px);
}
.iphone-status-bar{
  position:absolute;top:0;left:0;right:0;
  height:50px;display:flex;align-items:center;justify-content:space-between;
  padding:0 32px;
  font-size:15px;font-weight:600;color:#111;
  z-index:9;pointer-events:none;
}
.iphone-status-bar .ios-icons{display:flex;align-items:center;gap:6px;font-size:13px}
.iphone-status-bar .ios-icons i,
.iphone-status-bar .ios-icons .material-symbols-outlined{
  opacity:.85;
  font-size:18px;line-height:1;
  font-variation-settings:'FILL' 1, 'wght' 500;
}
.iphone-status-bar .ios-battery{
  width:24px;height:11px;
  border:1px solid rgba(0,0,0,.6);border-radius:3px;
  position:relative;padding:1px;box-sizing:border-box;
}
.iphone-status-bar .ios-battery::after{
  content:"";position:absolute;right:-3px;top:3px;
  width:2px;height:3px;background:rgba(0,0,0,.6);border-radius:0 1px 1px 0;
}
.iphone-status-bar .ios-battery-fill{
  display:block;width:100%;height:100%;
  background:rgb(255,226,59);border-radius:1px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35);
}

#emulator-mount, #emulator-mount .nui-wa-container{
  height:100%;max-width:none;
}
#emulator-mount .nui-wa-container{border-radius:0}
#emulator-mount .nui-wa-header{padding-top:58px}

/* Empty state when emulator can't connect */
.emulator-empty{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  height:100%;padding:60px 32px;text-align:center;
  background:linear-gradient(180deg,#e5ddd5 0%,#d4c8bc 100%);
  color:#2c2c2c;
}
.emulator-empty i,
.emulator-empty .emulator-empty-icon{font-size:48px;color:var(--whatsapp);margin-bottom:16px;opacity:.7}
.emulator-empty h4{font-size:17px;font-weight:600;margin-bottom:8px}
.emulator-empty p{font-size:13px;color:#666;line-height:1.5;max-width:240px}

/* ── Floating CTA Banner ── */
.float-cta{
  position:fixed;left:50%;bottom:24px;transform:translate(-50%,200%);
  display:flex;align-items:center;gap:14px;
  padding:14px 22px;
  background:rgba(4,58,60,.95);
  backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
  border:1px solid rgba(255,255,255,.14);
  border-radius:16px;
  box-shadow:0 16px 40px rgba(0,0,0,.4);
  z-index:40;
  transition:transform .4s cubic-bezier(.16,1,.3,1);
}
.float-cta.show{transform:translate(-50%,0)}
.float-cta-text{font-size:14px;color:var(--ivory);font-weight:500}
.float-cta button{
  padding:8px 18px;border-radius:10px;
  background:var(--ivory);color:var(--heading-color);
  font-size:13px;font-weight:700;
  cursor:pointer;transition:all .2s;
  border:none;
}
.float-cta button:hover{background:var(--white)}
.float-cta-close{
  background:transparent!important;color:rgba(255,255,255,.5)!important;
  padding:4px 8px!important;font-size:18px!important;line-height:1!important;
}
.float-cta-close:hover{color:var(--white)!important}

/* ── Modal Overrides (cartaja look on top of Bootstrap) ── */
.modal-content{
  background:rgba(4,58,60,.95)!important;
  backdrop-filter:blur(30px);-webkit-backdrop-filter:blur(30px);
  border:1px solid rgba(255,255,255,.12)!important;
  border-radius:24px!important;
  color:var(--ivory);
  overflow:hidden;
}
.modal-header{
  border-bottom:1px solid rgba(255,255,255,.08)!important;
  padding:22px 28px 18px!important;
}
.modal-title{
  font-family:'Bricolage Grotesque',sans-serif;font-weight:400!important;
  font-size:22px!important;color:var(--white)!important;
  flex:1;text-align:center;
  margin-left:32px;
}
.modal-body{padding:24px 28px!important}
.modal-footer{display:none!important}
.btn-close{
  filter:invert(1) brightness(1.5)!important;
  opacity:.6!important;transition:opacity .2s;
}
.btn-close:hover{opacity:1!important}

/* ── Waitlist Form (inside modal) ── */
.wl-form{display:flex;flex-direction:column;gap:12px}
.wl-input{
  width:100%;padding:14px 18px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.15);
  border-radius:12px;
  color:var(--white);font-size:15px;font-family:inherit;
  transition:all .25s;outline:none;
}
.wl-input::placeholder{color:rgba(255,255,255,.35)}
.wl-textarea{resize:vertical;min-height:96px;line-height:1.45}
.wl-input:focus{
  border-color:rgba(255,255,255,.35);
  background:rgba(255,255,255,.12);
  box-shadow:0 0 0 3px rgba(255,255,255,.06);
}
[dir=rtl] .wl-input{text-align:right}

.wl-row{display:flex;gap:12px}
.wl-row .wl-input{flex:1;min-width:0}

.wl-phone-wrap{position:relative;flex:1;min-width:0}
.wl-phone-wrap .wl-input{padding-right:36px}
[dir=rtl] .wl-phone-wrap .wl-input{padding-right:18px;padding-left:36px}
.wl-phone-info{
  position:absolute;right:14px;top:50%;transform:translateY(-50%);
  color:rgba(255,255,255,.4);font-size:16px;cursor:pointer;line-height:1;
}
[dir=rtl] .wl-phone-info{right:auto;left:14px}
.wl-phone-tooltip{
  display:none;position:absolute;bottom:calc(100% + 10px);right:0;
  width:240px;padding:10px 14px;
  background:var(--bg-darkest);
  border:1px solid rgba(255,255,255,.15);border-radius:10px;
  color:rgba(255,255,255,.8);font-size:13px;line-height:1.5;
  box-shadow:0 8px 24px rgba(0,0,0,.3);z-index:50;
}
[dir=rtl] .wl-phone-tooltip{right:auto;left:0;text-align:right}
.wl-phone-info:hover .wl-phone-tooltip,
.wl-phone-info:focus .wl-phone-tooltip{display:block}

.wl-combo{position:relative;width:100%}
.wl-combo-input{padding-right:44px!important}
[dir=rtl] .wl-combo-input{padding-right:18px!important;padding-left:44px!important}
.wl-combo-arrow{
  position:absolute;right:18px;top:50%;transform:translateY(-50%);
  pointer-events:none;transition:transform .2s;
}
[dir=rtl] .wl-combo-arrow{right:auto;left:18px}
.wl-combo.open .wl-combo-arrow{transform:translateY(-50%) rotate(180deg)}
.wl-combo-list{
  display:none;position:absolute;left:0;right:0;top:calc(100% + 4px);
  max-height:220px;overflow-y:auto;
  background:var(--bg-darkest);
  border:1px solid rgba(255,255,255,.15);border-radius:12px;
  list-style:none;margin:0;padding:6px 0;z-index:100;
  scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent;
}
.wl-combo-list::-webkit-scrollbar{width:6px}
.wl-combo-list::-webkit-scrollbar-thumb{background:rgba(255,255,255,.2);border-radius:3px}
.wl-combo.open .wl-combo-list{display:block}
.wl-combo-list li{padding:10px 20px;color:var(--white);font-size:14px;cursor:pointer;transition:background .15s}
.wl-combo-list li:hover,.wl-combo-list li.highlighted{background:rgba(255,255,255,.1)}
.wl-combo-list li.no-match{color:rgba(255,255,255,.35);cursor:default}

.wl-btn{
  width:100%;padding:14px 30px;
  background:var(--ivory);color:var(--heading-color);
  border:none;border-radius:12px;
  font-size:15px;font-weight:700;font-family:inherit;
  cursor:pointer;transition:all .3s cubic-bezier(.4,0,.2,1);
  margin-top:6px;letter-spacing:.01em;
}
.wl-btn:hover{background:var(--white);transform:translateY(-2px);box-shadow:0 8px 30px rgba(0,0,0,.2)}
.wl-btn:active{transform:translateY(0)}
.wl-btn:disabled{opacity:.5;transform:none;cursor:wait}

.wl-error{
  display:none;
  background:rgba(215,111,75,.15);
  border:1px solid rgba(215,111,75,.3);
  border-radius:10px;padding:10px 14px;
  font-size:13px;color:var(--terracotta);text-align:center;
}
.wl-error.show{display:block}
.wl-note{
  font-size:12px;color:rgba(255,255,255,.4);margin-top:6px;text-align:center;
}
.wl-note a{color:rgba(255,255,255,.6);text-decoration:underline}

.wl-success{display:none;text-align:center;padding:20px 0}
.wl-success.show{display:block}
.wl-form.hide{display:none}
.wl-check{
  width:64px;height:64px;border-radius:50%;
  background:rgba(37,211,102,.15);
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 18px;
}
.wl-check svg{width:32px;height:32px;color:var(--whatsapp)}
.wl-success h3{font-family:'Bricolage Grotesque',sans-serif;font-size:24px;font-weight:400;color:var(--ivory);margin-bottom:10px}
.wl-success p{font-size:14px;color:rgba(255,255,255,.6);max-width:340px;margin:0 auto;line-height:1.6}

/* ── Responsive ── */
@media (max-width: 1023px){
  .demo-stage .hero{
    grid-template-columns:1fr;
    gap:32px;padding:8px 32px 40px;
  }
  .iphone-frame{width:340px;height:680px}
}
@media (max-width: 640px){
  .demo-stage .hero{padding:24px 0;gap:20px}
  .demo-stage .hero-left{padding:0 20px}
  .use-case-picker{justify-content:center}
  .page-bg::before{display:none}
  .page-bg::after{
    background:linear-gradient(180deg, var(--bg-darkest, #043a3c) 0%, var(--bg-deep, #065e61) 100%);
  }
  .iphone-frame{
    width:100%;height:75vh;height:75dvh;
    border-radius:0;padding:0;box-shadow:none;
  }
  .iphone-frame::before{display:none}
  .iphone-screen{border-radius:0}
  .iphone-status-bar{display:none}
  #emulator-mount .nui-wa-header{padding-top:30px}
  .hero-actions{flex-direction:column}
  .hero-actions .btn-primary-cta,.hero-actions .btn-ghost{width:100%;text-align:center}
  .float-cta{left:12px;right:12px;transform:translateY(200%);bottom:12px;flex-wrap:wrap}
  .float-cta.show{transform:translateY(0)}
}
