/* ==========================================================================
   1. TOKENS DE DISEÑO (Paleta corporativa y tintes de tarjetas)
   ========================================================================== */
:root {
  /* Fondos y superficies */
  --bg-page: #ffffff;
  --bg-surface-muted: #eeeded;
  --bg-modal-body: #f8f6ef;
  --bg-footer: #181818;

  /* Colores corporativos */
  --color-primary: #263a33;
  --color-secondary: #75847b;
  --color-accent-gradient: #f4a51d; 
  --color-accent: #e98c70;
  --color-text: #1c2421;
  --color-text-subtle: #4a5551;
  --color-border: #dcdad3;

  /* Tintes pastel por tarjeta (extraídos del Mockup Inici) */
  --tint-01: #f4f1de; /* Crema suave */
  --tint-02: #fae8cd; /* Arena cálido */
  --tint-03: #cbc7b7; /* Oliva claro */
  --tint-04: #d8f3dc; /* Verde menta suave */
  --tint-05: #f3e5f5; /* Lila suave */
  --tint-06: #e3eaf5; /* Azul cielo tenue */
  --tint-07: #e8eef2; /* Gris azulado */
  --tint-08: #fce8d5; /* Melocotón claro */
  --tint-09: #fae3e3; /* Rosa pálido */

  /* Tokens de botones y estados interactivos */
  --btn-card-bg: transparent;
  --btn-card-bg-hover: #f2f2f2;
  --btn-card-text: var(--color-text);
  --btn-card-text-hover: var(--color-primary);

  --btn-modal-bg: #ffffff;
  --btn-modal-bg-hover: var(--color-primary);
  --btn-modal-text: var(--color-text);
  --btn-modal-text-hover: #ffffff;
  --btn-modal-border: #999999;

  /* Tipografía */
  --font-sans: 'Avenir', 'Montserrat', system-ui, -apple-system, sans-serif;
  --font-serif: 'Palatino', Georgia, serif;

  /* Espaciado y radios */
  --radius-card: 6px;
  --shadow-card: 0 4px 12px rgba(38, 58, 51, 0.12);
  --shadow-modal: 0 18px 40px rgba(0, 0, 0, 0.28);
}

/* ==========================================================================
   2. RESET Y BASE RESPONSIVA
   ========================================================================== */
*, 
*::before, 
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--bg-page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(92%, 1080px);
  margin-inline: auto;
}

/* ==========================================================================
   3. CABECERA GLOBAL (Header + Sello A1-A2)
   ========================================================================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-block: 1.5rem;
  border-bottom: 1.5px solid var(--color-text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-badge-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50% 50% 50% 6px;
  background: linear-gradient(135deg, var(--color-accent-gradient), var(--color-accent));
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name strong {
  font-size: 1.15rem;
  font-weight: 800;
}

.brand-name span {
  font-style: italic;
  font-weight: 600;
  font-size: 0.95rem;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

.main-nav a.active,
.main-nav a:hover {
  border-bottom-color: var(--color-text);
}

.level-stamp {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1.5px solid var(--color-accent);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  font-weight: 800;
  font-size: 0.9rem;
  transform: rotate(12deg);
  background: #fff;
}

/* ==========================================================================
   4. HERO Y CATÁLOGO GRID 3x3
   ========================================================================== */
.hero {
  padding-block: 2.5rem 2rem;
}

.hero h1 {
  font-size: clamp(1.6rem, 3.2vw, 2.15rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  max-width: 62ch;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-subtle);
}

.catalog {
  padding-block: 1rem 3rem;
}

.section-eyebrow {
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.catalog h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.65rem);
  font-style: italic;
  font-weight: 800;
  margin-bottom: 1.75rem;
}

/* Rejilla fluida: 3 columnas en escritorio, 2 en tablet, 1 en móvil */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* ==========================================================================
   5. TARJETA INDIVIDUAL (Card)
   ========================================================================== */
.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(38, 58, 51, 0.16);
}

.card-header {
  position: relative;
  display: grid;
  place-items: center;
  height: 76px;
  background-color: var(--card-tint, var(--bg-surface-muted));
  padding: 0.75rem;
}

.card-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.card-number {
  position: absolute;
  top: 0.65rem;
  right: 0.85rem;
  font-weight: 800;
  font-style: italic;
  font-size: 0.95rem;
}

.card-body {
  padding: 1rem 1.15rem 1.25rem;
  flex-grow: 1;
}

.card-category {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-secondary);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.card-quote {
  font-size: 0.82rem;
  color: var(--color-text-subtle);
}

.card-footer {
  border-top: 1px solid var(--color-border);
  background-color: transparent;
  transition: background-color 0.18s ease;
}

.card-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.7rem 1.15rem;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.card-link:hover,
.card-link:focus-visible {
  background-color: var(--btn-card-bg-hover);
  color: var(--btn-card-text-hover);
}

.card-link span {
  transition: transform 0.18s ease;
}

.card-link:hover span {
  transform: translateX(3px);
}

/* ==========================================================================
   6. MODAL DE DETALLE (:target sin JavaScript)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-overlay:target {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  width: min(100%, 540px);
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background-color: var(--bg-footer); /* Tono oscuro cabecera mockup situación */
  color: var(--bg-page);
  padding: 1.1rem 1.4rem;
}

.modal-category {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-bottom: 0.35rem;
}

.modal-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-quote {
  font-size: 0.85rem;
  opacity: 0.9;
}

.modal-number {
  font-weight: 800;
  font-style: italic;
  font-size: 1rem;
  padding-top: 0.75rem;
}

.modal-body {
  background-color: var(--bg-modal-body);
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
}

.dialogue-heading {
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.dialogue-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.84rem;
}

.dialogue-list li {
  display: flex;
  flex-direction: column;
}

.dialogue-list .ca {
  font-style: italic;
  color: var(--color-text-subtle);
  padding-left: 3.1rem;
}

.modal-divider {
  border: 0;
  border-top: 1px solid var(--color-text-subtle);
  margin-block: 1.25rem;
}

.useful-box {
  margin-bottom: 1.25rem;
}

.useful-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.useful-phrase {
  font-size: 0.95rem;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-close {
  display: inline-block;
  padding: 0.45rem 1.15rem;
  background: var(--bg-page);
  color: var(--color-text);
  border: 1px solid var(--var-btn-border);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-close:hover {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ==========================================================================
   7. PIE DE PÁGINA
   ========================================================================== */
.site-footer {
  padding-bottom: 2rem;
}

.footer-box {
  background-color: var(--bg-footer);
  color: var(--bg-page);
  text-align: center;
  padding: 1.1rem 1.5rem;
  border-radius: 6px;
  font-size: 0.82rem;
}

.footer-meta {
  opacity: 0.8;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* ==========================================================================
   8. AJUSTES ESPECÍFICOS MÓVIL (< 600px)
   ========================================================================== */
@media (max-width: 600px) {
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--bg-surface-muted);
  }

  .dialogue-list .ca {
    padding-left: 1rem;
  }
}