/**
 * Tierra de Gracia | Arquitectura de Layout & Cabecera de Alta Gama
 */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section {
  padding-top: var(--spacing-2xl);
  padding-bottom: var(--spacing-2xl);
  position: relative;
}

.section.pt-0 {
  padding-top: 0;
}

.section.bg-light {
  background-color: var(--color-surface-alt);
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}

.section.bg-terracota-soft {
  background: linear-gradient(180deg, rgba(163, 56, 30, 0.05) 0%, rgba(217, 119, 6, 0.08) 100%);
  border-top: 1px solid rgba(163, 56, 30, 0.12);
  border-bottom: 1px solid rgba(163, 56, 30, 0.12);
}

/* ==========================================================================
   CABECERA PRINCIPAL (HEADER) - Sticky Glassmorphic de Lujo
   ========================================================================== */
.header, .site-header {
  position: sticky;
  top: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  transition: height var(--transition-base), background-color var(--transition-base), box-shadow var(--transition-base);
}

[data-theme="dark"] .header,
[data-theme="dark"] .site-header {
  background-color: rgba(18, 15, 13, 0.94);
  border-bottom-color: var(--color-border);
}

.header.is-scrolled,
.site-header.is-scrolled {
  height: 68px;
  box-shadow: var(--shadow-sm);
}

.header__inner, .header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Brand / Logotipo */
.brand, .brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--color-text);
  flex-shrink: 0;
}

.brand__logo-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.15) 0%, rgba(163, 56, 30, 0.15) 100%);
  border: 1px solid var(--color-border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.brand:hover .brand__logo-box {
  transform: scale(1.05);
  box-shadow: var(--shadow-glow-gold);
}

.brand__text {
  display: flex;
  flex-direction: column;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--color-text);
  line-height: 1.1;
}

.brand__tagline {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-primary);
}

/* Navegación Desktop */
.nav, .nav-desktop {
  display: flex;
  align-items: center;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link, .nav-link {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.2rem;
  position: relative;
  transition: color var(--transition-fast);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.nav__link:hover {
  color: var(--color-primary);
}

.nav__link:hover::after {
  width: 100%;
}

.nav__link--active, .nav__link[aria-current="page"] {
  color: var(--color-primary);
  font-weight: 700;
}

.nav__link--active::after, .nav__link[aria-current="page"]::after {
  width: 100%;
}

/* Acciones de la Cabecera */
.header__actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

/* Selector de Tema (Modo Fogón Criollo) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.theme-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background-color: var(--color-surface-hover);
  transform: translateY(-1px);
}

.theme-toggle__icon {
  font-size: 1rem;
}

/* Botón Hamburguesa Móvil */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 40px;
  height: 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
}

.menu-toggle__line {
  width: 100%;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

/* ==========================================================================
   CAJÓN DE NAVEGACIÓN MÓVIL (DRAWER)
   ========================================================================== */
.drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 380px;
  height: 100vh;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-xl);
  z-index: 2000;
  transition: right 0.35s var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.drawer.is-open {
  right: 0;
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.drawer__close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--color-text);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

.drawer__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.drawer__nav {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
}

.drawer__nav li {
  margin-bottom: 0.75rem;
}

.drawer__link {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border-subtle);
  transition: color var(--transition-fast);
}

.drawer__link:hover,
.drawer__link--active {
  color: var(--color-primary);
  padding-left: 0.5rem;
}

.drawer__footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* ==========================================================================
   GRID SYSTEM
   ========================================================================== */
.grid {
  display: grid;
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

/* ==========================================================================
   PIE DE PÁGINA (FOOTER) - Institucional de Lujo
   ========================================================================== */
.footer {
  background-color: #120F0D;
  color: #D6CEC5;
  padding-top: var(--spacing-3xl);
  border-top: 1px solid rgba(217, 119, 6, 0.2);
  position: relative;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 1.1fr 1fr;
  gap: var(--spacing-2xl);
  padding-bottom: var(--spacing-2xl);
}

.footer__brand .brand__name {
  color: #FFFFFF;
  font-size: 1.6rem;
}

.footer__desc {
  color: #9E948A;
  margin-top: 1rem;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.footer__badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.footer__heading {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-gold);
  margin-bottom: 1.25rem;
}

.footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__links li {
  margin-bottom: 0.65rem;
}

.footer__links a,
.footer__modal-link {
  color: #D6CEC5;
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color var(--transition-fast);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.footer__links a:hover,
.footer__modal-link:hover {
  color: var(--color-gold);
}

.footer__address {
  font-style: normal;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #D6CEC5;
}

.footer__address strong {
  color: #FFFFFF;
  font-size: 1rem;
}

.footer__address a {
  color: var(--color-gold);
  text-decoration: none;
}

.footer__address a:hover {
  text-decoration: underline;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.75rem 0;
  background-color: #0A0807;
}

.footer__bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__bottom p {
  margin: 0;
  color: #78716C;
}

@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .hide-on-mobile { display: none !important; }
  .footer__grid { grid-template-columns: 1fr; gap: var(--spacing-xl); }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}
