/* ==========================================================================
   MAIN.CSS - SIBGuadua Rediseño Multi-Página
   Manual de Marca 2023:
   Pantone P 157-7 C (#9BC63B) | Pantone P 151-7 C (#6FAE48) | Pantone P 179-11 C (#2B332C)
   ========================================================================== */

:root {
  --color-brand-primary: #52a438;
  --color-brand-light: #9bc63b;
  --color-brand-mid: #6fae48;
  --color-brand-dark: #235933;
  --color-brand-forest: #0c2b1a;
  --color-brand-night: #07190f;
  
  --color-text-main: #2b332c;
  --color-text-muted: #5f6c62;
  --color-text-light: #f3f6f3;
  
  --color-bg-base: #f9fbf8;
  --color-bg-card: #ffffff;
  --color-bg-card-alt: #f1f6ef;
  
  --color-border: #e1e9de;
  --color-border-focus: #52a438;
  
  --shadow-sm: 0 2px 6px rgba(12, 43, 26, 0.05);
  --shadow-md: 0 6px 18px rgba(12, 43, 26, 0.08);
  --shadow-lg: 0 16px 36px rgba(12, 43, 26, 0.12);
  --shadow-hover: 0 12px 28px rgba(35, 89, 51, 0.18);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 50px;
  
  --font-brand: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-script: 'Caveat', cursive, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-brand);
  background-color: var(--color-bg-base);
  color: var(--color-text-main);
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-brand-dark);
  text-decoration: none;
  transition: all 0.25s ease;
}

a:hover {
  color: var(--color-brand-primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   HEADER Y NAVEGACIÓN COMPARTIDA
   ========================================================================== */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.brand-group:hover .brand-logo-img {
  transform: scale(1.03);
}

.brand-divider {
  width: 1px;
  height: 34px;
  background: #ccd7c8;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-brand-dark);
  letter-spacing: -0.2px;
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

nav.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.35rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.6rem 0.8rem;
  font-size: 0.91rem;
  font-weight: 500;
  color: #38453c;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link:focus {
  color: var(--color-brand-primary);
  background: var(--color-bg-card-alt);
}

.nav-link.active {
  color: var(--color-brand-primary);
  font-weight: 700;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.6rem 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item a {
  display: block;
  padding: 0.55rem 1.2rem;
  font-size: 0.86rem;
  color: var(--color-text-main);
  transition: all 0.15s ease;
}

.dropdown-item a:hover {
  background: var(--color-bg-card-alt);
  color: var(--color-brand-primary);
  padding-left: 1.45rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.btn-search-trigger {
  background: none;
  border: none;
  color: #38453c;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-search-trigger:hover {
  background: var(--color-bg-card-alt);
  color: var(--color-brand-primary);
}

.btn-menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  z-index: 1001;
}

.btn-menu-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  background-color: var(--color-brand-dark);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-drawer {
  display: none;
  position: fixed;
  top: 76px;
  left: 0;
  width: 100%;
  height: calc(100vh - 76px);
  background: #ffffff;
  padding: 1.5rem;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 999;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.mobile-nav-list a {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-main);
  display: block;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
}

.mobile-sublinks {
  list-style: none;
  padding-left: 1rem;
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-sublinks a {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-muted);
  border-bottom: none;
  padding: 0.3rem 0;
}

/* ==========================================================================
   BREADCRUMBS PARA PÁGINAS INTERNAS
   ========================================================================== */
.breadcrumbs-bar {
  background: #f1f6ef;
  border-bottom: 1px solid var(--color-border);
  padding: 0.8rem 0;
  font-size: 0.86rem;
}

.breadcrumbs-list {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumbs-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
}

.breadcrumbs-list a {
  color: var(--color-brand-dark);
}

.breadcrumbs-list a:hover {
  color: var(--color-brand-primary);
  text-decoration: underline;
}

.breadcrumbs-list .active {
  color: var(--color-brand-primary);
  font-weight: 600;
}

/* ==========================================================================
   BANNER HERO INTERNO (PARA SUBPÁGINAS)
   ========================================================================== */
.internal-hero-banner {
  background: linear-gradient(135deg, rgba(12, 43, 26, 0.92) 0%, rgba(35, 89, 51, 0.85) 100%),
              url('../assets/botanical-bamboo-forest-daylight.jpg') center/cover no-repeat;
  color: #ffffff;
  padding: 3.8rem 0 3.2rem 0;
  position: relative;
}

.internal-hero-title {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.8rem;
  color: #ffffff;
}

.internal-hero-sub {
  font-size: 1.05rem;
  color: #e2ede5;
  max-width: 750px;
  line-height: 1.6;
}

/* ==========================================================================
   CONTENIDO INTERNO Y GRID
   ========================================================================== */
.page-content-wrapper {
  padding: 3.5rem 0 5rem 0;
}

.internal-layout-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: flex-start;
}

.internal-layout-full {
  display: block;
}

/* Tarjetas y Contenedores */
.content-box {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2.2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.geo-definition-card {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--color-text-main);
  background: #f7faf5;
  border-left: 4px solid var(--color-brand-primary);
  padding: 1.2rem 1.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1.8rem;
}

/* Botones & Pills */
.btn-brand-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-brand-dark);
  color: #ffffff !important;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

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

.btn-brand-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eaf3e5;
  color: var(--color-brand-dark) !important;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid #d4e7cc;
  transition: all 0.25s ease;
}

.btn-brand-secondary:hover {
  background: var(--color-brand-primary);
  color: #ffffff !important;
  border-color: var(--color-brand-primary);
}

/* Grids de Cards de Subpáginas */
.subpages-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.subpage-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.subpage-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-brand-mid);
}

.subpage-card-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

.subpage-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-brand-dark);
  margin-bottom: 0.4rem;
}

.subpage-card-desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 1.2rem;
  flex: 1;
}

.subpage-card-link {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-brand-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Tablas Semánticas */
.table-responsive {
  overflow-x: auto;
  margin: 1.8rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

table.data-table thead {
  background: #edf5ea;
  color: var(--color-brand-dark);
}

table.data-table th {
  padding: 0.9rem 1.1rem;
  font-weight: 700;
  border-bottom: 2px solid #dbead5;
}

table.data-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid #edf1eb;
  color: #38453c;
}

table.data-table tr:nth-child(even) {
  background: #fbfdfa;
}

table.data-table tr:hover {
  background: #f2f7ef;
}

/* Video Embebido */
.video-frame-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin: 1.8rem 0;
  background: #000;
  box-shadow: var(--shadow-md);
}

.video-frame-wrap iframe,
.video-frame-wrap video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Sidebar Widgets */
.sidebar-widget {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.8rem;
}

.sidebar-widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-brand-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-brand-mid);
}

.sidebar-widget-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.88rem;
}

.sidebar-widget-links a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-main);
}

.sidebar-widget-links a:hover {
  background: var(--color-bg-card-alt);
  color: var(--color-brand-primary);
  padding-left: 0.8rem;
}

/* ==========================================================================
   FOOTER INSTITUCIONAL COMPARTIDO
   ========================================================================== */
footer.site-footer {
  background: var(--color-brand-night);
  color: #ffffff;
  padding: 4.5rem 0 2rem 0;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-brand img {
  height: 48px;
  margin-bottom: 1.2rem;
}

.footer-brand p {
  font-size: 0.88rem;
  color: #afc0b4;
  line-height: 1.65;
}

.footer-col h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 1.2rem;
  position: relative;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--color-brand-light);
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.footer-links-list a {
  color: #cbdad0;
}

.footer-links-list a:hover {
  color: #bbf071;
  padding-left: 5px;
}

.footer-social-links {
  display: flex;
  gap: 12px;
  margin-top: 1rem;
}

.social-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.social-btn:hover {
  background: var(--color-brand-primary);
  color: #ffffff;
}

.footer-bottom-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: #8c9f92;
}

/* Modales */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 25, 15, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-window {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  padding: 2rem;
  position: relative;
}

.btn-close-modal {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7a6f;
}

.search-results-list {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.search-result-item {
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.search-result-item:hover {
  background: var(--color-bg-card-alt);
}

@media (max-width: 900px) {
  nav.desktop-nav {
    display: none;
  }
  .btn-menu-toggle {
    display: flex;
  }
  .mobile-drawer {
    display: block;
  }
  .internal-layout-grid {
    grid-template-columns: 1fr;
  }
  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
