/* ===================== CONFIGURACIÓN & VARIABLES ===================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
  /* Paleta de Colores: Dark Tech Premium */
  --bg-body: #0a0a0a;
  --bg-card: #141414;
  --primary-gold: #d7b276;       /* Tu color dorado original */
  --primary-gold-alt: #bca06b;
  --text-white: #ffffff;
  --text-gray: #a1a1a1;
  
  /* Gradientes y efectos */
  --gradient-gold: linear-gradient(135deg, #d7b276 0%, #a68446 100%);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  
  /* Layout */
  --header-height: 4rem;
}

/* ===================== RESET GLOBAL ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-white);
  line-height: 1.6;
}

a { text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; height: auto; }

/* ===================== CLASES UTILITARIAS ===================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 3rem;
  color: var(--primary-gold);
}

.section-title.center { text-align: center; }

/* ===================== HEADER & NAV ===================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.navbar {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  width: 50px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-white);
  font-weight: 500;
  transition: color 0.3s;
}

.nav-link:hover {
  color: var(--primary-gold);
}

/* Botón Login Especial */
.btn-login {
  background: var(--glass-bg);
  border: var(--glass-border);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  color: var(--primary-gold);
  transition: 0.3s;
}

.btn-login:hover {
  background: var(--primary-gold);
  color: #000;
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 1.5rem;
  cursor: pointer;
}

.menu-toggle { display: none; }

/* ===================== HERO SECTION ===================== */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding-top: var(--header-height);
  gap: 2rem;
}

.hero-text .badge {
  background: rgba(215, 178, 118, 0.2);
  color: var(--primary-gold);
  padding: 0.3rem 0.8rem;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.hero-text h1 {
  font-size: 3.5rem;
  line-height: 1.2;
  margin: 1rem 0;
}

.text-gradient {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-text p {
  color: var(--text-gray);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.btn-primary {
  background: var(--gradient-gold);
  color: #000;
  padding: 0.8rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.3s;
}

.btn-secondary {
  background: transparent;
  color: var(--text-white);
  border: 1px solid var(--text-gray);
  padding: 0.8rem 2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}

.btn-primary:hover, .btn-secondary:hover {
  transform: translateY(-3px);
}

/* Animación de la tarjeta flotando */
.hero-img {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-img img {
  max-width: 80%;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 10px 20px rgba(215, 178, 118, 0.3));
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0px); }
}

/* ===================== SECCIÓN NOSOTROS ===================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.stats {
  display: flex;
  gap: 3rem;
  margin-top: 2rem;
}

.stat-item h3 {
  font-size: 2rem;
  color: var(--primary-gold);
}

.stat-item p {
  font-size: 0.9rem;
  color: var(--text-gray);
}

/* ===================== FEATURES (WHY CHOOSE US) ===================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 12px;
  border: var(--glass-border);
  text-align: center;
  transition: 0.3s;
}

.feature-card:hover {
  background: #1a1a1a;
  transform: translateY(-5px);
  border-color: var(--primary-gold);
}

.icon-box {
  font-size: 2.5rem;
  color: var(--primary-gold);
  margin-bottom: 1rem;
}

/* ===================== PRODUCTOS ===================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.product-card {
  background: var(--bg-card);
  border-radius: 15px;
  overflow: hidden;
  border: var(--glass-border);
  transition: 0.3s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.card-header {
  padding: 2rem;
  background: radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, transparent 70%);
  text-align: center;
}

.card-header img {
  height: 150px;
  object-fit: contain;
  transition: 0.3s;
}

.product-card:hover .card-header img {
  transform: scale(1.1);
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-body h3 {
  font-size: 1.25rem;
}

.description {
  color: var(--text-gray);
  font-size: 0.9rem;
  flex-grow: 1;
}

.price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-gold);
  margin: 0.5rem 0;
}

.btn-add {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-white);
  padding: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: 0.2s;
}

.btn-add:hover {
  background: var(--primary-gold);
  color: #000;
}

.link-detail {
  display: block;
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-gray);
  text-decoration: underline;
}

/* ===================== FOOTER ===================== */
.footer {
  background: #050505;
  padding: 4rem 0 2rem;
  margin-top: 4rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-logo { width: 60px; margin-bottom: 1rem; }

.footer-links h4, .footer-social h4 {
  color: var(--text-white);
  margin-bottom: 1rem;
}

.footer-links ul li { margin-bottom: 0.5rem; }
.footer-links a { color: var(--text-gray); font-size: 0.9rem; }
.footer-links a:hover { color: var(--primary-gold); }

.footer-social a {
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-copy {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  color: #555;
  font-size: 0.8rem;
}

/* ===================== CARRITO PANEL ===================== */
.carrito-panel {
  position: fixed;
  top: 0;
  right: -400px; /* Oculto por defecto */
  width: 350px;
  height: 100vh;
  background: #111;
  border-left: 1px solid #333;
  z-index: 2000;
  padding: 1.5rem;
  transition: 0.4s ease;
  display: flex;
  flex-direction: column;
}

.carrito-panel.active { /* Clase para activar con JS */
  right: 0;
  box-shadow: -10px 0 30px rgba(0,0,0,0.8);
}

.carrito-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #333;
  padding-bottom: 1rem;
}

.btn-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.carrito-body { flex: 1; overflow-y: auto; }
.carrito-actions { margin-top: auto; display: flex; gap: 1rem; }

/* Estructura Tabla Carrito */
#lista-carrito {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-bottom: 1.5rem;
}

#lista-carrito th, #lista-carrito td {
    text-align: center;
    vertical-align: middle;
    padding: 1rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

#lista-carrito th {
    color: var(--primary-gold); 
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding-bottom: 1rem;
}

#lista-carrito th:nth-child(1), #lista-carrito td:nth-child(1) { width: 40%; }
#lista-carrito th:nth-child(2), #lista-carrito td:nth-child(2) { width: 45%; font-size: 0.9rem; white-space: normal; }
#lista-carrito th:nth-child(3), #lista-carrito td:nth-child(3) { width: 35%; font-weight: bold; color: var(--primary-gold); }
#lista-carrito th:nth-child(4), #lista-carrito td:nth-child(4) { width: 10%; }

/* Botón Vaciar Carrito */
#vaciar-carrito {
    background-color: #000000;
    color: #ffffff;
    border: 1px solid #ffffff;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

#vaciar-carrito:hover {
    background-color: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

/* ===================== RESPONSIVE (Móvil) ===================== */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .menu-toggle {
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white); font-size: 1.5rem; cursor: pointer; padding: 0.5rem;
    border-radius: 8px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease; width: 40px; height: 40px;
  }
  .menu-toggle:hover, .nav-menu.show + .nav-icons .menu-toggle {
    background: rgba(215, 178, 118, 0.1); border-color: var(--primary-gold); color: var(--primary-gold);
  }
  .menu-toggle i { display: flex; }
  .nav-menu {
    position: fixed; top: -100vh; left: 0; width: 100%;
    background: rgba(10, 10, 10, 0.95); backdrop-filter: blur(15px);
    padding: 4rem 2rem; transition: top 0.4s ease-in-out;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: -1;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .nav-menu.show { top: var(--header-height); }
  .nav-links { flex-direction: column; align-items: center; gap: 2.5rem; }
  .nav-links li { width: 100%; text-align: center; }
  .nav-link { font-size: 1.2rem; display: block; }
  .btn-login { display: inline-block; width: auto; margin-top: 1rem; padding: 0.7rem 2rem; }
  .nav-icons { gap: 1rem; }
}

header.scroll-hide { transform: translateY(-100%); }

/* =======================================================
   ESTILOS NUEVOS (AGREGADOS)
   ======================================================= */

/* --- 1. MODAL MI CUENTA --- */
.modal-cuenta {
    display: none; position: fixed; z-index: 3000; left: 0; top: 0; 
    width: 100%; height: 100%; background-color: rgba(0,0,0,0.8); 
    backdrop-filter: blur(5px); align-items: center; justify-content: center;
}

.modal-content-cuenta {
    background: #1a1a1a;
    border: 1px solid var(--primary-gold);
    border-radius: 15px; padding: 30px;
    width: 90%; max-width: 400px;
    text-align: center; color: #fff;
    position: relative; box-shadow: 0 0 20px rgba(198, 168, 124, 0.2);
}

.close-modal-cuenta {
    position: absolute; top: 10px; right: 15px;
    font-size: 28px; color: #aaa; cursor: pointer;
}
.close-modal-cuenta:hover { color: #fff; }

.user-icon-large { font-size: 60px; color: var(--primary-gold); margin-bottom: 10px; }
.user-info p { margin: 10px 0; font-size: 0.95rem; color: #ccc; }
.user-info strong { color: #fff; }

.btn-logout {
    margin-top: 20px;
    background: #d63031; color: white; border: none;
    padding: 12px 20px; border-radius: 5px; cursor: pointer;
    font-weight: 600; width: 100%; transition: background 0.3s;
}
.btn-logout:hover { background: #ff7675; }

/* --- 2. PANEL DE RASTREO (TRACKING) --- */
.tracking-panel {
    position: fixed; top: 0; right: -400px; width: 350px; height: 100vh;
    background: #111; border-left: 1px solid #333; z-index: 3500;
    padding: 20px; transition: 0.4s ease; overflow-y: auto;
    display: flex; flex-direction: column;
}
.tracking-panel.active { right: 0; box-shadow: -10px 0 30px rgba(0,0,0,0.9); }

/* Línea de tiempo */
.timeline { position: relative; margin-top: 30px; padding-left: 20px; border-left: 2px solid #333; }
.timeline-item { position: relative; margin-bottom: 40px; padding-left: 20px; }
.timeline-item::before {
    content: ''; position: absolute; left: -26px; top: 0;
    width: 10px; height: 10px; background: #333; border-radius: 50%;
    border: 2px solid #111; z-index: 2; transition: 0.3s;
}
/* Estados de la línea de tiempo */
.timeline-item.active::before { background: var(--primary-gold); box-shadow: 0 0 10px var(--primary-gold); }
.timeline-item h4 { margin: 0 0 5px; color: #888; font-size: 1rem; }
.timeline-item.active h4 { color: var(--primary-gold); }
.timeline-item p { margin: 0; font-size: 0.85rem; color: #555; }

/* Relleno de la línea */
.timeline-fill {
    position: absolute; left: -2px; top: 0; width: 2px; 
    background: var(--primary-gold); height: 0%; 
    transition: height 1s ease; z-index: 1;
}

/* Mensajes de carga */
.loading-msg {
    width: 100%; text-align: center; color: #aaa; padding: 20px;
    font-size: 1.2rem; grid-column: 1 / -1;
}