/* ========================================
   Variables
======================================== */
:root {
  --ink: #0f172a;
  --muted: #5d7073;
  --text: #5d7073;
  --bg: #ffffff;
  --container: min(1200px, 100% - 10%);
  --max: 1200px;
 --nav-hover: #ffffff;
  --nav-active: #ffffff;
}

/* ========================================
   Reset y Base
======================================== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ========================================
   Tipografía
======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: "Josefin Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

h1 {
  letter-spacing: 0.2px;
}

h2 {
  font-weight: 400;
  line-height: 1.35;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========================================
   Layout
======================================== */
#wrapper,
#container {
  width: 100%;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

/* ========================================
   Header / Navegación
======================================== */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 1px solid rgba(93, 112, 115, 0.22);
}

.header-inner {
  width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 14px;
}

.brand img {
  height: 34px;
  width: auto;
  display: block;
}

nav.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 18px;
  align-items: center;
}

nav.primary-nav a {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

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

nav.primary-nav a.active {
  color: var(--nav-active);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-color: var(--nav-active);
}

/* Header legacy (compatibilidad) */
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 5%;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 50;
  border-bottom: 1px solid rgba(93, 112, 115, 0.15);
}

#site-title img {
  height: 34px;
  display: block;
}

#menu ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  align-items: center;
}

#menu a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

#menu a:hover {
  border-bottom: 1px solid var(--text);
}

/* Mobile Navigation */
.wrapper-ham,
.mobile-toggle {
  display: none;
}

.btn {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.btn > div {
  width: 26px;
  height: 2px;
  background: var(--text);
  transition: 0.2s;
}

@media (max-width: 900px) {
  nav.primary-nav {
    display: none;
  }

  .mobile-toggle {
    display: block;
    border: 1px solid rgba(93, 112, 115, 0.35);
    background: #fff;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
  }

  .mobile-panel {
    display: none;
    border-top: 1px solid rgba(93, 112, 115, 0.22);
    padding: 12px 0;
  }

  .mobile-panel.open {
    display: block;
  }

  .mobile-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-panel a {
    color: var(--muted);
    font-weight: 600;
  }

  /* Legacy mobile menu */
  #menu {
    display: none;
  }

  .wrapper-ham {
    display: block;
  }

  #menu.is-open {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 70px;
    background: #fff;
    padding: 16px 5%;
    border-bottom: 1px solid rgba(93, 112, 115, 0.15);
  }

  #menu.is-open ul {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================
   Hero y Secciones
======================================== */
.hero {
  margin: 0;
}

.section {
  width: var(--container);
  margin: 0 auto;
  padding: 54px 0;
}

.section.border-top {
  border-top: 1px solid var(--text);
  padding-top: 30px;
}

.hr {
  border-top: 1px solid rgba(93, 112, 115, 0.5);
  margin: 0 auto;
  width: var(--container);
}

@media (max-width: 900px) {
  .section {
    padding: 36px 0;
  }
}

/* ========================================
   Elementos de Texto
======================================== */
.lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.25;
}

.lead.h1 {
  font-size: clamp(28px, 2.3vw + 18px, 52px);
}

.lead.h2 {
  font-size: clamp(18px, 1vw + 14px, 26px);
  font-weight: 500;
  margin-top: 12px;
}

/* ========================================
   Splide Sliders
======================================== */

/* Paginación */
.splide__pagination {
  bottom: 16px !important;
  padding: 0 !important;
}

.splide__pagination__page {
  background: transparent !important;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5) !important;
  opacity: 1 !important;
  width: 10px !important;
  height: 10px !important;
  margin: 0 4px !important;
  transition: all 0.3s ease !important;
}

.splide__pagination__page.is-active {
  box-shadow: inset 0 0 0 8px rgba(0, 0, 0, 0.85) !important;
  transform: scale(1.1);
}

.splide__pagination__page:hover {
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.65) !important;
}

/* Imágenes del slider - General */
.slider img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Hero slider específico */
.hero .slider img {
  aspect-ratio: 16 / 7;
  max-height: 600px;
}

/* Espacios slider específico */
.spaces-slider .splide__slide img {
  aspect-ratio: 16 / 9;
  max-height: 480px;
  width: 100%;
  object-fit: cover;
  display: block;
}

.spaces-slider .splide__track {
  border: 1px solid rgba(93, 112, 115, 0.15);
}

/* Flechas del slider de espacios - más sutiles */
.spaces-slider .splide__arrow {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(93, 112, 115, 0.2) !important;
  width: 44px !important;
  height: 44px !important;
  opacity: 0.9 !important;
  transition: all 0.25s ease !important;
}

.spaces-slider .splide__arrow:hover {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(93, 112, 115, 0.35) !important;
  opacity: 1 !important;
}

.spaces-slider .splide__arrow--prev {
  left: 16px !important;
}

.spaces-slider .splide__arrow--next {
  right: 16px !important;
}

.spaces-slider .splide__arrow svg {
  fill: rgba(93, 112, 115, 0.75) !important;
  width: 18px !important;
  height: 18px !important;
}

.spaces-slider .splide__arrow:disabled {
  opacity: 0.4 !important;
}

/* Responsive sliders */
@media (max-width: 900px) {
  .hero .slider img {
    aspect-ratio: 4 / 3;
    max-height: 400px;
  }

  .spaces-slider .splide__slide img {
    max-height: 350px;
  }

  .spaces-slider .splide__arrow {
    width: 36px !important;
    height: 36px !important;
  }

  .spaces-slider .splide__arrow--prev {
    left: 12px !important;
  }

  .spaces-slider .splide__arrow--next {
    right: 12px !important;
  }
}

@media (max-width: 575px) {
  .hero .slider img {
    aspect-ratio: 1 / 1;
    max-height: 350px;
  }

  .slider img {
    aspect-ratio: 1 / 1;
  }
}

/* Legacy carousel */
.carousel-wrap {
  width: 100%;
}

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

.carruseldesktop {
  display: block;
}

.carruselmobile {
  display: none;
}

@media (max-width: 575.98px) {
  .carruseldesktop {
    display: none;
  }

  .carruselmobile {
    display: block;
  }
}

/* ========================================
   Tabs System - Espacios
======================================== */
.tabs {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}

.tablist {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(245, 247, 248, 0.6);
  padding: 8px 0;
}

.tab-btn {
  width: 100%;
  text-align: left;
  padding: 14px 20px;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid rgba(93, 112, 115, 0.12);
  background: transparent;
  color: rgba(93, 112, 115, 0.75);
  font-family: "Open Sans", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.tab-btn:last-child {
  border-bottom: none;
}

.tab-btn:hover {
  color: rgba(93, 112, 115, 1);
  background: rgba(255, 255, 255, 0.4);
}

.tab-btn[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.65);
  color: rgba(93, 112, 115, 1);
  font-weight: 600;
  border-left: 3px solid rgba(93, 112, 115, 0.85);
}

.tabpanel {
  display: none;
}

.tabpanel.active {
  display: block;
}

.tabpanels {
  position: relative;
}

/* Caption bar debajo de sliders */
.caption-bar {
  background: rgba(93, 112, 115, 0.06);
  padding: 20px 24px;
  margin-top: 0;
  border-top: 1px solid rgba(93, 112, 115, 0.1);
}

.caption-bar p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(93, 112, 115, 0.8);
  text-align: justify;
}

@media (max-width: 900px) {
  .tabs {
    grid-template-columns: 1fr;
  }

  .tablist {
    flex-direction: row;
    overflow-x: auto;
    padding: 0;
  }
  
  .tab-btn {
    white-space: nowrap;
    border-bottom: none;
    border-right: 1px solid rgba(93, 112, 115, 0.12);
    padding: 12px 18px;
  }
  
  .tab-btn:last-child {
    border-right: none;
  }
  
  .tab-btn[aria-selected="true"] {
    border-left: none;
    border-bottom: 3px solid rgba(93, 112, 115, 0.85);
  }
  
  .caption-bar {
    padding: 16px 18px;
    font-size: 13px;
  }
}

/* ========================================
   Footer
======================================== */
.footer {
  border-top: 1px solid rgba(93, 112, 115, 0.22);
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
}

/* ========================================
   Utilities
======================================== */
.only-desktop {
  display: block;
}

.only-mobile {
  display: none;
}

@media (max-width: 900px) {
  .only-desktop {
    display: none;
  }

  .only-mobile {
    display: block;
  }
}