﻿/* ===================================================
       VARIABLES
    =================================================== */
    :root {
      --navy:       #1e3a8a;
      --navy-dark:  #152b6b;
      --navy-light: #dbeafe;
      --red:        #c73a4a;
      --red-dark:   #a02d3a;
      --red-light:  #fde8ea;
      --white:      #ffffff;
      --gray-50:    #f8fafc;
      --gray-100:   #f1f5f9;
      --gray-200:   #e2e8f0;
      --gray-400:   #94a3b8;
      --gray-600:   #475569;
      --gray-800:   #1e293b;
      --gray-900:   #0f172a;
      --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
      --shadow-md:  0 4px 12px rgba(0,0,0,.10);
      --shadow-lg:  0 10px 24px rgba(0,0,0,.12);
      --shadow-xl:  0 20px 40px rgba(0,0,0,.14);
      --radius-sm:  6px;
      --radius-md:  12px;
      --radius-lg:  20px;
      --transition: all .28s cubic-bezier(.4,0,.2,1);
    }

    /* ===================================================
       RESET Y BASE
    =================================================== */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }
    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      color: var(--gray-800);
      background: var(--gray-50);
      line-height: 1.65;
      -webkit-font-smoothing: antialiased;
    }
    img { max-width: 100%; height: auto; display: block; }
    a   { text-decoration: none; color: inherit; }
    ul  { list-style: none; }

    /* ===================================================
       NAVEGACIÓN
    =================================================== */
    .navbar {
      position: fixed;
      top: 0; left: 0; right: 0;
      z-index: 1000;
      background: rgba(255,255,255,.96);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border-bottom: 1px solid rgba(226,232,240,.6);
      transition: var(--transition);
    }
    .navbar.scrolled { box-shadow: var(--shadow-md); }
    .nav-inner {
      max-width: 1200px;
      margin: 0 auto;
      padding: 0 28px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: 72px;
    }
    .nav-logo img { height: 46px; width: auto; }
    .nav-links { display: flex; align-items: center; gap: 4px; }
    .nav-link {
      padding: 8px 14px;
      border-radius: var(--radius-sm);
      font-size: .875rem;
      font-weight: 500;
      color: var(--gray-600);
      transition: var(--transition);
      white-space: nowrap;
    }
    .nav-link:hover  { background: var(--navy-light); color: var(--navy); }
    .nav-link.active { background: var(--navy); color: var(--white); }
    .nav-cta {
      margin-left: 8px;
      padding: 10px 20px;
      background: var(--red);
      color: var(--white) !important;
      border-radius: var(--radius-sm);
      font-weight: 700;
      font-size: .85rem;
      transition: var(--transition);
    }
    .nav-cta:hover { background: var(--red-dark) !important; transform: translateY(-1px); }
    .nav-toggle {
      display: none;
      flex-direction: column;
      gap: 5px;
      background: none;
      border: none;
      cursor: pointer;
      padding: 8px;
    }
    .nav-toggle span {
      display: block;
      width: 22px; height: 2px;
      background: var(--gray-800);
      border-radius: 2px;
      transition: var(--transition);
    }
    .nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
    .nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

    /* ===================================================
       CABECERA
    =================================================== */
    .page-header {
      padding-top: 72px;
      background: linear-gradient(135deg, #0b1f54 0%, #1e3a8a 50%, #1d4ed8 100%);
      padding-bottom: 72px;
      position: relative;
      overflow: hidden;
    }
    .page-header::before {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse at 75% 50%, rgba(255,255,255,.06) 0%, transparent 60%);
    }
    .page-header::after {
      content: '';
      position: absolute;
      bottom: -1px; left: 0; right: 0;
      height: 60px;
      background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60'%3E%3Cpath fill='%23f8fafc' d='M0,60 L0,30 C240,60 480,0 720,30 C960,60 1200,0 1440,30 L1440,60 Z'/%3E%3C/svg%3E") center bottom/cover no-repeat;
    }
    .header-inner {
      max-width: 1200px;
      margin: 0 auto;
      padding: 48px 28px 16px;
      position: relative;
      z-index: 1;
    }
    .breadcrumb {
      display: flex; align-items: center; gap: 8px; margin-bottom: 20px;
    }
    .breadcrumb a, .breadcrumb span { font-size: .82rem; font-weight: 500; color: rgba(255,255,255,.6); }
    .breadcrumb a:hover { color: rgba(255,255,255,.9); }
    .breadcrumb .sep { color: rgba(255,255,255,.3); }
    .breadcrumb .current { color: rgba(255,255,255,.9); }

    .header-inner h1 {
      font-size: clamp(1.9rem, 4.5vw, 3rem);
      font-weight: 800;
      color: var(--white);
      margin-bottom: 12px;
    }
    .header-inner p {
      font-size: 1.05rem;
      color: rgba(255,255,255,.76);
      max-width: 540px;
    }
    /* Stats en la cabecera */
    .header-stats {
      display: flex;
      gap: 28px;
      margin-top: 28px;
      flex-wrap: wrap;
    }
    .stat-chip {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.2);
      color: rgba(255,255,255,.9);
      padding: 8px 18px;
      border-radius: 100px;
      font-size: .85rem;
      font-weight: 600;
      backdrop-filter: blur(6px);
    }
    .stat-chip .fa { font-size: .8rem; }

    /* ===================================================
       BARRA DE FILTROS
    =================================================== */
    .filter-bar {
      background: var(--white);
      border-bottom: 1px solid var(--gray-200);
      position: sticky;
      top: 72px;
      z-index: 100;
    }
    .filter-inner {
      max-width: 1200px;
      margin: 0 auto;
      padding: 0 28px;
      display: flex;
      align-items: center;
      gap: 8px;
      height: 60px;
    }
    .filter-btn {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 7px 18px;
      border-radius: 100px;
      font-size: .85rem;
      font-weight: 600;
      border: 1.5px solid var(--gray-200);
      background: transparent;
      color: var(--gray-600);
      cursor: pointer;
      transition: var(--transition);
    }
    .filter-btn:hover { border-color: var(--navy); color: var(--navy); }
    .filter-btn.active {
      background: var(--navy);
      border-color: var(--navy);
      color: var(--white);
    }
    .filter-btn .count {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px; height: 20px;
      border-radius: 50%;
      font-size: .72rem;
      background: rgba(255,255,255,.25);
    }
    .filter-btn:not(.active) .count {
      background: var(--gray-100);
      color: var(--gray-600);
    }

    /* ===================================================
       GALERÍA GRID
    =================================================== */
    .gallery-section {
      max-width: 1200px;
      margin: 0 auto;
      padding: 40px 28px 80px;
    }

    .gallery-grid {
      columns: 4;
      column-gap: 16px;
    }

    .gallery-item {
      break-inside: avoid;
      margin-bottom: 16px;
      border-radius: var(--radius-md);
      overflow: hidden;
      position: relative;
      cursor: pointer;
      background: var(--gray-200);
      box-shadow: var(--shadow-sm);
      transition: var(--transition);
    }
    .gallery-item:hover {
      transform: translateY(-4px);
      box-shadow: var(--shadow-xl);
    }
    .gallery-item img {
      width: 100%;
      height: auto;
      display: block;
      transition: transform .4s ease;
    }
    .gallery-item:hover img { transform: scale(1.04); }

    /* Overlay en hover */
    .gallery-overlay {
      position: absolute;
      inset: 0;
      background: rgba(14,30,80,.55);
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      transition: var(--transition);
    }
    .gallery-item:hover .gallery-overlay { opacity: 1; }
    .overlay-icon {
      width: 52px; height: 52px;
      background: rgba(255,255,255,.2);
      border: 2px solid rgba(255,255,255,.6);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--white);
      font-size: 1.2rem;
      backdrop-filter: blur(4px);
    }

    /* Badge video */
    .video-badge {
      position: absolute;
      top: 10px; left: 10px;
      background: rgba(199,58,74,.9);
      color: var(--white);
      font-size: .7rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .06em;
      padding: 3px 10px;
      border-radius: 100px;
      display: flex;
      align-items: center;
      gap: 5px;
    }

    /* Miniaturas de video: usamos un poster generado en canvas si no hay imagen,
       o simplemente mostramos el video sin controles como thumbnail */
    .video-thumb {
      width: 100%;
      height: 200px;
      object-fit: cover;
      display: block;
    }

    /* Ocultar ítems al filtrar */
    .gallery-item.hidden { display: none; }

    /* Mensaje sin resultados */
    .no-results {
      display: none;
      text-align: center;
      padding: 80px 0;
      color: var(--gray-400);
    }
    .no-results.visible { display: block; }
    .no-results .fa { font-size: 3rem; margin-bottom: 16px; display: block; }

    /* ===================================================
       LIGHTBOX
    =================================================== */
    .lightbox {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 2000;
      background: rgba(0,0,0,.92);
      align-items: center;
      justify-content: center;
      padding: 20px;
    }
    .lightbox.open { display: flex; }

    /* Cerrar con clic en fondo */
    .lightbox-backdrop {
      position: absolute;
      inset: 0;
    }

    .lightbox-inner {
      position: relative;
      z-index: 1;
      max-width: 90vw;
      max-height: 90vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 16px;
    }

    /* Imagen / video en lightbox */
    .lightbox-media {
      max-width: 90vw;
      max-height: 80vh;
      border-radius: var(--radius-md);
      box-shadow: 0 24px 60px rgba(0,0,0,.6);
      object-fit: contain;
    }
    .lightbox-video {
      max-width: 90vw;
      max-height: 80vh;
      border-radius: var(--radius-md);
      box-shadow: 0 24px 60px rgba(0,0,0,.6);
      background: #000;
    }

    /* Contador */
    .lightbox-counter {
      color: rgba(255,255,255,.6);
      font-size: .82rem;
      font-weight: 500;
    }

    /* Botón cerrar */
    .lightbox-close {
      position: fixed;
      top: 20px; right: 24px;
      width: 44px; height: 44px;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.22);
      border-radius: 50%;
      color: var(--white);
      font-size: 1.1rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: var(--transition);
      z-index: 2001;
    }
    .lightbox-close:hover { background: rgba(255,255,255,.25); }

    /* Flechas prev / next */
    .lightbox-prev,
    .lightbox-next {
      position: fixed;
      top: 50%;
      transform: translateY(-50%);
      width: 52px; height: 52px;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.22);
      border-radius: 50%;
      color: var(--white);
      font-size: 1.2rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: var(--transition);
      z-index: 2001;
    }
    .lightbox-prev { left: 20px; }
    .lightbox-next { right: 20px; }
    .lightbox-prev:hover,
    .lightbox-next:hover { background: rgba(255,255,255,.28); }

    /* ===================================================
       PIE DE PÁGINA
    =================================================== */
    footer {
      background: var(--gray-900);
      color: var(--white);
      padding: 80px 0 32px;
    }
    .footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
    .footer-top {
      display: grid;
      grid-template-columns: 1.5fr 1fr 1fr;
      gap: 56px;
      margin-bottom: 64px;
    }
    .footer-logo {
      display: inline-block;
      background: rgba(255,255,255,0.95);
      padding: 10px 16px;
      border-radius: var(--radius-sm);
      margin-bottom: 20px;
    }
    .footer-logo img { height: 44px; width: auto; display: block; }

    .footer-col {
      display: flex;
      flex-direction: column;
    }
    .footer-col .footer-btn { margin-top: auto; }

    .footer-col h4 {
      font-size: .72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .14em;
      color: var(--gray-400);
      margin-bottom: 20px;
      padding-bottom: 12px;
      border-bottom: 1px solid rgba(255,255,255,.1);
    }
    .footer-col p { color: rgba(255,255,255,.65); font-size: .9rem; line-height: 1.72; margin-bottom: 20px; }
    .footer-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 11px 22px;
      background: var(--navy);
      color: var(--white);
      border-radius: var(--radius-sm);
      font-weight: 600;
      font-size: .875rem;
      transition: var(--transition);
      margin-bottom: 24px;
    }
    .footer-btn:hover { background: #1e40af; }
    .footer-btn.red-btn { background: var(--red); }
    .footer-btn.red-btn:hover { background: var(--red-dark); }
    .social-row { display: flex; gap: 12px; margin-top: 8px; margin-bottom: 20px; }
    .social-btn {
      width: 40px; height: 40px;
      background: rgba(255,255,255,.09);
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      color: var(--white); font-size: .95rem;
      transition: var(--transition);
    }
    .social-btn:hover { background: var(--navy); transform: translateY(-2px); }
    .footer-bottom {
      border-top: 1px solid rgba(255,255,255,.08);
      padding-top: 28px;
      text-align: center;
      color: rgba(255,255,255,.38);
      font-size: .82rem;
    }

    /* ===================================================
       RESPONSIVE
    =================================================== */
    @media (max-width: 1024px) {
      .gallery-grid { columns: 3; }
    }
    @media (max-width: 768px) {
      .nav-toggle { display: flex; }
      .nav-links {
        display: none;
        position: fixed;
        top: 72px; left: 0; right: 0; bottom: 0;
        background: rgba(255,255,255,.98);
        flex-direction: column;
        align-items: stretch;
        padding: 24px 20px;
        gap: 8px;
        overflow-y: auto;
      }
      .nav-links.open  { display: flex; }
      .nav-link        { font-size: 1.25rem; width: 100%; padding: 18px 22px; border-radius: var(--radius-sm); }
      .nav-cta         { width: 100%; margin-left: 0; text-align: center; display: block; padding: 18px 22px; margin-top: 8px; font-size: 1.25rem; }

      .gallery-grid    { columns: 2; }
      .footer-top      { grid-template-columns: 1fr; gap: 36px; }
      .lightbox-prev   { left: 8px; }
      .lightbox-next   { right: 8px; }
    }
    @media (max-width: 480px) {
      .gallery-grid  { columns: 1; }
      .header-stats  { gap: 12px; }
    }
