/* ═══════════════════════════════════════════════════════════════
   MAX DIMENSIONES — additions.css  v3.0
   Loader · Scroll Progress · WhatsApp · Back-to-Top · HIW
   IDs/clases sincronizados con index.html y additions.js
═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────
   LOADING SCREEN  (#loader)
───────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  /* Respect safe-area so content isn't under the notch */
  padding: env(safe-area-inset-top, 0px)
           env(safe-area-inset-right, 0px)
           env(safe-area-inset-bottom, 0px)
           env(safe-area-inset-left, 0px);
  background: #050505;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity .6s ease, visibility .6s ease;
}
#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Scan lines */
.loader-bg-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 2px,
    rgba(255,85,0,.015) 2px, rgba(255,85,0,.015) 4px
  );
  animation: bgScroll 8s linear infinite;
  pointer-events: none;
}
@keyframes bgScroll {
  from { background-position: 0 0; }
  to   { background-position: 0 100px; }
}

/* Corner labels */
.loader-corner {
  position: absolute;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 900;
  font-size: .7rem;
  letter-spacing: 4px;
  color: rgba(255,85,0,.25);
  animation: cornerFade 2s ease-in-out infinite alternate;
}
.loader-corner.tl { top:    calc(2rem + env(safe-area-inset-top,    0px)); left:  calc(2rem + env(safe-area-inset-left,  0px)); }
.loader-corner.tr { top:    calc(2rem + env(safe-area-inset-top,    0px)); right: calc(2rem + env(safe-area-inset-right, 0px)); }
.loader-corner.bl { bottom: calc(2rem + env(safe-area-inset-bottom, 0px)); left:  calc(2rem + env(safe-area-inset-left,  0px)); }
.loader-corner.br { bottom: calc(2rem + env(safe-area-inset-bottom, 0px)); right: calc(2rem + env(safe-area-inset-right, 0px)); }
@keyframes cornerFade { from { opacity: .2; } to { opacity: .7; } }

/* Center content */
.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;
  padding: 0 1.5rem;
}

/* Logo */
.loader-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.8rem;
}
.loader-logo {
  height: 72px;
  width: auto;
  display: block;
  position: relative;
  z-index: 2;
  animation: logoReveal .8s cubic-bezier(.22,1,.36,1) forwards;
  opacity: 0;
  transform: scale(.7) translateY(20px);
}
/* Retina — force crisp render */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .loader-logo { image-rendering: -webkit-optimize-contrast; }
}
@keyframes logoReveal {
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.loader-logo-glow {
  position: absolute;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,85,0,.18) 0%, transparent 70%);
  animation: glowPulse 2s ease-in-out infinite;
  z-index: 1;
}
@keyframes glowPulse {
  0%,100% { transform: scale(1);   opacity: .6; }
  50%     { transform: scale(1.3); opacity: 1;  }
}

/* Tagline */
.loader-tagline {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 5px;
  color: rgba(255,85,0,.6);
  text-transform: uppercase;
  margin-bottom: 2rem;
  animation: fadeUpIn .6s .4s ease forwards;
  opacity: 0;
  transform: translateY(8px);
  text-align: center;
}
@keyframes fadeUpIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Progress bar */
.loader-bar-wrap {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: .65rem;
  animation: fadeUpIn .6s .6s ease forwards;
  opacity: 0;
  transform: translateY(8px);
  width: 100%;
}
.loader-bar {
  flex: 1;
  max-width: 260px;
  height: 2px;
  background: rgba(255,85,0,.12);
  position: relative;
  overflow: visible;
}
.loader-fill {
  height: 100%;
  width: 0%;
  background: #FF5500;
  position: relative;
  transition: width .05s linear;
  box-shadow: 0 0 12px rgba(255,85,0,.9), 0 0 30px rgba(255,85,0,.4);
}
.loader-fill::after {
  content: '';
  position: absolute;
  right: -3px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px #FF5500, 0 0 16px #FF5500;
}
.loader-pct {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: .8rem;
  font-weight: 900;
  color: #FF5500;
  min-width: 3.5ch;
  letter-spacing: 1px;
}

/* Status */
.loader-status {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: .65rem;
  letter-spacing: 4px;
  color: rgba(255,255,255,.2);
  text-transform: uppercase;
  animation: fadeUpIn .6s .7s ease forwards;
  opacity: 0;
  transform: translateY(8px);
  min-height: 1em;
  margin-top: .4rem;
  text-align: center;
}

/* ─────────────────────────────────────────
   SCROLL PROGRESS BAR  (#scrollProgress)
───────────────────────────────────────── */
#scrollProgress {
  position: fixed;
  top: 0; left: 0;
  /* Respect left safe-area on landscape phones */
  left: env(safe-area-inset-left, 0px);
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #FF5500, #ff8c00);
  z-index: 10000;
  transition: width .08s linear;
  /* No glow on mobile — saves paint */
  box-shadow: 0 0 8px rgba(255,85,0,.5);
  pointer-events: none;
}

/* ─────────────────────────────────────────
   WHATSAPP FLOAT  (.whatsapp-float)
   Matches index.html: class="whatsapp-float"
───────────────────────────────────────── */
.whatsapp-float {
  position: fixed;
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  right:  calc(1.75rem + env(safe-area-inset-right,  0px));
  width: 56px; height: 56px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.45);
  z-index: 990;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  /* Minimum 44px touch target */
  min-width: 44px; min-height: 44px;
  /* Pulse animation */
  animation: waPulse 2.5s ease-in-out infinite;
  /* Crisp on Retina */
  -webkit-font-smoothing: antialiased;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37,211,102,.65);
  animation: none;
}
@keyframes waPulse {
  0%,100% { box-shadow: 0 4px 20px rgba(37,211,102,.45); }
  50%     { box-shadow: 0 4px 30px rgba(37,211,102,.7), 0 0 0 10px rgba(37,211,102,.1); }
}
.whatsapp-float:hover .wa-tooltip { opacity: 1; transform: translateX(0); }

.wa-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  background: #111;
  color: #fff;
  font-family: 'Barlow', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  padding: .4rem .8rem;
  border-radius: 4px;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.wa-tooltip::after {
  content: '';
  position: absolute;
  left: 100%; top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #111;
}

/* ─────────────────────────────────────────
   BACK TO TOP  (#backToTop)
   Matches additions.js: getElementById('backToTop')
───────────────────────────────────────── */
#backToTop {
  position: fixed;
  bottom: calc(1.75rem + env(safe-area-inset-bottom, 0px));
  right:  calc(1.75rem + env(safe-area-inset-right,  0px));
  width: 46px; height: 46px;
  /* 44px minimum tap target */
  min-width: 44px; min-height: 44px;
  background: #111;
  border: 1px solid rgba(255,85,0,.3);
  color: #FF5500;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s, background .2s, border-color .2s;
  z-index: 989;
  /* No clip-path on iOS Safari — use border-radius instead */
}
#backToTop.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#backToTop:hover {
  background: #FF5500;
  color: #fff;
  border-color: #FF5500;
}

/* ─────────────────────────────────────────
   HOW IT WORKS SECTION  (.hiw-*)
───────────────────────────────────────── */
.hiw-section {
  padding: 6rem 0;
  background: #0d0d0d;
  position: relative;
  overflow: hidden;
}
.hiw-section::before {
  content: 'HOW';
  position: absolute;
  top: -2rem; left: -2rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(8rem, 20vw, 18rem);
  font-weight: 900;
  color: rgba(255,85,0,.025);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.hiw-header {
  text-align: center;
  margin-bottom: 4rem;
}
.hiw-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.hiw-step {
  flex: 1;
  text-align: center;
  padding: 2rem 1.25rem;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,85,0,.1);
  border-radius: 2px;
  transition: border-color .3s, transform .3s;
  /* Prevent tap flash on iOS */
  -webkit-tap-highlight-color: transparent;
}
.hiw-step:hover { border-color: rgba(255,85,0,.4); transform: translateY(-4px); }

.hiw-connector {
  display: flex;
  align-items: center;
  padding-top: 4rem;
  flex-shrink: 0;
  width: 2.5rem;
}
.hiw-connector span {
  display: block;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, rgba(255,85,0,.2), rgba(255,85,0,.6), rgba(255,85,0,.2));
  position: relative;
}
.hiw-connector span::after {
  content: '►';
  position: absolute;
  right: -10px; top: 50%;
  transform: translateY(-50%);
  color: #FF5500; font-size: .65rem; opacity: .7;
}

.hiw-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 3.5rem; font-weight: 900;
  color: rgba(255,85,0,.1); line-height: 1; margin-bottom: .4rem;
}
.hiw-icon {
  width: 60px; height: 60px;
  background: rgba(255,85,0,.08);
  border: 1px solid rgba(255,85,0,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.1rem;
  color: #FF5500;
  transition: background .3s;
}
.hiw-step:hover .hiw-icon { background: rgba(255,85,0,.2); }
.hiw-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem; font-weight: 900;
  letter-spacing: 2px; text-transform: uppercase;
  color: #fff; margin-bottom: .65rem;
}
.hiw-desc { font-size: .88rem; color: #777; line-height: 1.6; }

/* Mobile */
@media (max-width: 768px) {
  .hiw-steps      { flex-direction: column; gap: 1rem; }
  .hiw-connector  { display: none; }
}
