/* =========================================================
   ElectronicasSanti — Hoja de estilos principal
   ========================================================= */
:root {
  --bg-main: #090d16;
  --bg-alt: #0f1624;
  --bg-card: #131c2e;
  --border-color: #1f2d47;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #00d4ff;
  --primary-dark: #00a3c4;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --danger: #ef4444;
  --success: #10b981;
  --font-sans: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius: 12px;
  --transition: 0.22s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.container {
  width: min(1140px, 92%);
  margin-inline: auto;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.4rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--transition), background-color var(--transition), border-color var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background-color: var(--primary);
  color: #041019;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-accent {
  background-color: var(--accent);
  color: #160d02;
}

.btn-accent:hover {
  background-color: var(--accent-dark);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Header y Logotipo Transparente */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 46px;
  width: auto;
  display: block;
  transition: transform var(--transition), filter var(--transition);
}

.brand:hover .brand-logo {
  transform: scale(1.03);
  filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.35));
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-menu a:not(.btn) {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-menu a:not(.btn):hover {
  color: var(--primary);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
}

/* Hero con patrón sutil tipo PCB */
.hero {
  padding: 5.5rem 0 4.5rem;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(0, 212, 255, 0.12), transparent 45%),
    linear-gradient(rgba(31, 45, 71, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 45, 71, 0.25) 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px, 36px 36px;
  border-bottom: 1px solid var(--border-color);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.tech-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.25);
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.25rem);
  line-height: 1.15;
  margin-bottom: 1.2rem;
}

.text-accent {
  color: var(--primary);
}

.hero-lead {
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 58ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  gap: 2.2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.stat-item dt {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stat-item dd {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Tarjeta técnica lateral */
.hero-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.card-header-mono {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  background-color: #0b111e;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.spec-list {
  list-style: none;
  padding: 1.4rem;
  display: grid;
  gap: 1.2rem;
}

.spec-list li {
  padding-left: 0.9rem;
  border-left: 2px solid var(--primary);
}

.spec-list strong {
  display: block;
  margin-bottom: 0.2rem;
}

.spec-list span {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Secciones generales */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-head {
  max-width: 640px;
  margin-bottom: 2.5rem;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin-bottom: 0.6rem;
}

.section-head p {
  color: var(--text-muted);
}

/* Grid de cursos y videos */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 1.5rem;
}

.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform var(--transition), border-color var(--transition);
}

.course-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 212, 255, 0.45);
}

.course-card.featured {
  border-color: var(--accent);
}

.course-badge {
  position: absolute;
  top: -12px;
  right: 1.25rem;
  background-color: var(--accent);
  color: #160d02;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

.course-level {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.course-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.course-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.course-features {
  list-style: none;
  margin-bottom: 1.6rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.9rem;
  flex-grow: 1;
}

.course-features li::before {
  content: "✓ ";
  color: var(--primary);
  font-weight: 700;
}

/* Controles de Videoteca */
.library-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  background-color: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background-color: rgba(0, 212, 255, 0.14);
  color: var(--primary);
  border-color: var(--primary);
}

.search-box input {
  width: min(320px, 100%);
  padding: 0.62rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-sans);
}

/* Tarjetas de video */
.video-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition);
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: #070a12;
  overflow: hidden;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(9, 13, 22, 0.88);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
}

.video-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.video-cat {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.video-body h3 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.video-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  flex-grow: 1;
}

.empty-state {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px dashed var(--border-color);
}

/* Herramientas */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.5rem;
}

.tool-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.6rem;
}

.tool-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
}

.tool-item h3 {
  margin-bottom: 0.6rem;
  font-size: 1.15rem;
}

.tool-item p {
  color: var(--text-muted);
  font-size: 0.93rem;
}

/* Contacto */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3rem;
  align-items: start;
}

.contact-info p {
  color: var(--text-muted);
  margin: 0.8rem 0 1.5rem;
}

.social-links {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.social-links a {
  color: var(--primary);
  text-decoration: none;
}

.social-links a:hover {
  text-decoration: underline;
}

.contact-form {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.form-group input.is-invalid,
.form-group textarea.is-invalid {
  border-color: var(--danger);
}

.error-msg {
  display: block;
  color: var(--danger);
  font-size: 0.8rem;
  min-height: 1.1em;
  margin-top: 0.25rem;
}

.form-status {
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

.form-status.success {
  color: var(--success);
}

/* Footer */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.footer-logo {
  height: 36px;
  width: auto;
  display: block;
}

.footer-inner a {
  color: var(--primary);
  text-decoration: none;
}

/* Modal Nativo */
.video-modal {
  margin: auto;
  width: min(860px, 94%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 0;
}

.video-modal::backdrop {
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(4px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.close-modal:hover {
  color: var(--text-main);
}

.video-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  text-align: right;
  font-size: 0.88rem;
}

.modal-footer a {
  color: var(--primary);
  text-decoration: none;
}

/* Responsive móvil */
@media (max-width: 860px) {
  .hero-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 4%;
    display: none;
  }

  .nav-menu.is-open {
    display: flex;
  }
}

@media (max-width: 420px) {
  .brand-logo {
    height: 36px;
  }
}
