/* ============================================================================
 * Drop Shop — Bloque C3: Legal, Rastreo y Login Interactivos
 * ========================================================================== */

/* ── 1. LEGAL (#page-legal) ── */
#page-legal .legal-section {
  display: block !important;
  margin-bottom: 56px;
  scroll-margin-top: 120px;
}

#page-legal .legal-section:last-child {
  margin-bottom: 0;
}

#page-legal .legal-content {
  position: relative;
  padding-left: 64px;
}

.legal-beam {
  position: absolute;
  left: 28px;
  top: 48px;
  bottom: 48px;
  width: 2px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  pointer-events: none;
}

.legal-beam-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(180deg, #E11D2E 0%, #8b5cf6 100%);
  border-radius: 999px;
}

.legal-beam-dot {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8b5cf6;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.7);
}

.legal-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  z-index: 9999;
  background: linear-gradient(90deg, #E11D2E 0%, #8b5cf6 100%);
  width: 0;
  opacity: 0;
  display: none;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ── 2. RASTREO (#page-order-tracking) ── */
#tracking-timeline {
  position: relative;
}

.tt-progress {
  position: absolute;
  top: 50px;
  left: 60px;
  right: 60px;
  height: 4px;
  background: rgba(226, 232, 240, 0.8);
  border-radius: 999px;
  z-index: 1;
  pointer-events: none;
}

.tt-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #E11D2E 0%, #8b5cf6 100%);
  border-radius: 999px;
  transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1), height 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

#tracking-timeline .timeline-step {
  z-index: 2;
  position: relative;
}

#tracking-timeline .timeline-connector {
  z-index: 0;
}

@keyframes ttStepIn {
  0% {
    opacity: 0;
    transform: scale(0.88);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── 3. LOGIN (#auth-modal) ── */
#auth-modal {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#auth-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

#auth-modal .modal {
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

#auth-modal.visible .modal {
  transform: scale(1);
  opacity: 1;
}

.auth-tabs {
  position: relative;
  display: flex;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
}

.auth-pill {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  background: #FFFFFF;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1;
}

.auth-tab {
  position: relative;
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  z-index: 2;
  transition: color 0.2s ease;
  text-align: center;
  border-radius: 999px;
}

.auth-tab.active {
  color: var(--ink);
}

.float-field {
  position: relative;
  margin-bottom: 16px;
  text-align: left;
}

.float-field input {
  width: 100%;
  height: 52px;
  padding: 20px 16px 6px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

.float-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(225, 29, 46, 0.12);
  background: #FFFFFF;
}

.float-field label {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 14px;
  color: var(--muted);
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), font-size 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  transform-origin: top left;
}

.float-field input:focus ~ label,
.float-field input:not(:placeholder-shown) ~ label {
  transform: translateY(-8px);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

.float-field input:not(:focus):not(:placeholder-shown) ~ label {
  color: var(--ink-2);
}

.float-field:has(.pw-toggle) input {
  padding-right: 46px;
}

.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s;
  z-index: 3;
}

.pw-toggle:hover {
  color: var(--ink);
}

.eye-open,
.eye-closed {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.auth-switch {
  display: none !important;
}

/* ── 4. RESPONSIVE (MÓVIL < 768px) ── */
@media (max-width: 768px) {
  #page-legal .legal-content {
    padding-left: 20px;
    padding-right: 20px;
  }

  .legal-beam {
    display: none !important;
  }

  #page-legal .legal-sidebar {
    position: static !important;
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--r-md);
    overflow-x: auto;
    margin-bottom: 24px;
  }

  #page-legal .legal-sidebar-title {
    display: none;
  }

  #page-legal .legal-nav {
    flex-direction: row;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  #page-legal .legal-link {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 13px;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
  }

  #page-legal .legal-support-box {
    display: none;
  }

  .tt-progress {
    position: absolute;
    left: 38px;
    top: 40px;
    bottom: 40px;
    right: auto;
    width: 4px;
    height: auto;
  }

  .tt-progress-fill {
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, #E11D2E 0%, #8b5cf6 100%);
  }
}

/* ── 5. PREFERS-REDUCED-MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .auth-pill,
  .tt-progress-fill,
  .legal-progress,
  .legal-beam-fill,
  #auth-modal .modal,
  #tracking-timeline .timeline-step {
    transition: none !important;
    animation: none !important;
  }
}

/* Legal no tenía contenedor: sin esto el texto se sale por los lados */
#page-legal > .section {
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}
/* La barra .tt-progress sustituye a los conectores viejos: se conservan solo como espacio */
#tracking-timeline .timeline-connector,
#tracking-timeline .timeline-connector.active {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
#tracking-timeline .timeline-connector::before,
#tracking-timeline .timeline-connector::after { display: none !important; }
