/* ── RESET & VARIABLES ── */
:root {
  --black: #0a0a0a;
  --white: #f8f8f6;
  --gray-light: #e8e8e6;
  --gray-mid: #a0a0a0;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--white); color: var(--black); font-family: 'DM Sans', sans-serif; overflow-x: hidden; }

/* ── NAV ── */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 200; display: flex; align-items: center; justify-content: space-between; padding: 20px 52px; background: rgba(248,248,246,0.9); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(0,0,0,0.07); }
.nav-logo { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; font-weight: 600; letter-spacing: 0.2em; color: var(--black); text-decoration: none; }
.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links a { font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--black); text-decoration: none; opacity: 0.55; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }

/* ── HERO ── */
#hero { position: relative; height: 100vh; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#model-viewer { position: relative; z-index: 2; width: 520px; height: 420px; }
.model-msg { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; pointer-events: none; }
.model-msg .spinner { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #ddd; border-top-color: var(--black); animation: spin .85s linear infinite; }
.model-msg p { font-size: 0.76rem; color: var(--gray-mid); text-align: center; padding: 0 20px; }
.hero-hint { position: relative; z-index: 2; margin-top: 6px; font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gray-mid); display: flex; align-items: center; gap: 7px; }
.hero-hint svg { width: 14px; height: 14px; }
.btn-probar { position: relative; z-index: 2; margin-top: 26px; background: var(--black); color: var(--white); border: none; cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; padding: 16px 44px; border-radius: 50px; display: flex; align-items: center; gap: 10px; transition: transform .2s, box-shadow .2s; }
.btn-probar:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0,0,0,0.18); }

/* ── SECTIONS ── */
.section-inner { max-width: 1080px; margin: 0 auto; padding: 96px 48px; }
.step-pill { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--black); font-size: 0.7rem; margin-bottom: 18px; }
.section-title { font-family: 'Cormorant Garamond', serif; font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 400; line-height: 1.08; margin-bottom: 14px; }
.section-sub { color: #666; font-size: 0.92rem; line-height: 1.65; max-width: 440px; }

/* ── CAMERA ── */
.camera-layout { display: grid; grid-template-columns: 210px 1fr; gap: 26px; margin-top: 36px; align-items: start; }
.camera-tips { background: var(--white); border: 1px solid var(--gray-light); border-radius: 18px; padding: 26px 20px; display: flex; flex-direction: column; gap: 22px; }
.tip-header { display: flex; align-items: center; gap: 9px; font-size: 0.8rem; font-weight: 500; margin-bottom: 5px; }
.tip-header svg { width: 18px; height: 18px; flex-shrink: 0; }
.tip p { font-size: 0.74rem; color: #999; line-height: 1.55; padding-left: 27px; }
.camera-box { background: #e5e5e3; border-radius: 20px; overflow: hidden; aspect-ratio: 4/3; position: relative; display: flex; align-items: center; justify-content: center; }
#video-feed { width: 100%; height: 100%; object-fit: cover; display: none; transform: scaleX(-1); }
.cam-placeholder { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #bbb; }
.cam-placeholder svg { width: 46px; height: 46px; }
.cam-placeholder p { font-size: 0.8rem; }
.cam-btn-row { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; align-items: center; }
#btn-activate { background: var(--white); color: var(--black); border: 1px solid var(--black); border-radius: 50px; padding: 12px 26px; font-family: 'DM Sans', sans-serif; font-size: 0.78rem; letter-spacing: 0.1em; cursor: pointer; transition: background .2s, color .2s; white-space: nowrap; }
#btn-activate:hover { background: var(--black); color: var(--white); }
#btn-shoot { width: 58px; height: 58px; border-radius: 50%; background: var(--white); border: 3px solid var(--black); display: none; cursor: pointer; align-items: center; justify-content: center; transition: transform .15s; }
#btn-shoot:hover { transform: scale(1.07); }
#btn-shoot svg { width: 22px; height: 22px; }
.privacy-note { margin-top: 14px; text-align: center; font-size: 0.7rem; color: var(--gray-mid); display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ── RESULT ── */
#result-section { display: none; background: #f0f0ee; }
.result-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; margin-top: 50px; align-items: start; }
.result-img-wrap { border-radius: 22px; overflow: hidden; aspect-ratio: 3/4; background: #ddd; position: relative; display: flex; align-items: center; justify-content: center; }
#result-img { width: 100%; height: 100%; object-fit: cover; display: none; }
.loading-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #e0e0de; border-radius: 22px; }
.loading-overlay .spinner { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #ccc; border-top-color: var(--black); animation: spin .85s linear infinite; }
.load-title { font-size: 0.82rem; color: #555; font-weight: 500; }
.loading-steps { display: flex; flex-direction: column; gap: 8px; }
.load-step { font-size: 0.72rem; color: #ccc; display: flex; align-items: center; gap: 8px; transition: color .3s; }
.load-step.active { color: #444; }
.load-step.done { color: #bbb; text-decoration: line-through; }
.load-dot { width: 6px; height: 6px; border-radius: 50%; background: #ddd; flex-shrink: 0; transition: background .3s; }
.load-step.active .load-dot { background: var(--black); }
.load-step.done .load-dot { background: #ccc; }
.load-eta { font-size: 0.68rem; color: #aaa; text-align: center; }
.error-box { display: none; position: absolute; inset: 0; padding: 24px; background: #fff5f5; border-radius: 22px; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.error-box svg { width: 36px; height: 36px; }
.error-box p { font-size: 0.82rem; color: #c00; line-height: 1.6; }
.error-box small { font-size: 0.72rem; color: #e88; }
.result-card { background: var(--white); border: 1px solid var(--gray-light); border-radius: 24px; padding: 38px 34px; display: flex; flex-direction: column; gap: 22px; }
.piropo-label { font-size: 0.63rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gray-mid); display: flex; align-items: center; gap: 6px; }
.piropo-label svg { width: 11px; height: 11px; }
#piropo-text { font-family: 'Cormorant Garamond', serif; font-size: 1.85rem; font-weight: 400; line-height: 1.22; min-height: 60px; }
.btn-whatsapp { background: var(--black); color: var(--white); border: none; cursor: pointer; border-radius: 50px; font-family: 'DM Sans', sans-serif; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 17px 28px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform .2s, box-shadow .2s; text-decoration: none; }
.btn-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,0.22); }
.trust-row { display: flex; justify-content: space-around; padding-top: 8px; border-top: 1px solid var(--gray-light); }
.trust-item { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 0.68rem; color: #aaa; text-align: center; }
.trust-item svg { width: 18px; height: 18px; }
.btn-retry { background: none; border: 1px solid #ccc; color: #999; border-radius: 50px; padding: 10px 24px; font-family: 'DM Sans', sans-serif; font-size: 0.74rem; cursor: pointer; transition: border-color .2s, color .2s; }
.btn-retry:hover { border-color: var(--black); color: var(--black); }

/* ── FOOTER ── */
footer { background: var(--black); color: var(--white); padding: 60px 52px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-logo { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; letter-spacing: 0.2em; margin-bottom: 8px; }
.footer-brand p { font-size: 0.78rem; color: #666; }
.footer-col h4 { font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: #555; margin-bottom: 14px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col ul a { font-size: 0.8rem; color: #888; text-decoration: none; transition: color .2s; }
.footer-col ul a:hover { color: var(--white); }
.social-row { display: flex; gap: 12px; margin-top: 4px; }
.social-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #2a2a2a; display: flex; align-items: center; justify-content: center; text-decoration: none; color: #777; transition: border-color .2s, background .2s, color .2s; }
.social-btn:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.05); }
.social-btn svg { width: 14px; height: 14px; }
.footer-bottom { border-top: 1px solid #1a1a1a; padding-top: 22px; font-size: 0.7rem; color: #444; text-align: center; }

/* ── UTILS ── */
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { opacity: 0; transform: translateY(22px); transition: opacity .65s ease, transform .65s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav { padding: 16px 22px; }
  .nav-links { display: none; }
  .section-inner { padding: 64px 22px; }
  #model-viewer { width: 320px; height: 280px; }
  .camera-layout { grid-template-columns: 1fr; }
  .camera-tips { display: none; }
  .result-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  footer { padding: 40px 22px 22px; }
}