/* historia.css */
/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  background: #f7f3ef;
  color: #333;
  line-height: 1.6;
}

/* Header y navegación */
header {
  background: linear-gradient(135deg, #231a11, #2e2113);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #DAA520;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-links a,
.nav-links button {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  transition: all 0.3s ease;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links a:hover,
.nav-links button:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: translateY(-2px);
}

.nav-links .auth-btn {
  background: #DAA520;
  color: #2e2113;
  font-weight: bold;
}

.nav-links .auth-btn:hover {
  background: #DAA520;
  color: #231a11;
}

.nav-links .cart-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid #DAA520;
}

.nav-links .cart-btn:hover {
  background: #DAA520;
  color: #231a11;
}

/* Menú hamburguesa */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.hamburger:hover {
  background: rgba(255, 215, 0, 0.1);
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: #DAA520;
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Menú móvil */
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, #231a11, #2e2113);
  backdrop-filter: blur(10px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.mobile-menu.active {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-menu ul {
  list-style: none;
  padding: 1rem;
}

.mobile-menu li {
  margin: 0.5rem 0;
}

.mobile-menu a,
.mobile-menu button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  color: white;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.3s ease;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  width: 100%;
  text-align: left;
}

.mobile-menu a:hover,
.mobile-menu button:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: translateX(10px);
}

.mobile-menu .auth-btn {
  background: #DAA520;
  color: #2e2113;
  font-weight: bold;
  margin-top: 1rem;
  justify-content: center;
}

.mobile-menu .cart-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid #DAA520;
  margin-top: 0.5rem;
  justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
  nav {
    padding: 1rem;
  }

  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .logo {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 0.5rem 1rem;
  }

  .logo {
    font-size: 1rem;
  }
}

/* Contenido principal */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.historia {
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  padding: 3rem;
  margin-bottom: 3rem;
}

.historia h1,
.historia h2 {
  font-family: 'Playfair Display', Georgia, serif;
  color: #2F1B14;
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  margin-bottom: 2.5rem;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(135deg,
    #8B4513 0%,
    #A0522D 25%,
    #DAA520 50%,
    #8B4513 75%,
    #2F1B14 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  animation:
    fadeInUp 1.2s cubic-bezier(0.23, 1, 0.32, 1),
    textGlow 6s ease-in-out infinite 2s;
  letter-spacing: -0.02em;
  line-height: 1.1;
  transition: all 0.4s ease;
  text-shadow: 0 4px 12px rgba(139, 69, 19, 0.15);
}

.historia h1::after,
.historia h2::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 6px;
  background: linear-gradient(90deg,
    transparent 0%,
    #8B4513 20%,
    #DAA520 50%,
    #8B4513 80%,
    transparent 100%);
  border-radius: 6px;
  animation: goldShimmer 8s ease-in-out infinite;
  background-size: 200% 100%;
  box-shadow:
    0 2px 8px rgba(218, 165, 32, 0.3),
    0 4px 16px rgba(139, 69, 19, 0.2);
}

.historia h1 .heading-emoji,
.historia h2 .heading-emoji {
  -webkit-text-fill-color: initial;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  display: inline-block;
  font-size: 0.85em;
  vertical-align: -0.05em;
  margin: 0 0.15em;
  filter: drop-shadow(0 2px 4px rgba(35, 26, 17, 0.18));
}

.historia-content {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.historia-section {
  background: linear-gradient(135deg, rgba(75, 46, 46, 0.05), rgba(255, 215, 0, 0.05));
  padding: 2rem;
  border-radius: 15px;
  border-left: 4px solid #DAA520;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-left-color 0.3s ease;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.historia-section:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(35, 26, 17, 0.08);
  border-left-color: #231a11;
}

.historia-content > .historia-section:nth-child(1) { animation-delay: 0.05s; }
.historia-content > .historia-section:nth-child(2) { animation-delay: 0.12s; }
.historia-content > .historia-section:nth-child(3) { animation-delay: 0.19s; }
.historia-content > .historia-section:nth-child(4) { animation-delay: 0.26s; }
.historia-content > .historia-section:nth-child(5) { animation-delay: 0.33s; }
.historia-content > .historia-section:nth-child(6) { animation-delay: 0.40s; }
.historia-content > .historia-section:nth-child(7) { animation-delay: 0.47s; }
.historia-content > .historia-section:nth-child(8) { animation-delay: 0.54s; }
.historia-content > .historia-section:nth-child(9) { animation-delay: 0.61s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.historia-section h3 {
  color: #231a11;
  font-family: 'Fraunces', 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.6rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: 0.3px;
}

.historia-section p {
  color: #555;
  font-size: 1.05rem;
  line-height: 1.8;
  text-align: justify;
}

.historia-section p + p {
  margin-top: 0.85rem;
}

.historia-section ul {
  padding-left: 1.5rem;
  line-height: 2;
  color: #4a3728;
  margin: 0.75rem 0;
}

.historia-section ul li {
  margin: 0.35rem 0;
}

.historia-section ul li::marker {
  color: #DAA520;
}

.historia-section strong {
  color: #231a11;
  font-weight: 600;
}

.historia-section em {
  color: #6b4423;
  font-style: italic;
}

.historia-section a {
  color: #8B4513;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(218, 165, 32, 0.45);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.historia-section a:hover {
  color: #DAA520;
  border-bottom-color: #DAA520;
}

.historia-meta {
  color: #6b5744;
  font-size: 0.88rem;
  margin-top: -0.25rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.stat-card {
  background: linear-gradient(135deg, #231a11, #2e2113);
  color: white;
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  transform: perspective(1000px) rotateX(5deg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.stats-grid > .stat-card:nth-child(1) { animation-delay: 0.5s; }
.stats-grid > .stat-card:nth-child(2) { animation-delay: 0.6s; }
.stats-grid > .stat-card:nth-child(3) { animation-delay: 0.7s; }
.stats-grid > .stat-card:nth-child(4) { animation-delay: 0.8s; }

.stat-card:hover {
  transform: perspective(1000px) rotateX(0deg) translateY(-10px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.stat-number {
  font-family: 'Fraunces', 'Playfair Display', Georgia, serif;
  font-size: 3rem;
  font-weight: 600;
  color: #ffd700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 12px rgba(255, 215, 0, 0.25);
  letter-spacing: 0.5px;
}

.stat-label {
  font-size: 1.2rem;
  opacity: 0.9;
}

.user-info {
  background: linear-gradient(135deg, rgba(75, 46, 46, 0.1), rgba(255, 215, 0, 0.1));
  padding: 1rem 2rem;
  border-radius: 25px;
  border-left: 4px solid #231a11;
  display: inline-block;
  margin-bottom: 2rem;
}

.user-info p {
  margin: 0;
  font-weight: bold;
  color: #231a11;
}

/* Carrito lateral */
.carrito-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -5px 0 20px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  z-index: 2000;
  overflow-y: auto;
  padding: 2rem;
}

.carrito-sidebar.active {
  right: 0;
}

.carrito-sidebar h2 {
  color: #231a11;
  margin-bottom: 2rem;
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: none;
  -webkit-text-fill-color: initial;
}

.carrito-sidebar h2::after {
  display: none;
}

.carrito-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.carrito-overlay.active {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  .historia-section h3 {
    font-size: 1.4rem;
  }

  .historia-section p {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .carrito-sidebar {
    width: 100vw;
    right: -100vw;
  }

  .historia {
    padding: 2rem 1.5rem;
  }

  .historia-section {
    padding: 1.5rem;
  }

  .historia-section h3 {
    font-size: 1.25rem;
  }

  .stat-card {
    transform: none;
  }

  .stat-card:hover {
    transform: translateY(-5px);
  }

  .stat-number {
    font-size: 2.4rem;
  }
}

.oculto {
  display: none !important;
}
