:root {
  --primary: #00f0ff;
  --secondary: #012940;
  --bg: #0d0d0d;
  --glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.5);
  --text-color: #f1f1f1;
  --font-main: 'Outfit', sans-serif;
  --font-future: 'Orbitron', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text-color);
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: none;
}

#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: -10;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* --- HEADER & NAVIGATION (ESTRUCTURA DOMINANTE) --- */

.main-header {
  position: sticky;
  top: 0;
  z-index: 99;
  padding: 1rem 0;
}

/* Fila superior del header */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  height: 48px;
  flex-shrink: 0;
}

/* Menú de navegación principal */
.main-nav {
  margin-top: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-glow);
}

.nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 2.5rem;
}

.nav-links a {
  text-decoration: none;
  font-family: var(--font-future);
  color: var(--primary);
  font-weight: 600;
  transition: 0.3s;
  padding: 0.5rem 0;
}

.nav-links a:hover {
  color: #ffffff;
  text-shadow: 0 0 10px var(--primary);
}

.nav-links a[aria-current="page"] {
    color: #ffffff;
    text-shadow: 0 0 10px var(--primary);
}

.menu-toggle {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  z-index: 1001;
  position: relative;
}

/* --- ESTILOS DE CARRITO --- */

.cart-panel-header a.cart-button {
  font-size: 1.8rem;
  text-decoration: none;
  position: relative;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--primary);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  border: 1px solid var(--bg);
}

/* Panel del carrito (para la página cart.html) */
.cart-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glow);
  padding: 1rem;
  border-radius: 10px;
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 999;
}

.hidden { display: none; }
#cartItems { list-style: none; padding-left: 0; }
#cartItems li { margin-bottom: 0.5rem; }


/* --- GENERIC & UTILITY CLASSES --- */
.glass { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--border-glow); border-radius: 20px; box-shadow: 0 0 20px var(--border-glow); transition: all 0.3s ease-in-out; }

.btn-primary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-family: var(--font-future);
    padding: 0.8rem 1.8rem;
    border-radius: 10px;
    font-weight: bold;
    transition: 0.3s ease;
    cursor: pointer;
    white-space: nowrap; 
    text-decoration: none; /* Asegura que no haya subrayado si se usa en un <a> */
    display: inline-block; /* Buen comportamiento por defecto */
}

.btn-primary:hover { background-color: var(--primary); color: var(--bg); box-shadow: 0 0 12px var(--primary); }

/* --- PAGE SECTIONS --- */
.content { padding: 2rem; margin-top: 2rem; }
.hero { text-align: center; padding: 2rem; margin-bottom: 2rem; }
.hero h1 { font-size: 3.5rem; font-family: var(--font-future); text-shadow: 0 0 15px var(--primary); margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; color: #cccccc; margin-bottom: 2.5rem; }

.products-list, .services-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 3rem; }
.product-card, .service-card { background: var(--glass); border: 1px solid var(--border-glow); border-radius: 16px; padding: 2rem; box-shadow: 0 0 10px var(--border-glow); transition: 0.3s; }
.product-card:hover, .service-card:hover { transform: translateY(-5px); box-shadow: 0 0 20px var(--primary); }
.product-card h2, .service-card h2 { font-family: var(--font-future); font-size: 1.5rem; margin-bottom: 1rem; color: var(--primary); }
.product-card p, .service-card p { color: #ccc; }
.product-card img { width: 100%; display: block; border-bottom: 1px solid var(--border-glow); }

.cta { text-align: center; padding: 4rem 2rem; margin-top: 5rem; border: 2px dashed var(--primary); border-radius: 20px; background: rgba(0, 240, 255, 0.05); }
.cta h2 { font-size: 2.2rem; font-family: var(--font-future); color: var(--primary); text-shadow: 0 0 10px var(--primary); margin-bottom: 1rem; }
.cta p { color: #ddd; font-size: 1.1rem; margin-bottom: 2rem; }

/* --- ESTILOS PARA LA PÁGINA DEL CARRITO (cart.html) --- */

.cart-container {
    padding: 1.5rem;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.cart-table th, .cart-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-glow);
}

.cart-table th {
    font-family: var(--font-future);
    color: var(--primary);
    font-size: 1.1rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quantity-controls span {
    min-width: 20px;
    text-align: center;
}

.btn-quantity, .btn-remove {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.btn-remove {
    font-size: 1.5rem;
    border-color: #e60023; /* Rojo para eliminar */
    color: #e60023;
}

.btn-quantity:hover, .btn-remove:hover {
    background: var(--primary);
    color: var(--bg);
}

.btn-remove:hover {
    background: #e60023;
    color: white;
}

.cart-summary {
    max-width: 400px;
    margin-left: auto;
    padding: 1.5rem;
    border: 1px solid var(--border-glow);
    border-radius: 10px;
    background: var(--glass);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.summary-item.total {
    font-family: var(--font-future);
    font-size: 1.4rem;
    color: var(--primary);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glow);
}

.payment-section {
    margin-top: 2rem;
    text-align: center;
}

.payment-section h2 {
    font-family: var(--font-future);
    margin-bottom: 1.5rem;
}

#empty-cart-message {
    text-align: center;
    padding: 4rem 0;
}

#empty-cart-message p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* FORM */
.contact-form { margin-top: 2rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.form-group { display: flex; flex-direction: column; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { margin-bottom: 0.5rem; font-weight: 600; font-size: 1rem; color: var(--primary); }
.form-group input, .form-group textarea { padding: 0.75rem 1rem; border: 1px solid var(--border-glow); border-radius: 10px; background: rgba(255, 255, 255, 0.1); color: var(--text-color); font-size: 1rem; transition: 0.3s; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 8px var(--primary); background-color: rgba(0, 0, 0, 0.2); outline: none; }
.form-msg { margin-top: 1rem; font-size: 0.95rem; color: var(--primary); text-align: center; }

/* FOOTER */
footer { margin-top: 5rem; padding: 2rem 1rem; text-align: center; font-size: 0.9rem; color: #aaa; }
footer.glass { border-radius: 20px 20px 0 0; }
footer a { color: var(--primary); text-decoration: none; }

/* DECORATIVE ELEMENTS */
.holo-rings { position: fixed; top: 50%; left: 50%; width: 300px; height: 300px; margin-left: -150px; margin-top: -150px; border-radius: 50%; z-index: -5; pointer-events: none; }
.holo-ring { position: absolute; width: 100%; height: 100%; border: 2px solid var(--primary); border-radius: 50%; animation: pulseRing 3s infinite ease-out; opacity: 0.6; box-shadow: 0 0 12px var(--primary); }
.holo-ring:nth-child(2) { animation-delay: 1s; }
.holo-ring:nth-child(3) { animation-delay: 2s; }
@keyframes pulseRing { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(2.5); opacity: 0; } }


/* --- ESTILOS PARA LA PÁGINA DE PROYECTOS/VIDEOS --- */

.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.page-header h1 {
  font-size: 3rem;
  font-family: var(--font-future);
  text-shadow: 0 0 15px var(--primary);
  margin-bottom: 0.5rem;
}

.page-header p {
  font-size: 1.1rem;
  color: #cccccc;
  max-width: 600px;
  margin: 0 auto;
}

.video-gallery {
  display: grid;
  /* Elige una de estas dos opciones para las columnas: */
  
  /* Opción 1: Dos columnas en escritorio, una en móvil */
  grid-template-columns: repeat(2, 1fr); 

  /* Opción 2: Columnas que se ajustan automáticamente */
  /* grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); */
  
  gap: 2rem;
}

.video-card {
  padding: 1.5rem;
  transition: 0.3s;
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 20px var(--primary);
}

.video-card h2 {
  font-family: var(--font-future);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.video-card video {
  width: 100%;
  display: block;
  border-radius: 8px; /* Para que las esquinas del video sean redondeadas */
  border: 1px solid var(--border-glow);
}


/* --- RESPONSIVE (Móvil) --- */

@media (max-width: 768px) {
  .header-top {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      width: 100%;
  }

  .logo-link { justify-self: start; }
  .cart-panel-header { justify-self: center; }
  .menu-toggle { justify-self: end; }
  
  .menu-toggle {
      display: block;
  }

  .nav-links {
      position: absolute;
      top: 80px;
      right: 5%;
      width: 90%;
      background: rgba(13, 13, 13, 0.95);
      backdrop-filter: blur(10px);
      flex-direction: column;
      align-items: center;
      padding: 1rem 0;
      border-radius: 10px;
      border: 1px solid var(--border-glow);
      display: none;
      z-index: 1000;
  }
  
  .nav-links.show { /* Corregido para coincidir con tu JS */
      display: flex;
  }
  
  .main-nav {
      border-bottom: none;
      margin-top: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 { font-size: 2.5rem; }

  /* =============================================================== */
  /* == INICIO: CÓDIGO AÑADIDO PARA CORREGIR BOTONES EN SECCIÓN HERO == */
  /* =============================================================== */
  .hero a.btn-primary {
    display: block;          /* Fuerza a cada botón a ocupar una línea para apilarse */
    margin-left: auto;       /* Centra el botón horizontalmente */
    margin-right: auto;      /* Centra el botón horizontalmente */
    margin-bottom: 1rem;     /* Añade un espacio de 16px (típicamente) debajo */
    max-width: 280px;        /* Evita que los botones sean demasiado anchos en la pantalla */
  }

  .hero a.btn-primary:last-child {
    margin-bottom: 0;        /* Elimina el margen inferior del último botón */
  }
  /* =============================================================== */
  /* == FIN: CÓDIGO AÑADIDO                                        == */
  /* =============================================================== */
  .page-header h1 { font-size: 2.2rem; }
  
  .video-gallery {
    grid-template-columns: 1fr; /* Una sola columna en móviles */
  }

}

@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
}

/* --- Estilos para hacer la tabla del carrito responsiva --- */

/* Usamos un media query para aplicar estos estilos solo en pantallas
   de 768px de ancho o menos (tablets y celulares) */
@media screen and (max-width: 768px) {
  .cart-table {
    border: 0;
  }

  .cart-table thead {
    /* Ocultamos los encabezados de la tabla, ya no los necesitamos */
    display: none;
  }

  .cart-table tr {
    /* Hacemos que cada fila se comporte como un bloque separado (una tarjeta) */
    display: block;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
  }

  .cart-table td {
    /* Hacemos que cada celda ocupe todo el ancho y se apile verticalmente */
    display: block;
    text-align: right; /* Alineamos el contenido a la derecha */
    font-size: 16px;
    border-bottom: 1px dotted #ccc;
  }

  .cart-table td:last-child {
    border-bottom: 0;
  }

  /* Usamos un pseudo-elemento ::before para agregar el título de la columna
     como una etiqueta a la izquierda de cada celda */
  .cart-table td::before {
    content: attr(data-label); /* Obtenemos el texto del atributo 'data-label' */
    float: left; /* Lo alineamos a la izquierda */
    font-weight: bold;
    text-transform: uppercase;
  }
}
