/* ============================================
   ESCOLA TRAIL BARCELONA - GLOBAL STYLES v5
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* --- Variables --- */
:root {
  --blue-dark: #0f2557;
  --blue: #1e3a8a;
  --blue-mid: #2554c7;
  --blue-light: #3b82f6;
  --accent: #f97316;
  --accent-dark: #ea6a0a;
  --white: #ffffff;
  --off-white: #f8f9fc;
  --gray-100: #f1f4f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(15,37,87,0.10);
  --shadow-lg: 0 12px 48px rgba(15,37,87,0.16);
  --nav-h: 76px;
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.65;
  font-size: 17px;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* --- Navigation --- */
.nav-bar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 2px 16px rgba(15,37,87,0.06);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 32px;
}
.nav-logo img { height: 52px; width: auto; }
.nav-links { display: flex; gap: 8px; margin-left: auto; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 15px; font-weight: 600;
  color: var(--gray-600);
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  background: var(--blue); color: var(--white);
}
.nav-cta {
  background: var(--accent);
  color: var(--white) !important;
  font-weight: 700; font-size: 15px;
  padding: 10px 22px;
  border-radius: 100px;
  white-space: nowrap;
  transition: var(--transition);
}
.nav-cta:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(249,115,22,0.35); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 6px;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--blue); border-radius: 2px;
  transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.nav-mobile-menu {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 16px 24px 24px;
}
.nav-mobile-menu ul { display: flex; flex-direction: column; gap: 4px; }
.nav-mobile-menu ul a {
  display: block; padding: 12px 16px;
  font-size: 16px; font-weight: 600;
  color: var(--gray-800); border-radius: 10px;
  transition: var(--transition);
}
.nav-mobile-menu ul a:hover, .nav-mobile-menu ul a.active { background: var(--blue); color: var(--white); }
.mobile-cta {
  display: block; margin-top: 16px;
  background: var(--accent); color: var(--white);
  text-align: center; padding: 14px;
  border-radius: 10px; font-weight: 700;
}
.hidden { display: none !important; }

/* --- Footer --- */
.site-footer {
  background: var(--blue-dark);
  color: rgba(255,255,255,0.75);
  padding: 64px 24px 32px;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-brand p { font-size: 14px; line-height: 1.7; margin-top: 12px; }
.footer-logo { height: 52px; filter: brightness(0) invert(1); margin-bottom: 8px; }
.footer-socials { display: flex; gap: 16px; margin-top: 16px; }
.footer-socials a {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.footer-socials a svg { width: 18px; height: 18px; fill: rgba(255,255,255,0.8); }
.footer-socials a:hover { background: var(--accent); }
.footer-col h4 {
  font-family: var(--font-display);
  letter-spacing: 1.5px;
  font-size: 18px;
  color: var(--white); margin-bottom: 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col ul a { font-size: 14px; transition: var(--transition); }
.footer-col ul a:hover { color: var(--white); padding-left: 4px; }
.feec-badge { display: inline-block; margin-top: 20px; }
.feec-badge img { height: 60px; opacity: 0.85; transition: var(--transition); }
.feec-badge:hover img { opacity: 1; transform: scale(1.05); }
.footer-bottom {
  max-width: 1280px; margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
  font-size: 13px;
}
.footer-bottom a { color: var(--blue-light); transition: var(--transition); }
.footer-bottom a:hover { color: var(--white); }

/* --- Cookie Banner --- */
.cookie-banner {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 48px); max-width: 680px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  animation: slideUp .4s ease;
}
.cookie-content {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
}
.cookie-icon { font-size: 28px; flex-shrink: 0; }
.cookie-text { flex: 1; font-size: 13.5px; color: var(--gray-600); }
.cookie-text strong { display: block; color: var(--gray-800); margin-bottom: 2px; }
.cookie-text a { color: var(--blue-light); text-decoration: underline; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-cookie-accept {
  background: var(--blue); color: var(--white);
  border: none; cursor: pointer;
  padding: 10px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 600; font-family: var(--font-body);
  transition: var(--transition);
}
.btn-cookie-accept:hover { background: var(--blue-mid); }
.btn-cookie-reject {
  background: var(--gray-100); color: var(--gray-600);
  border: 1px solid var(--gray-200); cursor: pointer;
  padding: 10px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 600; font-family: var(--font-body);
  transition: var(--transition);
}
.btn-cookie-reject:hover { background: var(--gray-200); }

/* --- Section Base --- */
.section { padding: 88px 24px; }
.section-sm { padding: 56px 24px; }
.container { max-width: 1280px; margin: 0 auto; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 60px);
  letter-spacing: 1px;
  color: var(--blue);
  margin-bottom: 12px;
}
.section-sub {
  font-size: 18px; color: var(--gray-600);
  max-width: 560px; line-height: 1.7;
  margin-bottom: 48px;
}

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-weight: 700; font-size: 15px;
  transition: var(--transition);
  cursor: pointer; border: none;
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-mid); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(30,58,138,0.3); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(249,115,22,0.35); }
.btn-outline { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn-outline:hover { background: var(--blue); color: var(--white); }
.btn-outline-white { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.6); }
.btn-outline-white:hover { background: rgba(255,255,255,0.15); border-color: var(--white); }

/* --- Tag Badge --- */
.badge {
  display: inline-flex; align-items: center;
  background: rgba(30,58,138,0.1);
  color: var(--blue);
  padding: 4px 12px; border-radius: 100px;
  font-size: 13px; font-weight: 600;
  margin-bottom: 12px;
}

/* --- Animations --- */
@keyframes slideUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes heroFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.animate-on-scroll { opacity: 0; transform: translateY(32px); transition: opacity .6s ease, transform .6s ease; }
.animate-on-scroll.visible { opacity: 1; transform: none; }

/* --- Page Hero (inner pages) --- */
.page-hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, var(--blue-mid) 100%);
  padding: 80px 24px 72px;
  text-align: center; color: var(--white);
  position: relative; overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 80px);
  letter-spacing: 2px; position: relative;
}
.page-hero-sub { font-size: 18px; opacity: .75; margin-top: 8px; position: relative; }

/* --- FAQ --- */
.faq-item { border-bottom: 1px solid var(--gray-200); }
.faq-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 17px; font-weight: 600;
  color: var(--gray-800); text-align: left;
}
.faq-icon { font-size: 22px; color: var(--blue); transition: transform .3s; }
.faq-toggle.active .faq-icon { transform: rotate(45deg); }
.faq-content { display: none; padding-bottom: 20px; color: var(--gray-600); line-height: 1.7; }
.faq-content.open { display: block; animation: slideUp .3s ease; }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,20,50,0.85);
  z-index: 200; display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; animation: fadeIn .25s ease; }
.modal-box {
  background: var(--white); border-radius: var(--radius);
  width: 100%; max-width: 800px;
  max-height: 90vh; overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  background: var(--white); border: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 20px; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: var(--transition);
}
.modal-close:hover { background: var(--gray-100); }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
  :root { --nav-h: 64px; }
  .section { padding: 60px 20px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .cookie-content { flex-direction: column; text-align: center; }
  .cookie-actions { justify-content: center; }
}
@media (max-width: 480px) {
  .page-hero { padding: 60px 20px 56px; }
}
