/* ═══════════════════════════════════════════
   EMCO FIRE SYSTEMS — CONFIGURATOR CSS
   File: style.css
   Verge3D: body background = transparent
═══════════════════════════════════════════ */

 #preloader-wrapper {
      position: fixed;
      left: 0;
      top: 0;
      width: 100vw;
      height: 100vh;
      background: black; 
      display: flex;   
      align-items: center;
      justify-content: center;
      z-index: 1000;
 }

  #percentage {
         color: white;
 }

  .main-container {
          width: 100%;
          padding: 0px 20px;
          display: flex;
          align-items: center;
          justify-content: center;  
          flex-direction: column;
  }
 
 .main-container img {
          width: clamp(130px, 80%, 400px);
          height: auto;
 }


/* ─── TOKENS ─── */
:root {
  --fire:    #E84C1E;
  --ember:   #F5A623;
  --night:   #0A0C10;
  --panel:   #10141C;
  --card:    #161B27;
  --border:  rgba(255,255,255,0.07);
  --muted:   #4A5568;
  --text:    #E2E8F0;
  --sub:     #8896A5;
  --green:   #22C55E;
  --w:       380px;
  --radius:  12px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: #060810;
  color: var(--text);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* CONFIGURATOR — বামে (HTML এ আগে, flex natural order) */
#configurator {
  width: var(--w);
  min-width: var(--w);
  max-width: var(--w);
  height: 100vh;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  z-index: 50;
  pointer-events: all;
}

/* 3D FRAME — ডানে (HTML এ পরে, flex:1 বাকি জায়গা) */
#frame {
  flex: 1;
  min-width: 0;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: #060810;
  z-index: 1;
}

#my_iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* fire-line top accent */
#configurator::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--fire), var(--ember), var(--fire));
  background-size: 200% 100%;
  animation: fireSlide 3s linear infinite;
  z-index: 10;
}
@keyframes fireSlide {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ─── HEADER ─── */
.hdr {
  padding: 28px 28px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(232,76,30,0.08) 0%, transparent 100%);
}
.hdr-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.hdr-logo svg { flex-shrink: 0; }
.hdr-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--fire);
}
.hdr-sub {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sub);
  font-weight: 500;
}

/* ─── PROGRESS BAR ─── */
.progress-track {
  display: flex;
  gap: 4px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--night);
}
.progress-step {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.4s;
}
.progress-step.done   { background: var(--fire); }
.progress-step.active { background: var(--ember); }

/* ─── SCROLL BODY ─── */
.cfg-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 16px;
}

/* ─── SECTIONS ─── */
.section {
  display: none;
  animation: fadeUp 0.35s ease both;
}
.section.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fire);
  font-weight: 600;
  margin-bottom: 6px;
  font-family: 'DM Mono', monospace;
}
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 8px;
}
.section-desc {
  font-size: 13px;
  color: var(--sub);
  line-height: 1.6;
  margin-bottom: 22px;
}

/* ─── SIZE CARDS ─── */
.size-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.size-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}
.size-card:hover {
  border-color: rgba(232,76,30,0.4);
  transform: translateY(-2px);
}
.size-card.selected {
  border-color: var(--fire);
  background: rgba(232,76,30,0.08);
}
.size-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px; right: 10px;
  font-size: 11px;
  color: var(--fire);
  font-weight: 700;
}
.size-range {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--text);
}
.size-unit {
  font-size: 10px;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}
.size-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: var(--sub);
}
.size-card.selected .size-tag {
  background: rgba(232,76,30,0.15);
  color: var(--ember);
}
.custom-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.custom-note a { color: var(--fire); text-decoration: none; }
.custom-note a:hover { text-decoration: underline; }

/* ─── ROOF / OPTION TILES ─── */
.tile-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.tile {
  flex: 1;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  -webkit-user-select: none;
  user-select: none;
}
.tile:hover { border-color: rgba(232,76,30,0.4); transform: translateY(-2px); }
.tile.selected { border-color: var(--fire); background: rgba(232,76,30,0.08); }
.tile-icon { font-size: 26px; margin-bottom: 6px; }
.tile-name { font-size: 12px; font-weight: 600; color: var(--text); }
.tile-sub  { font-size: 10px; color: var(--sub); margin-top: 2px; }

/* ─── YES / NO ─── */
.yn-row { display: flex; gap: 10px; margin-bottom: 20px; }
.yn-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  -webkit-user-select: none;
  user-select: none;
}
.yn-btn:hover { border-color: rgba(232,76,30,0.4); }
.yn-btn.yes.selected { border-color: var(--green); background: rgba(34,197,94,0.08); color: var(--green); }
.yn-btn.no.selected  { border-color: var(--muted); background: rgba(74,85,104,0.12); color: var(--sub); }

/* ─── ADD-ONS LIST ─── */
.addon-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.addon-item {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-user-select: none;
  user-select: none;
}
.addon-item:hover { border-color: rgba(232,76,30,0.3); }
.addon-item.selected { border-color: var(--fire); background: rgba(232,76,30,0.06); }
.addon-icon { font-size: 24px; flex-shrink: 0; }
.addon-info { flex: 1; }
.addon-name { font-weight: 600; font-size: 14px; }
.addon-desc { font-size: 11px; color: var(--sub); margin-top: 2px; line-height: 1.4; }
.addon-price {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--ember);
  flex-shrink: 0;
}
.addon-check {
  width: 20px; height: 20px;
  border: 2px solid var(--muted);
  border-radius: 5px;
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: #fff;
}
.addon-item.selected .addon-check {
  border-color: var(--fire);
  background: var(--fire);
}
.addon-item.selected .addon-check::after { content: '✓'; }

/* ─── TIER BADGE ─── */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(232,76,30,0.12);
  border: 1px solid rgba(232,76,30,0.3);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ember);
  font-family: 'DM Mono', monospace;
  letter-spacing: 1px;
  margin-bottom: 18px;
}
.tier-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fire);
  animation: pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%,100%{ opacity:1; transform:scale(1); }
  50%    { opacity:0.5; transform:scale(0.8); }
}

/* ─── PRICE DISPLAY ─── */
.price-bar {
  padding: 18px 28px;
  background: var(--night);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.price-label { font-size: 11px; color: var(--sub); text-transform: uppercase; letter-spacing: 1px; }
.price-amount {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  letter-spacing: 2px;
  color: var(--text);
  transition: color 0.3s;
}
.price-amount.bump { animation: priceBump 0.4s ease; }
@keyframes priceBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); color: var(--ember); }
  100% { transform: scale(1); }
}
.price-tier {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: var(--sub);
  margin-top: 2px;
}

/* ─── NAV BUTTONS ─── */
.nav-row {
  display: flex;
  gap: 10px;
  padding: 16px 28px 24px;
  background: var(--night);
}
.btn-back, .btn-next {
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 13px 20px;
  border: none;
  transition: all 0.2s;
}
.btn-back {
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--sub);
  flex-shrink: 0;
}
.btn-back:hover { color: var(--text); border-color: var(--muted); }
.btn-next {
  flex: 1;
  background: var(--fire);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: 0.5px;
}
.btn-next:hover { background: #c73e12; transform: translateY(-1px); }
.btn-next:disabled { background: var(--muted); cursor: not-allowed; transform: none; }

/* ─── SUMMARY ─── */
.summary-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.sum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 10px 14px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.sum-key { color: var(--sub); }
.sum-val { font-weight: 600; color: var(--text); }
.sum-val.highlight { color: var(--ember); font-family: 'DM Mono', monospace; }
.sum-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(232,76,30,0.08);
  border: 1.5px solid var(--fire);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.sum-total-label { font-family: 'Bebas Neue', sans-serif; font-size: 16px; letter-spacing: 2px; }
.sum-total-price { font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: 2px; color: var(--fire); }

/* ─── SIMULATE BUTTON ─── */
.btn-simulate {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #8B1200, var(--fire));
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.btn-simulate::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}
.btn-simulate:hover::before { transform: translateX(100%); }
.btn-simulate:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,76,30,0.4); }

/* ─── DOWNLOAD QUOTA BUTTON ─── */
.btn-download {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #0A3D2E, #0E6B4A);
  border: 1.5px solid #1aad76;
  border-radius: var(--radius);
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.btn-download::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}
.btn-download:hover::before { transform: translateX(100%); }
.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,173,118,0.35);
  border-color: #22c55e;
}
.btn-download:disabled {
  background: var(--muted);
  border-color: transparent;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-dl-icon {
  font-size: 20px;
  font-family: sans-serif;
}

/* PDF generating spinner */
.btn-download.generating {
  background: linear-gradient(135deg, #0A3D2E, #0d5c3e);
  cursor: wait;
}
.btn-download.generating::after {
  content: '';
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-order {
  width: 100%;
  padding: 14px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.btn-order:hover { border-color: var(--fire); color: var(--fire); }

/* ─── SIMULATE OVERLAY ─── */
#sim-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,12,16,0.85);
  z-index: 100;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
#sim-overlay.active { display: flex; }
.sim-status {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  letter-spacing: 4px;
  color: var(--fire);
  text-align: center;
  animation: glow 1s ease-in-out infinite alternate;
}
@keyframes glow {
  from { text-shadow: 0 0 10px rgba(232,76,30,0.5); }
  to   { text-shadow: 0 0 30px rgba(232,76,30,0.9), 0 0 60px rgba(232,76,30,0.4); }
}
.sim-sub {
  font-size: 14px;
  color: var(--sub);
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.sim-bar { width: 300px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.sim-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--fire), var(--ember));
  border-radius: 2px;
  width: 0;
}
.sim-close {
  padding: 12px 28px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  font-size: 14px;
  transition: all 0.2s;
}
.sim-close:hover { border-color: var(--green); color: var(--green); }

/* ─── V3D DEBUG LOG ─── */
#v3d-events {
  position: fixed;
  bottom: 16px; right: 16px;
  width: 260px;
  background: rgba(10,12,16,0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--sub);
  max-height: 120px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}
.ev-line { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.ev-line span { color: var(--fire); }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--fire); border-radius: 2px; }

/* ══════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
══════════════════════════════════════════ */

/* ── TABLET LANDSCAPE (768px – 1024px) ── */
@media (max-width: 1024px) {
  :root { --w: 320px; }

  .section-title { font-size: 22px; }
  .size-range    { font-size: 17px; }
  .price-amount  { font-size: 26px; }
}

/* ── TABLET PORTRAIT (600px – 768px) ── */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    overflow-y: auto;
    height: auto;
  }

  /* Configurator উপরে full width */
  #configurator {
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    height: auto;
    min-height: 60vh;
    border-right: none;
    border-bottom: 2px solid var(--border);
    }

  /* 3D scene নিচে */
  #frame {
    width: 100vw;
    height: 45vh;
    min-height: 300px;
    }

  #my_iframe {
    width: 100%;
    height: 100%;
  }

  .cfg-body { padding: 18px 20px 12px; }
  .hdr      { padding: 18px 20px 14px; }
  .nav-row  { padding: 12px 20px 18px; }
  .price-bar{ padding: 14px 20px; }

  .section-title { font-size: 24px; }
  .price-amount  { font-size: 28px; }
}

/* ── MOBILE (max 600px) ── */
@media (max-width: 600px) {
  body {
    flex-direction: column;
    overflow-y: auto;
    height: auto;
  }

  #configurator {
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    height: auto;
    border-right: none;
    border-bottom: 2px solid var(--border);
    }

  /* Mobile-এ 3D scene configurator-এর নিচে */
  #frame {
    width: 100vw;
    height: 40vh;
    min-height: 260px;
    }

  #my_iframe {
    width: 100%;
    height: 100%;
  }

  /* Compact UI for mobile */
  .cfg-body  { padding: 16px 16px 10px; }
  .hdr       { padding: 16px 16px 12px; }
  .nav-row   { padding: 10px 16px 16px; }
  .price-bar { padding: 12px 16px; }

  .hdr-brand     { font-size: 18px; }
  .section-title { font-size: 22px; }
  .section-desc  { font-size: 12px; margin-bottom: 16px; }
  .price-amount  { font-size: 26px; }

  /* Size cards: 2 column stays but smaller padding */
  .size-card  { padding: 12px 10px; }
  .size-range { font-size: 16px; }

  /* Tiles in a row, smaller */
  .tile       { padding: 10px 6px; }
  .tile-icon  { font-size: 20px; }
  .tile-name  { font-size: 11px; }

  /* Yes/No buttons stack vertically on very small screens */
  .yn-row     { flex-direction: column; gap: 8px; }
  .yn-btn     { padding: 12px; font-size: 13px; }

  /* Addon items compact */
  .addon-item { padding: 10px 12px; gap: 10px; }
  .addon-icon { font-size: 20px; }
  .addon-name { font-size: 13px; }
  .addon-desc { font-size: 10px; }

  .btn-next, .btn-back { padding: 11px 16px; font-size: 13px; }
  .btn-simulate        { font-size: 15px; padding: 13px; }

  /* Summary compact */
  .sum-row    { padding: 8px 12px; font-size: 12px; }

  /* Simulation overlay text smaller */
  .sim-status { font-size: 34px; }
  .sim-bar    { width: 240px; }
}

/* ── SMALL MOBILE (max 380px) ── */
@media (max-width: 380px) {
  .size-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .tile-row  { gap: 5px; }
  .hdr-brand { font-size: 16px; letter-spacing: 2px; }
  .yn-row    { flex-direction: column; }
}
