/* ===== VARIABLES ===== */
:root {
  --color-primary: #8B4513;
  --color-primary-dark: #5D2E0A;
  --color-primary-light: #C4A35A;
  --color-accent: #B8860B;
  --color-bg: #F8F4EF;
  --color-bg-dark: #1A1510;
  --color-card: #FFFFFF;
  --color-text: #2C2416;
  --color-text-light: #6B5E4F;
  --color-border: #E8DFD3;
  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
  --shadow: 0 4px 20px rgba(44, 36, 22, 0.08);
  --shadow-hover: 0 12px 40px rgba(44, 36, 22, 0.15);
  --radius: 12px;
  --transition: 0.25s ease;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent); }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  box-sizing: border-box;
}

/* ===== HEADER ===== */
.header {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  z-index: 2000;
  background: rgba(248, 244, 239, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
  overflow: visible;
}
.header.scrolled { box-shadow: var(--shadow); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 60px;
  height: auto;
  padding: 0.4rem 0;
  flex-wrap: nowrap;
  position: relative;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 1rem;
  flex-shrink: 0;
  white-space: nowrap;
  z-index: 2;
}
.logo-icon { font-size: 1.4rem; }
.logo strong { color: var(--color-primary); }
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem 0.55rem;
  flex: 1 1 auto;
  min-width: 0;
}
.nav-link {
  color: var(--color-text-light);
  font-weight: 600;
  font-size: 0.8rem;
  position: relative;
  padding: 0.35rem 0.2rem;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--color-primary); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0.2rem; right: 0.2rem;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  z-index: 2;
}
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--color-card);
  border: 2px solid var(--color-primary);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2.5px;
  background: var(--color-primary);
  transition: transform 0.25s ease, opacity 0.2s ease;
  border-radius: 1px;
  pointer-events: none;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #2C2416 0%, #5D2E0A 40%, #8B4513 100%);
  color: #fff;
  padding-top: 2rem;
  overflow: hidden;
}
.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.03'%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");
  opacity: 0.6;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(196,163,90,0.15) 0%, transparent 60%);
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3rem 1.25rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.hero-subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  max-width: 640px;
  margin: 0 auto 2rem;
  opacity: 0.92;
  font-weight: 300;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.hero-stats {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary-light);
}
.stat-label {
  font-size: 0.85rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  transition: all var(--transition);
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--color-primary-light);
  color: var(--color-bg-dark);
}
.btn-primary:hover {
  background: #D4B86A;
  color: var(--color-bg-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196,163,90,0.4);
}
.btn-outline {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}
.btn-outline:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
/* Outline blanco solo sobre fondos oscuros (hero, monetización) */
.hero .btn-outline,
.monetizacion .btn-outline {
  border-color: rgba(255,255,255,0.65);
  color: #fff;
}
.hero .btn-outline:hover,
.monetizacion .btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
  color: #fff;
}
.route-link {
  color: var(--color-primary) !important;
}
.route-link:hover {
  color: var(--color-primary-dark) !important;
  text-decoration: underline;
}
.btn-secondary {
  background: var(--color-primary);
  color: #fff;
}
.btn-secondary:hover {
  background: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-2px);
}
.btn-sm { padding: 0.6rem 1.2rem; font-size: 0.875rem; }

/* ===== SHARE BAR ===== */
.share-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: var(--color-bg-dark);
  color: #fff;
  position: sticky;
  top: 70px;
  z-index: 900;
}
.share-label { font-size: 0.85rem; opacity: 0.7; margin-right: 0.5rem; }
.share-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 20px;
  transition: background var(--transition);
}
.share-btn:hover { background: rgba(255,255,255,0.22); }

/* ===== SECTIONS ===== */
.section { padding: 4.5rem 0; }
.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
}
.section-header p {
  color: var(--color-text-light);
  font-size: 1.05rem;
}
.text-center { text-align: center; }
.mt-4 { margin-top: 2rem; }

/* ===== INTRO ===== */
.intro-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.intro-text h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--color-primary-dark);
  margin-bottom: 1rem;
}
.intro-text p { margin-bottom: 1rem; color: var(--color-text-light); }
.intro-text .note {
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.8;
}
.intro-card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}
.intro-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}
.intro-card li {
  position: relative;
  padding-left: 1.3rem;
  margin-bottom: 0.7rem;
  color: var(--color-text-light);
  font-size: 0.95rem;
}
.intro-card li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--color-primary-light);
  font-size: 0.7rem;
  top: 0.3rem;
}

/* ===== FILTERS ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.filter-btn {
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 25px;
  background: var(--color-card);
  color: var(--color-text-light);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ===== CASTLES GRID ===== */
.castles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.75rem;
}
.castle-card {
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.castle-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}
.castle-img {
  height: 190px;
  background: linear-gradient(135deg, #5D2E0A, #8B4513, #C4A35A);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
}
.castle-img .region-tag {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.castle-body {
  padding: 1.35rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.castle-body h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
  color: var(--color-primary-dark);
}
.castle-meta {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
}
.castle-body p {
  font-size: 0.92rem;
  color: var(--color-text-light);
  flex: 1;
  margin-bottom: 1rem;
}
.castle-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.castle-actions .btn { flex: 1; min-width: 100px; }

/* ===== MAP ===== */
.map-section { background: #F0EAE0; }
.map-container {
  height: 480px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  z-index: 1;
}
.map-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 1rem;
}

/* ===== ROUTES ===== */
.routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.5rem;
}
.route-card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  position: relative;
  transition: transform var(--transition);
}
.route-card:hover { transform: translateY(-4px); }
.route-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--color-primary-light);
  color: var(--color-bg-dark);
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  margin-bottom: 0.85rem;
}
.route-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary-dark);
}
.route-card p {
  font-size: 0.92rem;
  color: var(--color-text-light);
  margin-bottom: 1rem;
}
.route-link {
  font-weight: 600;
  font-size: 0.9rem;
}

/* ===== MONETIZACIÓN ===== */
.monetizacion { background: var(--color-bg-dark); color: #fff; }
.monetizacion .section-header h2 { color: var(--color-primary-light); }
.monetizacion .section-header p { color: rgba(255,255,255,0.7); }
.monetiza-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.monetiza-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
  transition: background var(--transition);
}
.monetiza-card:hover { background: rgba(255,255,255,0.1); }
.monetiza-icon { font-size: 2.2rem; margin-bottom: 0.75rem; }
.monetiza-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary-light);
}
.monetiza-card p {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 1.1rem;
}
.ad-placeholder {
  background: rgba(255,255,255,0.05);
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ===== NEWSLETTER ===== */
.newsletter-section { background: linear-gradient(135deg, #5D2E0A, #8B4513); color: #fff; }
.newsletter-box { text-align: center; max-width: 560px; margin: 0 auto; }
.newsletter-box h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}
.newsletter-box p { opacity: 0.9; margin-bottom: 1.5rem; }
.newsletter-form {
  display: flex;
  gap: 0.5rem;
  max-width: 420px;
  margin: 0 auto 0.75rem;
}
.newsletter-form input {
  flex: 1;
  padding: 0.85rem 1.1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}
.newsletter-form .btn { white-space: nowrap; }
.form-note { font-size: 0.8rem; opacity: 0.7; }

/* ===== FOOTER ===== */
.footer {
  background: #120E0A;
  color: rgba(255,255,255,0.75);
  padding: 3.5rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-brand .logo { color: #fff; margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.9rem; line-height: 1.6; }
.footer-links h4, .footer-share h4 {
  font-family: var(--font-display);
  color: var(--color-primary-light);
  font-size: 1rem;
  margin-bottom: 1rem;
}
.footer-links a {
  display: block;
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.footer-links a:hover { color: #fff; }
.footer .share-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.footer .share-btn {
  background: rgba(255,255,255,0.08);
  color: #fff;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 15px;
}
.footer .share-btn:hover { background: rgba(255,255,255,0.18); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.6;
}
.domain-note { margin-top: 0.4rem; }
.domain-note strong { color: var(--color-primary-light); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-bg-dark);
  color: #fff;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== PAGES COMMON ===== */
.page-header {
  background: linear-gradient(135deg, #2C2416, #5D2E0A);
  color: #fff;
  padding: 8rem 0 3rem;
  text-align: center;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 0.5rem;
}
.page-header p { opacity: 0.85; max-width: 600px; margin: 0 auto; }

.comunidad-block {
  margin-bottom: 3rem;
}
.comunidad-block h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--color-primary-dark);
  border-bottom: 2px solid var(--color-primary-light);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .header {
    overflow: visible;
  }
  .header-inner {
    flex-wrap: wrap;
  }
  /* Ocultar nav en flujo; panel móvil absoluto bajo el header */
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--color-card);
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0.5rem 1rem 1rem;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 16px 40px rgba(0,0,0,0.18);
    z-index: 2500;
    max-height: min(80vh, 520px);
    overflow-y: auto;
    flex: none;
    min-width: 100%;
  }
  .nav.open {
    display: flex !important;
  }
  .nav-link {
    display: block;
    font-size: 1.05rem;
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    white-space: normal;
    width: 100%;
    text-align: left;
  }
  .nav-link.active::after { display: none; }
  .nav-link.active {
    color: var(--color-primary);
    background: rgba(93,46,10,0.08);
    border-radius: 8px;
  }
  .menu-toggle {
    display: inline-flex !important;
  }
  .header-actions {
    margin-left: auto;
  }
  .intro-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .newsletter-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .logo-text { font-size: 0.92rem; }
  .header-actions button {
    padding: 0.3rem 0.45rem;
    font-size: 0.9rem;
  }
  .menu-toggle {
    width: 42px;
    height: 42px;
  }
}
@media (max-width: 600px) {
  .hero-stats { gap: 1.5rem; }
  .stat-num { font-size: 1.4rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .map-container { height: 360px; }
  .share-bar { top: 70px; }
}

.destacado-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--color-primary-light);
  color: var(--color-bg-dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  letter-spacing: 0.03em;
}


/* ===== Mejoras: imágenes reales, modal, PWA, nuevas secciones ===== */

.castle-img {
  position: relative;
  height: 180px;
  background: linear-gradient(135deg, #5D2E0A 0%, #8B5A2B 50%, #C4A574 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.castle-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.castle-card:hover .castle-img img {
  transform: scale(1.06);
}

.castle-img-fallback {
  font-size: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(255,255,255,0.85);
}

/* Modal mejorado */
.castle-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.castle-modal {
  background: #fff;
  border-radius: 14px;
  max-width: 640px;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  position: relative;
  box-shadow: 0 25px 50px rgba(0,0,0,0.35);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 1.75rem;
  background: rgba(255,255,255,0.9);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
  line-height: 1;
  color: #5D2E0A;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.modal-img-wrap {
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: #eee;
}

.modal-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-emoji {
  font-size: 4rem;
  text-align: center;
  padding: 2rem 0 0.5rem;
}

.modal-body {
  padding: 1.5rem 1.75rem 1.75rem;
}

.modal-body h2 {
  font-family: var(--font-display);
  color: var(--color-primary-dark);
  margin-bottom: 0.35rem;
  font-size: 1.45rem;
}

.modal-meta {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.modal-desc {
  line-height: 1.65;
  margin-bottom: 1rem;
}

.modal-tip {
  background: #F8F4EF;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.92rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--color-primary);
}

.modal-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  color: var(--color-text-light);
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Install PWA button */
#installPwaBtn, .install-app-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Nuevas secciones */
.section-inmobiliaria,
.section-servicios {
  background: var(--color-bg);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.1);
}

.service-card .icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

.service-card h3 {
  font-family: var(--font-display);
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.service-card p {
  font-size: 0.92rem;
  color: var(--color-text-light);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.listing-card {
  display: flex;
  flex-direction: column;
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.listing-card .listing-img {
  height: 160px;
  background: linear-gradient(135deg, #3d1f08, #8B5A2B);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(255,255,255,0.8);
}

.listing-card .listing-body {
  padding: 1.25rem;
}

.listing-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
  color: var(--color-primary-dark);
}

.listing-price {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.15rem;
  margin: 0.5rem 0;
}

.badge-venta {
  display: inline-block;
  background: #2e7d32;
  color: #fff;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.badge-alquiler {
  background: #1565c0;
}

@media (max-width: 600px) {
  .modal-img-wrap { height: 180px; }
  .castle-img { height: 150px; }
}

/* ===== v3: Dark mode, favoritos, polish ===== */

:root {
  --fav-color: #e6a817;
}

html.dark {
  --color-bg: #1a1410;
  --color-bg-dark: #0f0c0a;
  --color-card: #2a211c;
  --color-text: #e8e0d5;
  --color-text-light: #a89888;
  --color-border: #3d322a;
  --color-primary: #c47840;
  --color-primary-dark: #e8b87a;
  --color-primary-light: #8B5A2B;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
}

html.dark .header {
  background: rgba(26, 20, 16, 0.95);
}

html.dark .hero {
  background: linear-gradient(160deg, #1a1410 0%, #2a1810 50%, #1a1410 100%);
}

html.dark .castle-modal {
  background: #2a211c;
  color: var(--color-text);
}

html.dark .modal-close {
  background: rgba(42, 33, 28, 0.95);
  color: var(--color-text);
}

html.dark .modal-tip {
  background: #1a1410;
}

html.dark .filter-btn.active {
  background: var(--color-primary);
  color: #1a1410;
}

/* Fav button on cards */
.fav-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.45);
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 4;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.fav-btn:hover, .fav-btn.active {
  color: var(--fav-color);
  background: rgba(0,0,0,0.65);
  transform: scale(1.1);
}

.fav-btn.active {
  text-shadow: 0 0 8px rgba(230, 168, 23, 0.6);
}

.fav-btn-lg {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: rgba(150,150,150,0.6);
  cursor: pointer;
  transition: 0.2s;
}

.fav-btn-lg.active, .fav-btn-lg:hover {
  color: var(--fav-color);
}

.modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal-title-row h2 {
  margin: 0;
  flex: 1;
}

/* Theme toggle & fav count */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#themeToggle, #favToggle {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--color-text);
  transition: 0.2s;
}

#themeToggle:hover, #favToggle:hover, #favToggle.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

#favCount {
  display: none;
  background: var(--fav-color);
  color: #1a1410;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
}

/* Extra filters row */
.filters-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  justify-content: center;
}

.filters-extra select {
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  font-size: 0.9rem;
  cursor: pointer;
}

.web-btn {
  border-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
}

.page-info {
  padding: 0.5rem 1rem;
  font-weight: 600;
}

.empty-msg {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-light);
  padding: 2.5rem;
}

/* Curiosidades */
.curiosidades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
}

.curiosidad-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.curiosidad-card .num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.curiosidad-card p {
  font-size: 0.92rem;
  color: var(--color-text-light);
  line-height: 1.55;
}

/* Popup map */
.popup-btn {
  margin-top: 6px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #5D2E0A;
  background: #F8F4EF;
  font-size: 0.85rem;
}

html.dark .popup-btn {
  background: #2a211c;
  color: #e8e0d5;
  border-color: #c47840;
}

/* Hero improve */
.hero {
  background: linear-gradient(160deg, #3d1f08 0%, #5D2E0A 40%, #2a1810 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("https://images.unsplash.com/photo-1533154683836-84ea7a0bc310?w=1600&q=60") center/cover;
  opacity: 0.25;
  z-index: 0;
}

.hero-overlay { z-index: 1; }
.hero-content { position: relative; z-index: 2; }

/* Smooth image load */
.castle-img img {
  opacity: 0;
  animation: imgFade 0.4s ease forwards;
}

@keyframes imgFade {
  to { opacity: 1; }
}

/* Better mobile nav */
@media (max-width: 1100px) {
}

/* Skeleton-ish for loading feel */
.castle-card {
  animation: cardIn 0.35s ease backwards;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.castle-card:nth-child(1) { animation-delay: 0.02s; }
.castle-card:nth-child(2) { animation-delay: 0.05s; }
.castle-card:nth-child(3) { animation-delay: 0.08s; }
.castle-card:nth-child(4) { animation-delay: 0.11s; }
.castle-card:nth-child(5) { animation-delay: 0.14s; }
.castle-card:nth-child(6) { animation-delay: 0.17s; }

/* ===== v4: Search suggestions, gallery, tags, SEO polish ===== */

.search-suggestions {
  display: none;
  position: absolute;
  left: 0; right: 0; top: 100%;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
}

.search-suggestions.open { display: block; }

.suggest-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  padding: 0.7rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s;
}

.suggest-item:hover, .suggest-item:focus {
  background: var(--color-primary);
  color: #fff;
}

.suggest-name { font-weight: 600; font-size: 0.95rem; }
.suggest-meta { font-size: 0.8rem; opacity: 0.75; margin-top: 2px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0; }
.tag-chip {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  background: rgba(93, 46, 10, 0.12);
  color: var(--color-primary-dark);
  border: 1px solid rgba(93, 46, 10, 0.2);
}

html.dark .tag-chip {
  background: rgba(196, 120, 64, 0.15);
  color: var(--color-primary-dark);
  border-color: rgba(196, 120, 64, 0.3);
}

/* Gallery in modal */
.modal-gallery {
  position: relative;
  width: 100%;
  height: 260px;
  background: #1a1410;
  overflow: hidden;
}

.modal-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.gal-nav:hover { background: rgba(0,0,0,0.75); }
.gal-prev { left: 10px; }
.gal-next { right: 10px; }

.gal-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}

.gal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 0;
}

.gal-dot.active { background: #fff; transform: scale(1.2); }

#langToggle {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

#langToggle:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

@media (max-width: 600px) {
  .modal-gallery { height: 200px; }
}

/* ===== Legal pages + Cookie banner ===== */
.legal-content {
  max-width: 760px;
  line-height: 1.7;
}
.legal-content h2 {
  font-family: var(--font-display);
  color: var(--color-primary-dark);
  margin: 1.75rem 0 0.75rem;
  font-size: 1.25rem;
}
.legal-content ul {
  margin: 0.75rem 0 1rem 1.25rem;
}
.legal-content li {
  margin-bottom: 0.4rem;
}
.legal-content a {
  color: var(--color-primary);
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -8px 30px rgba(0,0,0,0.15);
  padding: 1rem 1.25rem;
}
.cookie-banner[hidden] {
  display: none !important;
}
.cookie-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}
.cookie-inner p {
  flex: 1 1 280px;
  font-size: 0.9rem;
  color: var(--color-text);
  margin: 0;
  line-height: 1.5;
}
.cookie-inner a {
  color: var(--color-primary);
  text-decoration: underline;
}
.cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
html.dark .cookie-banner {
  background: #2a211c;
  border-top-color: #3d322a;
}
.checkbox-legal input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

/* ===== Historia timeline + Suno footer ===== */
.historia-intro {
  max-width: 720px;
  margin: 0 auto 2rem;
  text-align: center;
  color: var(--color-text-light);
  line-height: 1.65;
}

.timeline {
  max-width: 800px;
  margin: 0 auto;
  border-left: 3px solid var(--color-primary);
  padding-left: 1.5rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.75rem;
  padding-bottom: 0.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.7rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-card);
  box-shadow: 0 0 0 2px var(--color-primary);
}

.timeline-year {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.timeline-item h3 {
  font-family: var(--font-display);
  color: var(--color-primary-dark);
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.timeline-item p, .timeline-item ul {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.6;
}

.timeline-item ul {
  margin: 0.5rem 0 0.5rem 1.2rem;
}

.historia-tipos {
  margin-top: 2.5rem;
  text-align: center;
}

.historia-tipos h3 {
  font-family: var(--font-display);
  color: var(--color-primary-dark);
  margin-bottom: 1.25rem;
}

.tipos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
  max-width: 900px;
  margin: 0 auto;
}

.tipo-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow);
}

.tipo-card strong {
  color: var(--color-primary-dark);
  font-size: 0.95rem;
}

.tipo-card span {
  font-size: 0.8rem;
  color: var(--color-text-light);
  line-height: 1.4;
}

.historia-nota {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--color-text-light);
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.footer-music {
  margin: 1.5rem 0 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer-music h4 {
  font-family: var(--font-display);
  color: var(--color-primary-dark);
  margin-bottom: 0.35rem;
}

.footer-music-note {
  font-size: 0.88rem;
  color: var(--color-text-light);
  margin-bottom: 0.85rem;
}

.suno-embed-wrap {
  max-width: 760px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1410;
}

.suno-embed-wrap iframe {
  display: block;
  width: 100%;
  max-width: 760px;
  height: 240px;
  border: none;
}

@media (max-width: 600px) {
  .suno-embed-wrap iframe { height: 200px; }
  .timeline { padding-left: 1.15rem; }
}

/* ===== Cerca de mí / geolocalización ===== */
.near-me-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  justify-content: center;
}
.near-me-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text-light);
}
.near-me-label select {
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  font-size: 0.9rem;
}
.near-me-results {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.near-me-results h3 {
  font-family: var(--font-display);
  color: var(--color-primary-dark);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}
.near-me-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.near-me-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-border);
}
.near-me-list li:last-child { border-bottom: none; }
.near-me-list .nm-name {
  font-weight: 600;
  color: var(--color-text);
  flex: 1 1 160px;
}
.near-me-list .nm-dist {
  font-size: 0.85rem;
  color: var(--color-primary);
  font-weight: 700;
  min-width: 4.5rem;
}
.near-me-list .nm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.near-me-status {
  font-size: 0.92rem;
  color: var(--color-text-light);
  margin: 0;
}
.near-me-status.error { color: #b33; }

.map-geo-note {
  max-width: 720px;
  margin: 0 auto 1.25rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.55;
  padding: 0.85rem 1rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.map-geo-note strong { color: var(--color-primary-dark); }


/* ===== HEADER MÓVIL DEFINITIVO (siempre hamburguesa a la DERECHA) ===== */
.header {
  position: relative !important;
  overflow: visible !important;
}
.header-inner {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem;
  position: relative;
  min-height: 56px;
}
.logo {
  flex: 0 0 auto;
  z-index: 5;
}
.header-motto {
  display: none;
  flex-direction: column;
  line-height: 1.15;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.motto-text {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-style: italic;
  color: var(--color-primary);
}
.header-clock {
  font-size: 0.68rem;
  color: var(--color-text-light);
  font-variant-numeric: tabular-nums;
}
.menu-toggle {
  display: none;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  min-width: 46px;
  margin-left: auto; /* empuja a la DERECHA */
  padding: 0;
  background: #5D2E0A;
  border: 2px solid #C4A35A;
  border-radius: 10px;
  cursor: pointer;
  z-index: 30;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2.5px;
  background: #F8F4EF;
  border-radius: 1px;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}
.nav-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 0.5rem 0.25rem;
  border-top: 1px solid var(--color-border);
  margin-top: 0.35rem;
}

/* Escritorio: menú horizontal, sin hamburguesa */
@media (min-width: 1101px) {
  .header-motto { display: flex; }
  .menu-toggle { display: none !important; }
  .nav {
    display: flex !important;
    position: static !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    max-height: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }
  .nav-tools {
    border-top: none;
    margin-top: 0;
    padding: 0 0 0 0.5rem;
  }
  .nav-link {
    border-bottom: none !important;
    width: auto !important;
  }
}

/* Móvil / tablet: SOLO logo + hamburguesa derecha */
@media (max-width: 1100px) {
  .header-motto {
    display: flex !important;
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    margin: 0;
    padding: 0.15rem 0 0.25rem;
  }
  .header-inner {
    flex-wrap: wrap !important;
  }
  .logo { order: 1; }
  .menu-toggle { order: 2; }
  .nav { order: 4; }

  .menu-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-left: auto !important;
  }
  .nav {
    display: none;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: min(75vh, 560px);
    overflow-y: auto;
    flex-direction: column !important;
    background: var(--color-card) !important;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
    z-index: 40 !important;
    padding: 0.5rem 1rem 1rem !important;
  }
  .nav.open {
    display: flex !important;
  }
  .nav-link {
    display: block !important;
    width: 100% !important;
    font-size: 1.05rem !important;
    padding: 0.85rem 0.6rem !important;
    border-bottom: 1px solid var(--color-border) !important;
    text-align: left !important;
  }
}

/* En móvil muy estrecho el lema va debajo si se desea — opcional */
@media (max-width: 1100px) {
  .header-inner {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }
}

/* ===== Vídeos YouTube ===== */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 1.25rem;
}
.video-card {
  display: flex;
  flex-direction: column;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.12);
  border-color: var(--color-primary);
  color: inherit;
}
.video-thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #c62828, #8B0000);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 0.85rem;
}
.video-card h3 {
  font-family: var(--font-display);
  color: var(--color-primary-dark);
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}
.video-card p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 0.75rem;
}
.video-cta {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-primary);
}

/* Vídeos visuales */
.videos-grid-visual {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}
.video-card-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 220px;
  padding: 1.25rem;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  color: #fff !important;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.video-card-visual:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 14px 36px rgba(0,0,0,0.25);
  color: #fff !important;
}
.video-card-visual h3 {
  color: #fff !important;
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0.35rem 0 0.2rem;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
.video-card-visual p {
  color: rgba(255,255,255,0.9) !important;
  font-size: 0.88rem;
  margin: 0;
}
.play-badge {
  display: inline-block;
  background: rgba(198,40,40,0.95);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  width: fit-content;
}

/* Galería horizontal */
.photo-strip {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.photo-strip-item {
  flex: 0 0 240px;
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  background: var(--color-card);
}
.photo-strip-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.photo-strip-item:hover img { transform: scale(1.06); }
.photo-strip-item .ps-caption {
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-strip-section .section-header { margin-bottom: 1.25rem; }

/* BIC + Constructor + Quiz + design polish */
.bic-box {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.75rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  line-height: 1.65;
}
.tipo-epoca {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-primary-dark);
}
.timeline-rich .timeline-item {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}
.constructor-app {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 800px) {
  .constructor-app { grid-template-columns: 1fr; }
}
.constructor-controls {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.constructor-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-light);
}
.constructor-controls select {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.95rem;
}
.constructor-result {
  background: linear-gradient(145deg, #2C2416, #5D2E0A 50%, #3d2810);
  color: #fff;
  border-radius: calc(var(--radius) + 4px);
  padding: 1.75rem 1.5rem;
  text-align: center;
  min-height: 280px;
  box-shadow: 0 12px 40px rgba(45, 30, 12, 0.35);
}
.castle-visual {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}
.constructor-result h3 {
  font-family: var(--font-display);
  color: var(--color-primary-light);
  margin-bottom: 0.65rem;
}
.constructor-result p {
  font-size: 0.95rem;
  opacity: 0.92;
  line-height: 1.55;
}
.constructor-share {
  margin-top: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1rem;
}
.quiz-q {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin-top: 1rem;
}
.quiz-result-card {
  text-align: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 480px;
  margin: 1rem auto;
  box-shadow: var(--shadow);
}
.quiz-result-card strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--color-primary-dark);
  display: block;
  margin-bottom: 0.5rem;
}
.share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}
.share-btn {
  font-size: 0.8rem;
  padding: 0.4rem 0.65rem;
}

/* Maqueta 3D */
.castle-3d-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 1rem;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, rgba(196,163,90,0.25), transparent 55%),
              linear-gradient(180deg, #1a120c 0%, #2c2416 100%);
  border: 1px solid rgba(196,163,90,0.35);
  aspect-ratio: 16 / 10;
  min-height: 240px;
}
#castle3d {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
.castle-3d-hint {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
  pointer-events: none;
  margin: 0;
}
.constructor-result {
  background: linear-gradient(165deg, #1a120c 0%, #3d2810 45%, #2c2416 100%);
}

/* ===== Comunidades índice A–Z + pro polish ===== */
.page-header-pro {
  background: linear-gradient(135deg, #1a120c 0%, #5D2E0A 45%, #3d2810 100%);
  color: #fff;
  padding: 2.5rem 0 2rem;
  margin-top: 0;
  text-align: center;
}
.page-header-pro .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--color-primary-light);
  margin-bottom: 0.5rem;
}
.page-header-pro h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.5rem;
}
.page-header-pro p {
  opacity: 0.88;
  max-width: 560px;
  margin: 0 auto;
}
.com-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.com-search {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  font-size: 1rem;
  box-shadow: var(--shadow);
}
.letter-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}
.letter-btn {
  min-width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.15s;
}
.letter-btn:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.letter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.letter-btn.empty,
.letter-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.com-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}
.com-chip {
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text);
}
.com-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.com-status {
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}
.com-letter-title {
  font-family: var(--font-display);
  color: var(--color-primary);
  font-size: 1.75rem;
  border-bottom: 2px solid var(--color-primary-light);
  padding-bottom: 0.35rem;
  margin: 1.5rem 0 0.75rem;
}
.com-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.com-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.com-item:hover {
  border-color: var(--color-primary);
  transform: translateX(3px);
}
.com-item-letter {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  background: rgba(93, 46, 10, 0.1);
  color: var(--color-primary);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.com-item-body {
  flex: 1;
  min-width: 0;
}
.com-item-body h3 {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  color: var(--color-primary-dark);
}
.com-item-body p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-light);
}
.com-empty {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-light);
}

/* Pro service cards */
.service-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}
.service-card .icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.constructor-share .btn {
  min-height: 40px;
}

.real-example {
  margin-top: 1.25rem;
  text-align: left;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(196,163,90,0.35);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}
.real-example-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary-light);
  margin-bottom: 0.5rem;
}
.real-example-inner {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}
.real-example-inner img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: #2a211c;
}
.real-example-inner strong {
  display: block;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}
.real-example-inner p {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  opacity: 0.9;
  text-align: left;
}

/* =========================================================
   FIX CRÍTICO MENÚ MÓVIL — máxima prioridad, no tocar orden
   ========================================================= */
@media screen and (max-width: 1100px) {
  header.header {
    overflow: visible !important;
  }
  header.header .header-inner,
  .header .header-inner,
  .header-inner {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: relative !important;
  }
  header.header .logo,
  .header .logo {
    order: 1 !important;
    flex: 0 0 auto !important;
    max-width: calc(100% - 60px) !important;
  }
  header.header .menu-toggle,
  .header .menu-toggle,
  button.menu-toggle,
  #menuToggle {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    order: 2 !important;
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    margin-left: auto !important;
    position: relative !important;
    z-index: 9999 !important;
    background: #5D2E0A !important;
    border: 2px solid #C4A35A !important;
    border-radius: 10px !important;
    padding: 0 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
  }
  header.header .menu-toggle span,
  #menuToggle span {
    display: block !important;
    width: 20px !important;
    height: 2.5px !important;
    background: #F8F4EF !important;
    margin: 0 auto !important;
  }
  header.header .header-motto,
  .header-motto {
    order: 3 !important;
    flex: 1 0 100% !important;
    display: flex !important;
    width: 100% !important;
  }
  header.header nav.nav,
  .header nav.nav,
  nav#nav {
    display: none !important;
    order: 4 !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: min(75vh, 560px) !important;
    overflow-y: auto !important;
    flex-direction: column !important;
    background: var(--color-card, #F8F4EF) !important;
    z-index: 9998 !important;
    padding: 0.5rem 1rem 1rem !important;
    box-shadow: 0 12px 32px rgba(0,0,0,0.2) !important;
    border-bottom: 1px solid var(--color-border, #ddd) !important;
  }
  header.header nav.nav.open,
  .header nav.nav.open,
  nav#nav.open {
    display: flex !important;
  }
  nav#nav.open .nav-link {
    display: block !important;
    width: 100% !important;
    padding: 0.9rem 0.6rem !important;
    border-bottom: 1px solid var(--color-border, #e5e0d8) !important;
    font-size: 1.05rem !important;
  }
}

@media screen and (min-width: 1101px) {
  header.header .menu-toggle,
  #menuToggle {
    display: none !important;
  }
  header.header nav.nav,
  nav#nav {
    display: flex !important;
    position: static !important;
  }
}


/* ===== Cabecera NO fija: hace scroll con la página ===== */
header.header,
.header {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  transform: none !important;
}
.hero {
  padding-top: 2rem !important;
}
.page-header,
.page-header-pro {
  padding-top: 2rem !important;
  margin-top: 0 !important;
}
.share-bar {
  position: relative !important;
  top: auto !important;
}

/* Menú móvil siempre visible (hamburguesa derecha) */
@media screen and (max-width: 1100px) {
  #menuToggle,
  button.menu-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    margin-left: auto !important;
    z-index: 9999 !important;
    background: #5D2E0A !important;
    border: 2px solid #C4A35A !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    border-radius: 10px !important;
    cursor: pointer !important;
  }
  #menuToggle span,
  button.menu-toggle span {
    display: block !important;
    width: 20px !important;
    height: 2.5px !important;
    background: #F8F4EF !important;
  }
  nav#nav:not(.open) {
    display: none !important;
  }
  nav#nav.open {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #F8F4EF !important;
    z-index: 9998 !important;
    max-height: 75vh !important;
    overflow-y: auto !important;
    padding: 0.5rem 1rem 1rem !important;
    box-shadow: 0 12px 32px rgba(0,0,0,0.2) !important;
  }
}
@media screen and (min-width: 1101px) {
  #menuToggle { display: none !important; }
  nav#nav {
    display: flex !important;
    position: static !important;
  }
}

/* ===== Mobile overflow safety ===== */
@media (max-width: 1100px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  .header, .header-inner, .nav, .share-bar, .section, .hero,
  .map-container, .castles-grid, .filters, .footer-grid {
    max-width: 100%;
  }
  .map-container {
    overflow: hidden;
  }
  /* Prevent Leaflet tiles from causing horizontal scroll */
  .leaflet-container {
    max-width: 100% !important;
  }
}

/* =========================================================
   RESPONSIVE MEJORADO — Constructor + secciones clave
   ========================================================= */

/* Constructor: controles más táctiles y resultado adaptado */
.constructor-controls select,
.constructor-controls button {
  width: 100%;
  min-height: 44px;
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
}
.constructor-controls .btn {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.85rem 1rem;
  font-size: 1rem;
}
.constructor-result {
  padding: 1.25rem 1rem;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.castle-3d-wrap {
  aspect-ratio: 4 / 3;
  min-height: 200px;
  max-height: 420px;
}
.constructor-share {
  flex-direction: column;
  align-items: stretch;
}
.constructor-share .btn {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

/* Ejemplo real: apilar en móvil */
@media (max-width: 600px) {
  .real-example-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .real-example-inner img {
    width: 100%;
    height: 160px;
    max-width: 100%;
  }
  .real-example-inner .btn {
    width: 100%;
    margin-top: 0.35rem;
  }
  .constructor-result h3 {
    font-size: 1.15rem;
  }
  .constructor-result p {
    font-size: 0.9rem;
  }
  .castle-3d-wrap {
    aspect-ratio: 1 / 1;
    min-height: 220px;
    max-height: 320px;
  }
  .castle-3d-hint {
    font-size: 0.7rem;
    bottom: 6px;
  }
}

/* Constructor: breakpoint intermedio */
@media (max-width: 900px) {
  .constructor-app {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .constructor-controls {
    padding: 1rem;
  }
}

/* Secciones: menos padding en móvil */
@media (max-width: 600px) {
  .section {
    padding: 2.75rem 0;
  }
  .section-header {
    margin-bottom: 1.5rem;
  }
  .section-header h2 {
    font-size: 1.45rem;
  }
  .section-header p {
    font-size: 0.95rem;
    padding: 0 0.25rem;
  }
  .container {
    padding: 0 1rem;
  }
  .hero {
    min-height: auto;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
  }
  .hero-content {
    padding: 2rem 1rem 1.5rem;
  }
  .hero h1 {
    font-size: clamp(1.85rem, 8vw, 2.6rem);
  }
  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-bottom: 2rem;
  }
  .hero-actions .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }
  .hero-stats {
    gap: 1rem 1.5rem;
  }
  .stat-num {
    font-size: 1.35rem;
  }
  .stat-label {
    font-size: 0.75rem;
  }
}

/* Filtros y búsqueda más usables en móvil */
@media (max-width: 600px) {
  .filters {
    gap: 0.4rem;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
  .filter-btn {
    flex-shrink: 0;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }
  .filters-extra {
    flex-direction: column;
    align-items: stretch;
  }
  .filters-extra select {
    width: 100%;
    min-height: 44px;
  }
  .near-me-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .near-me-label {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .near-me-label select,
  .near-me-bar .btn {
    width: 100%;
    min-height: 44px;
  }
  .near-me-list li {
    flex-direction: column;
    align-items: flex-start;
  }
  .near-me-list .nm-actions {
    width: 100%;
  }
  .near-me-list .nm-actions .btn {
    flex: 1;
  }
}

/* Cards de castillos y botones en móvil */
@media (max-width: 480px) {
  .castle-actions {
    flex-direction: column;
  }
  .castle-actions .btn {
    width: 100%;
    min-width: 0;
  }
  .castle-body h3 {
    font-size: 1.05rem;
  }
  .share-bar {
    top: 60px;
    padding: 0.55rem 0.65rem;
    gap: 0.35rem;
  }
  .share-label {
    width: 100%;
    text-align: center;
    margin-right: 0;
    margin-bottom: 0.15rem;
  }
  .share-btn {
    flex: 1 1 auto;
    text-align: center;
    min-height: 40px;
  }
  .modal-body {
    padding: 1.15rem 1rem 1.35rem;
  }
  .modal-body h2 {
    font-size: 1.25rem;
    padding-right: 2rem;
  }
  .modal-actions {
    flex-direction: column;
  }
  .modal-actions .btn {
    width: 100%;
  }
  .quiz-options {
    flex-direction: column;
    align-items: stretch;
  }
  .quiz-options .btn,
  .quiz-options button {
    width: 100%;
    min-height: 48px;
  }
  .bic-box {
    padding: 1.15rem 1rem;
  }
  .page-header {
    padding: 5.5rem 0 2rem;
  }
  .page-header h1 {
    font-size: 1.55rem;
  }
}

/* Map container full width safety */
@media (max-width: 600px) {
  .map-container {
    height: 320px;
    border-radius: 10px;
  }
  .intro-card {
    padding: 1.25rem;
  }
  .route-card,
  .monetiza-card,
  .service-card {
    padding: 1.25rem;
  }
  .footer-grid {
    gap: 1.5rem;
  }
}

/* Tipos de castillo: 2 columnas en móvil pequeño */
@media (max-width: 400px) {
  .tipos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Dark mode adjustments for constructor on mobile */
html.dark .constructor-controls {
  background: #2a211c;
  border-color: #3d3228;
}
html.dark .constructor-controls select {
  background: #1a1510;
  color: #f0e8dc;
  border-color: #3d3228;
}
