:root {
  --primary-color: #283593;
  --secondary-color: #F44336;
  --accent-color: #E6B012;
  --text-dark: #333333;
  --text-light: #FFFFFF;
  --bg-light: #F5F7FA;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Top Bar */
.top-bar {
  background-color: #1a237e;
  color: white;
  padding: 5px 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.top-links a {
  color: white;
  text-decoration: none;
  margin-left: 1.5rem;
  transition: var(--transition);
}

.top-links a:hover {
  color: var(--accent-color);
}

/* Header */
header {
  background-color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .logo img {
  height: 60px;
}

/* Hamburger Menu Icon */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--primary-color);
  margin: 2px 0;
  transition: 0.4s;
}

/* Navigation */
nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

nav ul li {
  margin: 0 1rem;
  position: relative;
}

nav ul li a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  transition: var(--transition);
  padding: 10px 0;
  display: inline-block;
}

nav ul li a:hover {
  color: var(--primary-color);
}

/* Dropdown */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: white;
  min-width: 200px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
  top: 100%;
  left: 0;
  border-top: 3px solid var(--primary-color);
}

.dropdown-content a {
  color: var(--text-dark);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-transform: none;
  font-size: 0.9rem;
  border-bottom: 1px solid #eee;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
  color: var(--primary-color);
}

nav ul li:hover .dropdown-content {
  display: block;
}

.btn-login {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-login:hover {
  background-color: #1a237e;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Hero Section */
.hero {
  background: linear-gradient(rgba(40, 53, 147, 0.7), rgba(40, 53, 147, 0.7)), url('../img/fachada_caja.png') center/cover no-repeat;
  height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
  padding: 0 1rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  max-width: 900px;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin-bottom: 2rem;
}

.hero .btn-primary {
  background-color: var(--secondary-color);
  color: white;
  padding: 1rem 2.5rem;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: var(--transition);
}

.hero .btn-primary:hover {
  background-color: #d32f2f;
  transform: scale(1.05);
}

/* Quick Access Section */
.quick-access {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: -50px auto 4rem;
  padding: 0 1rem;
}

.access-card {
  background-color: white;
  padding: 2rem;
  text-align: center;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border-bottom: 4px solid var(--primary-color);
  text-decoration: none;
  color: var(--text-dark);
}

.access-card:hover {
  transform: translateY(-10px);
  border-bottom: 4px solid var(--secondary-color);
}

.access-card i {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.access-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  text-transform: uppercase;
}

/* Sections */
.section-container {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 1rem;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title h2 {
  font-size: 2rem;
  color: var(--primary-color);
  text-transform: uppercase;
}

.section-title::after {
  content: '';
  width: 60px;
  height: 4px;
  background-color: var(--secondary-color);
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.news-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.news-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.news-img {
  height: 200px;
  background-color: #ddd;
  position: relative;
}

.news-content {
  padding: 1.5rem;
}

.news-content h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.news-content p {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.btn-more {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Stats Section */
.stats {
  background-color: var(--primary-color);
  color: white;
  padding: 4rem 1rem;
  text-align: center;
}

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

.stat-item h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* Footer */
footer {
  background-color: #1a237e;
  color: white;
  padding: 4rem 2rem 1rem;
}

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

.footer-col h4 {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--secondary-color);
  padding-left: 10px;
  text-transform: uppercase;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 0.8rem;
}

.footer-col ul li a {
  color: #bbb;
  text-decoration: none;
  transition: var(--transition);
  font-size: 0.9rem;
}

.footer-col ul li a:hover {
  color: white;
  padding-left: 5px;
}

.social-links {
  margin-top: 1.5rem;
}

.social-links a {
  color: white;
  font-size: 1.5rem;
  margin-right: 1rem;
  transition: var(--transition);
}

.social-links a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  text-align: center;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: #bbb;
}

/* Responsive */
@media (max-width: 1024px) {
  .menu-toggle {
    display: flex;
  }

  nav {
    position: fixed;
    top: 80px;
    /* Header height */
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: white;
    transition: 0.4s;
    z-index: 999;
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
  }

  nav.active {
    left: 0;
  }

  nav ul {
    flex-direction: column;
    padding: 2rem;
  }

  nav ul li {
    margin: 1rem 0;
  }

  nav ul li a {
    font-size: 1.2rem;
    width: 100%;
  }

  .dropdown-content {
    position: static;
    display: block;
    box-shadow: none;
    border-top: none;
    padding-left: 1.5rem;
    background: #f9f9f9;
  }

  .top-bar {
    flex-direction: column;
    text-align: center;
    padding: 10px 1rem;
    gap: 5px;
  }

  .top-links {
    margin-top: 5px;
  }

  .top-links a {
    margin: 0 0.5rem;
  }
}

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

  header .logo img {
    height: 50px;
  }

  .btn-login {
    display: none;
    /* Hide login button on small mobile header, put it in nav? */
  }

  nav ul li a {
    font-size: 1rem;
  }

  .hero {
    height: 400px;
  }

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

  .hero p {
    font-size: 0.9rem;
  }

  .quick-access {
    grid-template-columns: 1fr;
    margin-top: -30px;
  }

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

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

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-col h4 {
    border-left: none;
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
    padding-bottom: 5px;
    padding-left: 0;
  }

  .section-container {
    margin: 2rem auto;
  }

  .section-title h2 {
    font-size: 1.5rem;
  }
}

/* Animation for menu icon */
.menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

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

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

/* Animation for menu icon */
.menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

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

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