/*======================================
   Modern Design System - Municipalidad de Wanda
   Cargado después de main.css - sobreescribe estilos clave
   Preserva identidad: rojo #e41c13, verde #88C250, Poppins
========================================*/

/* ======================================
   1. DESIGN TOKENS
   ====================================== */
:root {
  /* Brand Colors - Preserved Identity */
  --color-primary: #e41c13;
  --color-primary-dark: #c7160d;
  --color-primary-light: #fe3c33;
  --color-secondary: #006838;
  --color-accent: #88C250;

  /* Neutrals */
  --color-dark: #081828;
  --color-dark-soft: #1e293b;
  --color-text: #475569;
  --color-text-light: #64748b;
  --color-border: #e2e8f0;
  --color-bg: #F8FAFC;
  --color-bg-alt: #F1F5F9;
  --color-white: #ffffff;

  /* Typography */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Poppins', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;

  /* Shadows - Modern Soft */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

/* ======================================
   2. TYPOGRAPHY & BASE
   ====================================== */
body {
  color: var(--color-text);
  font-size: var(--font-size-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

p {
  font-size: var(--font-size-base);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--color-dark);
  letter-spacing: -0.01em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

select {
  font: 400 var(--font-size-base);
}

.body-areas {
  background-color: var(--color-bg);
}

/* ======================================
   3. ACCESSIBILITY & REDUCED MOTION
   ====================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.skip-to-content {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 1000;
  background: var(--color-primary);
  color: #fff;
  padding: 8px 16px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: top var(--transition-base);
}

.skip-to-content:focus {
  top: 4px;
  left: 4px;
}

.navbar-toggler:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
button:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
  outline: none;
}

/* ======================================
   4. NAVBAR - Glass Effect Moderno
   ====================================== */
.navbar-area {
  top: 12px;
  transition: all var(--transition-base);
}

.navbar-area.sticky {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  top: 0 !important;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.header .nav-inner {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.navbar-area.sticky .nav-inner {
  box-shadow: none;
  border-radius: 0;
}

.navbar-brand img {
  width: 220px;
  transition: width var(--transition-base);
}

.sticky .navbar-brand img {
  width: 170px;
}

.navbar-nav .nav-item {
  margin-right: 32px;
}

.navbar-nav .nav-item a {
  font-size: var(--font-size-sm);
  color: var(--color-dark);
  padding: 32px 0;
  font-weight: 500;
  text-transform: none;
  transition: color var(--transition-fast);
}

.navbar-nav .nav-item a::before {
  bottom: 8px;
  height: 2px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.navbar-nav .nav-item:hover a,
.navbar-nav .nav-item a.active {
  color: var(--color-primary);
}

.navbar-nav .nav-item .sub-menu {
  padding: 8px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.navbar-nav .nav-item:hover>.sub-menu {
  top: calc(100% + 4px);
}

.navbar-nav .nav-item .sub-menu .nav-item {
  margin-bottom: 2px;
}

.navbar-nav .nav-item .sub-menu .nav-item a {
  padding: 10px 14px;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: 400;
  text-transform: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.navbar-nav .nav-item .sub-menu .nav-item a::before {
  background-color: var(--color-primary);
  border-radius: var(--radius-sm);
}

.navbar-nav .nav-item .sub-menu .nav-item a:hover {
  color: #fff;
}

.navbar-nav .nav-item .sub-menu>li.active>a {
  background-color: var(--color-primary);
}

/* ======================================
   5. BREADCRUMBS
   ====================================== */
.breadcrumbs {
  padding-bottom: 70px;
  padding-top: 140px;
}

.breadcrumbs.overlay::before {
  background-color: var(--color-dark);
  opacity: 0.7;
}

.breadcrumbs .breadcrumbs-content .page-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.breadcrumbs .breadcrumb-nav li,
.breadcrumbs .breadcrumb-nav li a {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--font-size-sm);
  transition: color var(--transition-fast);
}

.breadcrumbs .breadcrumb-nav li a:hover {
  text-decoration: none;
  color: #fff;
}

/* ======================================
   6. SECTION TITLES
   ====================================== */
.section {
  padding-top: 80px;
  padding-bottom: 80px;
}

.section-title {
  margin-bottom: 60px;
  padding: 0 200px;
}

.section-title h3 {
  font-size: 64px;
  top: -30px;
  opacity: 0.35;
  letter-spacing: 0.02em;
}

.section-title h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: 16px;
  padding-bottom: 16px;
  line-height: 1.35;
  color: var(--color-dark);
}

.section-title h2:before {
  height: 3px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

.section-title h2:after {
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

.section-title p {
  font-size: var(--font-size-base);
  line-height: 1.7;
}

/* ======================================
   7. BUTTONS & BADGES
   ====================================== */
.button .btn {
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: 12px 28px;
  background-color: var(--color-primary);
  border-radius: var(--radius-md);
  text-transform: none;
  letter-spacing: 0.01em;
  transition: all var(--transition-base);
}

.button .btn::before {
  background-color: var(--color-dark);
  border-radius: var(--radius-md);
  transition: width var(--transition-base);
}

.button .btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.button .btn-alt {
  background-color: var(--color-dark);
}

.btn-red {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  border-radius: var(--radius-md);
  font-weight: 600;
  padding: 10px 24px;
  transition: all var(--transition-base);
}

.btn-red:hover {
  background-color: var(--color-dark) !important;
  border-color: var(--color-dark) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-check:focus+.btn-red,
.btn-red:focus {
  box-shadow: 0 0 0 .25rem rgba(228, 28, 19, .35) !important;
}

.badge-red {
  padding: .35em .75em;
  font-size: .85em;
  font-weight: 600;
  border-radius: var(--radius-full);
  background-color: var(--color-primary) !important;
}

/* ======================================
   8. CARDS: Áreas, Noticias, Info
   ====================================== */
.area-card {
  border: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.area-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.area-card-header {
  padding: .75rem 1rem;
  background-color: var(--color-primary) !important;
  border-bottom: none;
  min-height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.area-card-title {
  font-weight: 700;
  font-size: 1rem !important;
  letter-spacing: 0.02em;
}

.area-card-body {
  padding: 1rem;
  color: var(--color-text);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 84px;
}

.info-card {
  border: none;
  border-radius: var(--radius-md);
  background-color: var(--color-dark-soft);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.info-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.info-card-header {
  padding: .75rem 1rem;
  background-color: var(--color-primary) !important;
  border-bottom: none;
  min-height: 65px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.info-card-title {
  font-weight: 700;
  font-size: 1rem !important;
  letter-spacing: 0.02em;
}

.info-card-body {
  background-color: transparent;
  color: var(--color-white);
  padding: 1rem 0.5rem;
}

.info-card-body li {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

/* ======================================
   9. ACHIEVEMENT / EMERGENCY PHONES
   ====================================== */
.np-icon {
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.95);
  font-size: 32px;
  color: var(--color-secondary);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.np-icon:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.our-achievement {
  background-color: var(--color-primary);
  padding: 60px 0;
}

.our-achievement .single-achievement h3 {
  color: #fff;
  font-size: var(--font-size-3xl);
}

.our-achievement .single-achievement p {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--font-size-base);
  font-weight: 500;
}

/* ======================================
   10. SERVICES BUTTONS (Homepage)
   ====================================== */
.btn-service {
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
}

.btn-service:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-service a { color: var(--color-primary); }
.btn-service:hover a { color: #fff; }

.btn-service .icono span {
  font-size: 2.5em;
  transition: transform var(--transition-base);
}

.btn-service:hover .icono span {
  transform: scale(1.1);
  color: #fff;
}

.btn-service .titulo {
  font-size: var(--font-size-sm);
}

/* Department Action buttons */
.da {
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  cursor: pointer;
}

.da:hover {
  background-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.da a { color: var(--color-primary); }
.da:hover a { color: #fff; }

.da-icon span {
  font-size: 2.5em;
  transition: transform var(--transition-base);
}

.da:hover .da-icon span {
  transform: scale(1.1);
  color: #fff;
}

.da-title {
  font-size: var(--font-size-sm);
}

/* ======================================
   11. FLOATING SCROLL-TOP BUTTON
   ====================================== */
.scroll-top {
  width: 44px;
  height: 44px;
  line-height: 44px;
  background: var(--color-primary);
  font-size: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.scroll-top:hover {
  background-color: var(--color-dark);
  box-shadow: var(--shadow-lg);
  transform: translate3d(0, -4px, 0);
}

/* ======================================
   12. FOOTER
   ====================================== */
.footer.overlay::before {
  background-color: var(--color-dark);
  opacity: 0.88;
}

.footer .footer-middle {
  padding: 60px 0 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer .single-footer.f-about p {
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.footer .single-footer.f-about .social li a {
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  font-size: 16px;
  transition: all var(--transition-fast);
}

.footer .single-footer.f-about .social li a:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.footer .single-footer h3 {
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 20px;
  color: #fff;
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.footer .single-footer h3:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

.footer .single-footer.f-about .logo a h3 {
  padding-bottom: 0;
  margin-bottom: 0;
}

.footer .single-footer.f-about .logo a h3:after {
  display: none;
}

.footer .single-footer.f-link li a {
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
}

.footer .single-footer.f-link li a:hover {
  color: var(--color-primary);
}

.footer .single-footer.opening-hours ul li {
  color: rgba(255, 255, 255, 0.75);
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
}

.footer .single-footer.opening-hours ul li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.footer .single-footer.opening-hours ul li .time {
  font-weight: 500;
}

.footer .single-footer.f-contact ul li {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--font-size-sm);
}

.footer .single-footer.f-contact ul li i {
  color: var(--color-primary);
}

.footer .footer-bottom .copyright-text {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--font-size-xs);
}

.footer .footer-bottom .copyright-text a {
  color: var(--color-primary);
  font-weight: 500;
}

.footer .footer-bottom .copyright-text a:hover {
  color: #fff;
}

.footer .footer-bottom .extra-link li a {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--font-size-xs);
  transition: color var(--transition-fast);
}

.footer .footer-bottom .extra-link li a:hover {
  color: #fff;
}

/* ======================================
   13. CALL-ACTION SECTION
   ====================================== */
.call-action {
  padding: 100px 0;
}

.call-action .card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ======================================
   14. INFO HEADER
   ====================================== */
.info-header {
  font-size: calc(1.1rem + .2vw) !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  color: #fff;
  background-color: var(--color-dark-soft);
  height: 50px;
  margin-bottom: 30px;
  padding-left: 16px;
  padding-top: 8px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--color-primary);
  border-bottom: none;
}

/* ======================================
   15. PAGINATION
   ====================================== */
.pagination .pagination-list li a {
  background: var(--color-white);
  color: var(--color-dark);
  font-weight: 500;
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.pagination .pagination-list li.active a,
.pagination .pagination-list li:hover a {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ======================================
   16. UTILITY CLASSES
   ====================================== */
.text-red {
  color: var(--color-primary);
}

.title-custom {
  font-size: var(--font-size-3xl);
  color: var(--color-dark);
  font-weight: 700;
  line-height: 1.3;
}

.titulo-cargo {
  font-weight: 600;
  color: var(--color-primary);
}

.historia-title {
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--color-dark);
  line-height: 1.3;
}

.historia-text {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--color-text);
}

.section-areas {
  background-color: var(--color-dark-soft);
}

.main {
  margin-top: 70px;
  margin-bottom: 70px;
}

.sec-historia {
  margin-top: 70px;
  margin-bottom: 60px;
}

.news a {
  color: var(--color-primary);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.news a:hover {
  color: var(--color-dark);
}

.news .card-img-top {
  aspect-ratio: 16 / 9;
  position: relative;
}

.news .card-img-top > a {
  position: absolute;
  inset: 0;
}

.news-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* News detail gallery - uniform aspect ratio */
.news-gallery-link {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.news-gallery-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  max-width: 100% !important;
}

.grow {
  transition: transform var(--transition-base);
}

.grow:hover {
  transform: scale(1.02);
}

.zoom {
  transition: transform var(--transition-base);
}

.zoom:hover {
  transform: scale(1.1);
}

.section-turismo .texto {
  font-size: var(--font-size-lg) !important;
}

/* ======================================
   17. INTERACTIVE ELEMENTS
   ====================================== */
.btn-service,
.da,
.area-card,
.info-card,
.np-icon,
.scroll-top,
.footer .single-footer.f-about .social li a {
  cursor: pointer;
}

/* Equal-height cards in areas grid */
.section-areas .row > [class*="col"] {
  display: flex;
}

.section-areas .row > [class*="col"] > a {
  display: flex;
  width: 100%;
}

/* ======================================
   18. RESPONSIVE TWEAKS
   ====================================== */
@media (max-width: 767px) {
  .navbar-area {
    top: 8px;
  }

  .navbar-brand img {
    width: 160px;
  }

  .section-title {
    padding: 0 20px;
  }

  .section-title h3 {
    font-size: 40px;
    top: -15px;
  }

  .breadcrumbs {
    padding-top: 120px;
    padding-bottom: 50px;
  }

  .footer .footer-middle {
    padding: 40px 0 20px;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .section-title {
    padding: 0 60px;
  }

  .navbar-area {
    top: 10px;
  }
}

/* ======================================
   19. TURISMO SECTION - RESPONSIVE FIXES
   ====================================== */

/* Remove fixed heights that break mobile */
@media (max-width: 1199px) {
  .min-height-400,
  .min-height-500,
  .min-height-550,
  .min-height-600,
  .museo-1-info,
  .museo-2-info,
  .col-mtc {
    min-height: auto !important;
  }
}

/* Card cap - equal height on desktop, natural on mobile */
.card-cap {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-cap img {
  flex-shrink: 0;
}

.card-cap .card-body {
  flex: 1;
}

@media (max-width: 991px) {
  .card-cap {
    min-height: auto !important;
    height: auto;
  }
}

/* Turismo section spacing improvements */
.section-turismo {
  padding: 40px 0;
}

@media (max-width: 767px) {
  .section-turismo {
    padding: 30px 0;
  }

  .section-turismo .badge-red {
    font-size: 1.1rem !important;
    padding: 0.5rem 1rem;
  }

  .section-turismo .texto,
  .section-turismo .fs-5 {
    font-size: 1rem !important;
  }

  /* Thumbnail grids on mobile */
  .section-turismo .row .col-4,
  .section-turismo .row .col-5,
  .section-turismo .row .col-6 {
    padding: 0.25rem;
  }

  .section-turismo .img-thumbnail {
    padding: 0.15rem;
  }
}

/* Large image fills container properly */
.section-turismo .img-thumbnail.w-100 {
  object-fit: cover;
  height: 100%;
}

@media (max-width: 1199px) {
  .section-turismo .img-thumbnail.w-100 {
    height: auto;
    max-height: 400px;
    width: 100%;
    object-fit: cover;
  }
}

/* QR code responsive */
.qr-img {
  max-height: 250px;
  width: auto;
}

@media (max-width: 767px) {
  .qr-img {
    max-height: 180px;
  }
}

/* Contact card improvements */
.section-turismo-llegar .card-radius {
  border-radius: 1rem !important;
}

/* Hospedajes grid improvements */
@media (max-width: 767px) {
  .section-turismo .badge.fs-4 {
    font-size: 1rem !important;
  }
}

/* Ensure flex column layout works properly */
.d-flex.flex-column .flex-grow-1 {
  flex: 1 0 auto;
}

.d-flex.flex-column .mt-auto {
  margin-top: auto !important;
  flex-shrink: 0;
}

/* Text justification on mobile */
@media (max-width: 767px) {
  .text-justify {
    text-align: left !important;
  }
}
