/* ---- Variables ---- */
:root {
  --color-bg: #FFFFFF;
  --color-text: #1A1A1A;
  --color-accent: #EF6922;
  --color-muted: #4B5563;
  --color-dark: #1A1A1A;
  --color-surface: #F9FAFB;
  --color-border: #E5E7EB;
  --font: 'Inter', Roboto, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  --transition: 0.3s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--color-text); background: var(--color-bg); line-height: 1.7; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ---- Typography ---- */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; }
h3 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.01em; }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
section[id] { scroll-margin-top: 80px; }
.section-title { text-align: center; margin-bottom: 3rem; color: var(--color-text); }
.section-title::after { content: ''; display: block; width: 40px; height: 3px; background: var(--color-accent); border-radius: 2px; margin: 0.75rem auto 0; }
.section-title span { color: var(--color-accent); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform 0.15s ease, box-shadow var(--transition);
  white-space: nowrap;
  border: 2px solid transparent;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.btn:active { transform: scale(0.97) translateY(0); box-shadow: none; }
.btn-primary { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn-primary:hover { background: #d45a1a; border-color: #d45a1a; }
.btn-white { background: #fff; color: var(--color-accent); border-color: #fff; }
.btn-white:hover { background: transparent; color: #fff; }
.btn-whatsapp { background: #25D366; color: #fff; border-color: #25D366; }
.btn-whatsapp:hover { background: #1ebe5d; border-color: #1ebe5d; }
.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.875rem; }

/* ---- Navbar ---- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--color-bg);
  transition: box-shadow var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow); background: rgba(255,255,255,0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.nav-logo img { height: 56px; width: auto; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { font-weight: 500; font-size: 0.95rem; color: var(--color-text); transition: color var(--transition); }
.nav-links a:not(.btn):hover { color: var(--color-accent); }
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; min-height: 44px; min-width: 44px; justify-content: center; align-items: center; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--color-text); transition: var(--transition); border-radius: 2px; }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Mega dropdown ---- */
.has-dropdown {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.nav-parent {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 100%;
}
.nav-chevron {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.22s ease;
  flex-shrink: 0;
}
.has-dropdown:hover .nav-chevron { transform: rotate(180deg); }
.has-dropdown::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 12px;
  transform: translateY(100%);
  z-index: 300;
}
.nav-megamenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.13), 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  gap: 4px;
  padding: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 300;
  pointer-events: none;
}
.has-dropdown:hover .nav-megamenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.nav-megamenu .nav-dd-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 6px;
  border-radius: 8px;
  color: var(--color-text);
  width: 108px;
  gap: 7px;
  transition: background 0.15s, color 0.15s;
}
.nav-megamenu .nav-dd-card:hover {
  background: var(--color-surface);
  color: var(--color-accent);
}
.nav-megamenu .nav-dd-card img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
}
.nav-megamenu .nav-dd-card span {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
}

/* ---- Hero ---- */
.hero {
  padding: calc(70px + 2.5rem) 0 2.5rem;
}
.hero-inner {
  min-height: 620px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  background:
    linear-gradient(to right, rgba(255,255,255,0.90) 25%, rgba(255,255,255,0.45) 48%, rgba(255,255,255,0) 68%),
    url('../images/Holder.jpg') center / cover no-repeat;
  padding: 4rem 4.5rem;
  border-left: 5px solid var(--color-accent);
  box-shadow: 0 6px 32px rgba(0,0,0,0.12);
}
.hero-content { max-width: 520px; }
.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.hero h1 { color: var(--color-text); margin-bottom: 1.25rem; }
.hero-subtitle { font-size: 1.125rem; color: var(--color-muted); margin-bottom: 2rem; max-width: 460px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; }

/* ---- Products ---- */
.product-list { list-style: none; margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.35rem; }
.product-list li { font-size: 0.875rem; color: var(--color-muted); padding-left: 1rem; position: relative; }
.product-list li::before { content: '•'; position: absolute; left: 0; color: var(--color-accent); font-weight: 700; }
.product-link { color: var(--color-accent); font-weight: 600; font-size: 0.875rem; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1.25rem; border: 2px solid var(--color-accent); border-radius: var(--radius); transition: background var(--transition), color var(--transition); }
.product-link:hover { background: var(--color-accent); color: #fff; }

/* ---- Por qué elegirnos ---- */
.why-us { background: var(--color-surface); overflow: visible; padding: 6rem 0; }
.why-cards {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  padding: 1rem 0 2rem;
}
.why-card {
  position: relative;
  width: 255px;
  height: 360px;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  will-change: transform;
  transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.45s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.why-card:nth-child(1) { transform: rotate(-8deg) translateY(14px); }
.why-card:nth-child(2) { transform: rotate(-4deg) translateY(6px); }
.why-card:nth-child(3) { transform: rotate(0deg) translateY(0px); }
.why-card:nth-child(4) { transform: rotate(4deg) translateY(6px); }
.why-card:nth-child(5) { transform: rotate(8deg) translateY(14px); }
.why-card:hover {
  transform: rotate(0deg) translateY(-12px) scale(1.04);
  box-shadow: 0 20px 48px rgba(0,0,0,0.28);
  z-index: 10;
}
.why-card img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.08); transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1); }
.why-card:hover img { transform: scale(1.0); }
.why-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.45) 55%, rgba(0,0,0,0.15) 100%);
}
.why-card-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1.5rem;
  color: #fff;
}
.why-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.375rem; color: #fff; }
.why-card p { font-size: 0.8125rem; color: rgba(255,255,255,0.78); line-height: 1.55; }

/* ---- Métricas ---- */
.metrics {
  padding: 6rem 0;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 18px,
      rgba(255,255,255,0.03) 18px,
      rgba(255,255,255,0.03) 19px
    ),
    linear-gradient(to right, #EF6922 0%, #c04e16 45%, #3d2820 100%);
}
.metrics .section-title { color: #fff; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; text-align: center; }
.metric-number { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; color: #fff; line-height: 1; }
.metric-label { font-size: 1rem; color: rgba(255,255,255,0.8); margin-top: 0.5rem; }

/* ---- Contacto ---- */
#contacto { background: var(--color-surface); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.contact-items { display: flex; flex-direction: column; gap: 1.5rem; }
.contact-item { display: flex; align-items: center; gap: 1rem; color: inherit; transition: opacity var(--transition); }
a.contact-item:hover { opacity: 0.8; }
.contact-item-icon { width: 48px; height: 48px; background: #FEF0E7; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-item-icon svg { width: 24px; height: 24px; stroke: var(--color-accent); fill: none; stroke-width: 1.5; }
.contact-item-icon.icon-fill svg { fill: var(--color-accent); stroke: none; }
.contact-item-label { font-size: 0.8125rem; color: var(--color-muted); margin-bottom: 0.125rem; }
.contact-item-value { font-size: 1rem; font-weight: 600; color: var(--color-text); }
.map-container { border-radius: var(--radius-lg); overflow: hidden; height: 380px; }
.map-container iframe { width: 100%; height: 100%; border: none; }

/* ---- Footer ---- */
footer { background: #fff; color: var(--color-text); padding: 3rem 0 0; border-top: 1px solid var(--color-border); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; padding-bottom: 2.5rem; }
footer .nav-logo img { height: 50px; }
.footer-about p { font-size: 0.875rem; color: var(--color-muted); margin-top: 1.125rem; line-height: 1.65; max-width: 280px; }
.footer-col-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-muted); margin-bottom: 1.25rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-col ul a { font-size: 0.9375rem; color: var(--color-text); transition: color var(--transition); }
.footer-col ul a:hover { color: var(--color-accent); }
.footer-store-link { color: var(--color-accent) !important; font-weight: 600; }
.footer-contact-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.footer-contact-list li { font-size: 0.875rem; line-height: 1.5; }
.footer-contact-list li a { display: flex; align-items: flex-start; gap: 0.625rem; color: var(--color-muted); transition: color var(--transition); }
.footer-contact-list li a:hover { color: var(--color-accent); }
.footer-contact-list svg { width: 16px; height: 16px; stroke: var(--color-accent); fill: none; stroke-width: 1.5; flex-shrink: 0; margin-top: 2px; }
.footer-bottom { border-top: 1px solid var(--color-border); padding: 1.25rem 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.footer-bottom p { font-size: 0.8125rem; color: var(--color-muted); }
.footer-bottom .footer-credit { font-size: 0.8125rem; color: var(--color-muted); }
.footer-bottom .footer-credit a { color: var(--color-muted); text-decoration: none; transition: color var(--transition); }
.footer-bottom .footer-credit a:hover { color: var(--color-accent); }

/* ---- Product detail pages ---- */
.page-hero { background: var(--color-dark); padding: 8rem 0 5rem; position: relative; overflow: hidden; }
.page-hero::before { content: ''; position: absolute; inset: 0; background: url('../images/Holder.jpg') center / cover no-repeat; opacity: 0.25; }
.page-hero--cctv::before { background-image: url('../images/CCTV.jpg'); }
.page-hero--comunicacion::before { background-image: url('../images/Radiocomunicacion.jpg'); }
.page-hero--alarmas::before { background-image: url('../images/Control.jpg'); }
.page-hero--equipamiento::before { background-image: url('../images/Equipamiento.jpeg'); }
.page-hero--rastreo::before { background-image: url('../images/CCTV/CCTV4.jpg'); }
.page-hero .container { position: relative; }
.breadcrumb { font-size: 0.875rem; font-weight: 500; color: var(--color-accent); margin-bottom: 1rem; display: block; }
.breadcrumb a { color: #9CA3AF; transition: color var(--transition); }
.breadcrumb a:hover { color: #fff; }
.page-hero h1 { color: #fff; margin-bottom: 1rem; }
.page-hero > .container > p { color: #D1D5DB; font-size: 1.125rem; max-width: 600px; }

.detail-block { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; padding: 3.5rem 0; border-bottom: 1px solid var(--color-border); scroll-margin-top: 86px; }
.detail-block:last-child { border-bottom: none; }
.detail-block h3 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--color-text); }
.detail-block .product-list { margin-top: 1rem; }
.detail-block .product-link { margin-top: 1.25rem; display: inline-flex; }
.detail-block img { width: 100%; border-radius: var(--radius-lg); object-fit: cover; aspect-ratio: 4 / 3; }
.detail-block p { font-size: 1rem; line-height: 1.75; color: var(--color-muted); }

.cta-banner {
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 18px,
      rgba(255,255,255,0.03) 18px,
      rgba(255,255,255,0.03) 19px
    ),
    linear-gradient(to right, #EF6922 0%, #c04e16 45%, #3d2820 100%);
  padding: 5rem 0;
  text-align: center;
}
.cta-banner h2 { color: #fff; margin-bottom: 0.75rem; }
.cta-banner > .container > p { color: rgba(255, 255, 255, 0.85); margin-bottom: 2rem; font-size: 1.0625rem; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .why-cards { gap: 0.85rem; flex-wrap: wrap; }
  .why-card { width: 175px; height: 300px; }
}

@media (max-width: 1100px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0; background: var(--color-bg); padding: 1.5rem; box-shadow: var(--shadow); gap: 1.25rem; align-items: flex-start; }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .has-dropdown { align-self: auto; display: block; }
  .nav-parent { height: auto; }
  .nav-chevron { display: none; }
  .has-dropdown::after { display: none; }
  .nav-megamenu { display: none !important; }
}

@media (max-width: 768px) {
  .hero-inner {
    min-height: 480px;
    padding: 3rem 2rem;
    background:
      linear-gradient(to bottom, rgba(255,255,255,0.82) 35%, rgba(255,255,255,0.25) 100%),
      url('../images/Holder.jpg') center / cover no-repeat;
    border-left: none;
    border-top: 5px solid var(--color-accent);
    text-align: center;
  }
  .hero-content { max-width: 100%; }
  .hero-cta { justify-content: center; }
  .hero-subtitle { max-width: 100%; }
  .why-cards { flex-direction: column; align-items: center; }
  .why-card:nth-child(1),
  .why-card:nth-child(2),
  .why-card:nth-child(3),
  .why-card:nth-child(4),
  .why-card:nth-child(5) { transform: none; width: 100%; max-width: 340px; height: 280px; }
  .metrics-grid { grid-template-columns: 1fr; gap: 3rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .detail-block { grid-template-columns: 1fr; gap: 2rem; padding: 4rem 0; }
  .detail-block img { order: -1; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-about p { max-width: 100%; }
  .hero { padding-bottom: 4rem; }
  .btn-sm { min-height: 44px; }
  .product-link { min-height: 44px; }
  .footer-col ul a,
  .footer-contact-list li a { min-height: 44px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .why-card,
  .why-card:nth-child(1),
  .why-card:nth-child(2),
  .why-card:nth-child(3),
  .why-card:nth-child(4),
  .why-card:nth-child(5) { transform: none !important; }
  .why-card:hover { transform: none !important; box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
  .why-card img { transform: none !important; }
}
