/* ============================================
   Haddad GPS - Estilos personalizados premium
   Complementan Tailwind CSS (CDN) y AOS.
============================================ */

:root {
  --primary:       #ff8a00;
  --primary-dark:  #e67600;
  --primary-light: #ffb347;
  --dark:          #111111;
  --dark-soft:     #1f1f1f;
  --gray:          #2b2b2b;
  --light:         #ffffff;
  --muted:         #f5f5f5;
  --whatsapp:      #25D366;
}

/* ----- Reset / base ----- */
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', 'Inter', sans-serif;
  background-color: var(--dark);
  color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----- Scrollbar ----- */
::-webkit-scrollbar       { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--dark-soft); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--primary-light), var(--primary-dark)); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ----- Selección ----- */
::selection { background: var(--primary); color: var(--dark); }

/* ----- Header al hacer scroll ----- */
#site-header.scrolled {
  background-color: rgba(17, 17, 17, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  border-bottom-color: rgba(255, 138, 0, 0.18);
}

/* ----- Patrón de cuadrícula tecnológico ----- */
.hero-grid {
  background-image:
    linear-gradient(rgba(255, 138, 0, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 138, 0, 0.08) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

/* ----- Capa de ruido (premium) ----- */
.noise {
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.6'/></svg>");
  opacity: 0.04;
  mix-blend-mode: overlay;
}

/* ----- Animaciones flotantes ----- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
.animate-float        { animation: float 4s ease-in-out infinite; }
.animate-float-delay  { animation: float 4s ease-in-out infinite; animation-delay: 1.5s; }

/* ----- Marquee premium ----- */
.marquee {
  position: relative;
  overflow: hidden;
}
.marquee-track {
  display: inline-flex;
  animation: marquee 45s linear infinite;
  will-change: transform;
  padding-left: 0.5rem;
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee:hover .marquee-track { animation-play-state: paused; }

@media (max-width: 640px) {
  .marquee-track { animation-duration: 30s; }
}

/* Pills de servicios */
.service-pill {
  transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}
.service-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -10px rgba(255, 138, 0, 0.4);
}

/* ----- Tilt effect (hover sutil) ----- */
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(.2,.8,.2,1);
}
.tilt:hover { transform: perspective(900px) translateY(-6px) rotateX(2deg); }

/* ----- Cards hover comunes ----- */
.benefit-card,
.service-card {
  transition: transform 0.45s ease, border-color 0.35s ease, box-shadow 0.45s ease;
}
.benefit-card:hover {
  box-shadow: 0 25px 70px -20px rgba(255, 138, 0, 0.25);
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 80px -25px rgba(255, 138, 0, 0.3);
}

/* ----- Inputs ----- */
.form-input::placeholder { color: rgba(255, 255, 255, 0.35); }
.form-input:focus        { background-color: #181818; }

/* ----- FAQ ----- */
.faq-item.active .faq-icon         { background-color: var(--primary); color: var(--dark); transform: rotate(45deg); }
.faq-item.active .faq-content      { max-height: 320px; }
.faq-item.active                   { border-color: rgba(255, 138, 0, 0.4); box-shadow: 0 10px 30px -10px rgba(255, 138, 0, 0.15); }

/* ----- Galería ----- */
.gallery-item.is-hidden            { display: none; }
.gallery-filter.active             { background-color: var(--primary); color: var(--dark); border-color: var(--primary); }

/* ----- Botón volver arriba ----- */
#back-to-top.show                  { display: flex; }

/* ----- Selectores select ----- */
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ff8a00' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px;
  padding-right: 2.5rem;
}

/* ----- Nav link (legacy underline style) ----- */
.nav-link {
  position: relative;
  padding-bottom: 5px;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 2px;
  transition: width 0.35s ease;
}
.nav-link:hover::after { width: 100%; }

/* ----- Nav pill (header premium) ----- */
.nav-pill {
  position: relative;
  white-space: nowrap;
}
.nav-pill::before {
  content: '';
  position: absolute;
  inset: auto 25% 6px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 2px;
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.nav-pill:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

/* ----- Dropdowns mega-menu ----- */
.dropdown { position: relative; }
.dropdown-menu {
  transform: translate(-50%, 8px);
  pointer-events: none;
  z-index: 60;
}
.dropdown:hover > .dropdown-menu,
.dropdown.is-open > .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.dropdown:hover .dropdown-arrow,
.dropdown.is-open .dropdown-arrow {
  transform: rotate(180deg);
  color: var(--primary);
}

/* Bridge invisible para que no se cierre al pasar el mouse */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 12px;
}

/* Items del mega menu */
.mega-item:hover { transform: translateX(2px); }

/* ----- Mobile slide-in panel ----- */
#mobile-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
#mobile-menu.is-open {
  transform: translateX(0);
  box-shadow: -20px 0 60px -20px rgba(0,0,0,0.6);
}

/* ----- Mobile accordion ----- */
.mobile-accordion.is-open .mobile-acc-content { max-height: 400px; padding-top: 4px; padding-bottom: 8px; }
.mobile-accordion.is-open .mobile-acc-toggle  { background-color: rgba(255,138,0,0.08); color: var(--primary); }
.mobile-accordion.is-open .mobile-acc-toggle .fa-chevron-down { transform: rotate(180deg); color: var(--primary); }

/* ----- WhatsApp flotante ----- */
#float-whatsapp:hover span:first-child {
  opacity: 1;
  transform: translateX(-4px);
}

/* ----- Partículas hero ----- */
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  animation: particleUp 8s linear infinite;
  box-shadow: 0 0 12px var(--primary);
}
@keyframes particleUp {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.6; }
  100% { transform: translateY(-10vh) scale(1.2); opacity: 0; }
}

/* ----- Focus accesible ----- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ----- Botones generales ----- */
button, a { transition: all 0.25s ease; }

/* ----- Gradient text utility ----- */
.text-gradient-orange {
  background: linear-gradient(135deg, var(--primary-light), var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ----- Media queries para tipografía responsive ----- */
@media (max-width: 640px) {
  h1, h2 { letter-spacing: -0.02em; }
  .hero-grid { background-size: 40px 40px; }
}

/* ----- Print ----- */
@media print {
  #site-header, footer, #float-whatsapp, #back-to-top { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ----- Prose para páginas legales ----- */
.prose-haddad {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  line-height: 1.75;
}
.prose-haddad .lead {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.prose-haddad h2 {
  color: #fff;
  font-family: 'Urbanist', 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.prose-haddad h2::before {
  content: '';
  width: 6px;
  height: 1.5rem;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  border-radius: 3px;
}
.prose-haddad h3 {
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}
.prose-haddad p {
  margin-bottom: 1rem;
}
.prose-haddad ul, .prose-haddad ol {
  margin: 1rem 0 1.5rem;
  padding-left: 0;
  list-style: none;
}
.prose-haddad ul li, .prose-haddad ol li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.5rem;
}
.prose-haddad ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
}
.prose-haddad ol {
  counter-reset: item;
}
.prose-haddad ol li {
  counter-increment: item;
}
.prose-haddad ol li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0.1rem;
  font-weight: 800;
  color: var(--primary);
  font-size: 0.9rem;
}
.prose-haddad strong { color: #fff; font-weight: 700; }
.prose-haddad a { color: var(--primary); text-decoration: underline; }
.prose-haddad a:hover { color: var(--primary-light); }

/* ----- Reduce motion ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .marquee-track { animation: none; }
}
