/* ============================
           1. BASES & VARIABLES
        ============================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --red-main: #c7352f;
  --red-dark: #9e2a25;
  --yellow-main: #f5b034;
  --yellow-dark: #c98527;
  --white: #ffffff;
  --cream: #fffdf5;
  --text-muted: #ffe6da;
  --grid-color: #c7352f;
}

body {
  font-family: "Roboto Slab", serif;
  background-color: #ffffff;
  background-image: linear-gradient(var(--grid-color) 2px, transparent 2px),
    linear-gradient(90deg, var(--grid-color) 2px, transparent 2px);
  background-size: 60px 60px;
  color: #333;
  overflow-x: hidden;
  line-height: 1.6;
}
h1,
h2,
h3 {
  font-family: "Alfa Slab One", sans-serif;
  letter-spacing: 1px;
  margin: 0px 0px 64px;
}
img {
  max-width: 100%;
  display: block;
}

/* ============================
   2. HEADER & NAV (UNIFICADO)
   ============================ */
.header {
  width: 100%;
  background-color: var(--red-main);
  padding: 0.5rem 5%;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Header Glassmorphism */
.header.scrolled {
  background-color: rgba(199, 53, 47, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  transition: all 0.3s ease;
}

.logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
}
.logo-img {
  height: 80px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: center center;
  will-change: transform;
}
.logo-link:hover .logo-img {
  transform: scale(1.08) rotate(-3deg);
}

@media (min-width: 768px) {
  .logo-img {
    height: 110px;
  }
}

.nav-links-desktop {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-left: auto;
  margin-right: 40px;
}
.nav-link {
  font-family: "Madimi One", sans-serif;
  font-size: 1.1rem;
  color: var(--white);
  text-decoration: none;
  position: relative;
  transition: color 0.3s, transform 0.2s ease-out;
  display: inline-block;
}
.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 3px;
  bottom: -5px;
  left: 0;
  background-color: var(--yellow-main);
  transition: width 0.3s ease;
}
.nav-links-desktop a:hover::after {
  width: 100%;
}
.nav-link.active {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 6px 14px;
}
.nav-link:hover {
  transform: translateY(-3px);
}

.cart-btn {
  background: var(--yellow-main);
  border: 3px solid var(--white);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}
.cart-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
  background: var(--white);
}
.cart-btn:hover svg {
  stroke: var(--red-main);
}
.cart-btn svg {
  stroke: var(--white);
  width: 24px;
  height: 24px;
  transition: stroke 0.2s;
}
.cart-counter {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--red-dark);
  color: var(--white);
  font-family: "Alfa Slab One", cursive;
  font-size: 10px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--white);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

/* Menú Móvil */
.mobile-menu-container {
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  background-color: var(--red-dark);
  padding: 20px;
  display: none;
  flex-direction: column;
  gap: 15px;
  z-index: 99;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border-bottom: 4px solid var(--yellow-main);
}
.mobile-menu-container.active {
  display: flex;
  animation: slideDown 0.3s ease;
}
.mobile-link {
  font-family: "Madimi One", sans-serif;
  font-size: 1.5rem;
  color: white;
  text-decoration: none;
  text-align: center;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================
           3. TIMELINE
   ============================ */
.timeline-section {
  padding: 60px 20px 100px;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}
.page-title {
  font-family: "Alfa Slab One", sans-serif;
  font-size: clamp(3rem, 5vw, 5rem);
  color: var(--red-main);
  margin-bottom: 4rem;
  text-align: center;
  text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.299);
}

.timeline-container {
  position: relative;
  padding: 20px 0;
}
.timeline-container::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background-image: linear-gradient(
    to bottom,
    var(--yellow-main) 50%,
    transparent 50%
  );
  background-size: 4px 20px;
  transform: translateX(-50%);
  z-index: 1;
}

.timeline-row {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  align-items: center;
  margin-bottom: 50px;
  position: relative;
  z-index: 2;
}

.timeline-date {
  text-align: right;
  padding-right: 30px;
  font-family: "Alfa Slab One", serif;
  font-size: 2.5rem;
  color: var(--red-main);
  text-shadow: 5px 7px 0 rgba(0, 0, 0, 0.1);
}

.timeline-node {
  width: 30px;
  height: 30px;
  background-color: var(--yellow-main);
  border: 4px solid var(--red-dark);
  border-radius: 50%;
  margin: 0 auto;
  box-shadow: 0 0 0 5px var(--cream);
  animation: pulseNode 3s infinite;
}

@keyframes pulseNode {
  0% {
    box-shadow: 0 0 0 0px rgba(245, 176, 52, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(245, 176, 52, 0);
  }
  100% {
    box-shadow: 0 0 0 0px rgba(245, 176, 52, 0);
  }
}

.timeline-card {
  background-color: var(--cream);
  border: 3px solid var(--red-main);
  border-radius: 15px;
  padding: 20px;
  margin-left: 30px;
  box-shadow: 5px 5px 0 rgba(199, 53, 47, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;

  /* Configuración Tilt 3D */
  transform-style: preserve-3d;
  transform: perspective(1000px);
  transition: transform 0.1s ease-out, box-shadow 0.3s ease;
}

/* Estado normal hover */
.timeline-card:hover {
  box-shadow: 7px 7px 0 rgba(199, 53, 47, 0.3);
}

.card-content h3 {
  font-size: 1.4rem;
  color: var(--red-dark);
  margin-bottom: 5px;
  /* Reset del margen global para h3 solo aquí */
  margin-top: 0;
}
.card-content p {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.4;
}
.card-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
  transform: translateZ(20px);
}

/* ============================
           4. FOOTER (UNIFICADO)
   ============================ */
.footer {
  background-color: var(--red-dark);
  padding: 60px 5% 40px;
  text-align: center;
  color: var(--white);
  position: relative;
  z-index: 10;
}
.logo-placeholder {
  font-family: "Alfa Slab One", serif;
}
.footer-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.footer-social {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}
.social-icon {
  width: 45px;
  height: 45px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  color: var(--red-main);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.social-icon:hover {
  background: var(--yellow-main);
  color: var(--white);
}
.footer_tagline {
  font-family: "Press Start 2P", cursive;
  font-size: 0.7rem;
  color: var(--yellow-main);
  margin-top: 10px;
  animation: blinkRetro 1s step-end infinite;
}

@keyframes blinkRetro {
  50% {
    opacity: 0;
  }
}

/* RESPONSIVE TIMELINE */
@media (max-width: 768px) {
  .header {
    padding: 10px 5%;
  }
  .nav-links-desktop {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }

  .timeline-container::before {
    left: 30px;
  }
  .timeline-row {
    grid-template-columns: 60px 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
    margin-bottom: 40px;
  }
  .timeline-node {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    margin: 0 auto;
  }
  .timeline-date {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    text-align: left;
    padding-right: 0;
    margin-bottom: 5px;
    font-size: 2rem;
  }
  .timeline-card {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    margin-left: 0;
  }
}

/* =========================================
   5. ANIMACIONES Y EFECTOS (Add-ons)
   ========================================= */

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
  will-change: opacity, transform;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
