:root {
  --bg: #faf6ef;
  --bg-alt: #f1e9d8;
  --text: #221d18;
  --text-secondary: #6b6058;
  --border: #e3d7bf;

  --gold: #a9782e;
  --gold-tint: #f3e7ce;
  --terracota: #b15a3e;
  --terracota-tint: #f5e2da;
  --oliva: #6e7a3e;
  --oliva-tint: #e9ecd9;
  --petroleo: #2e5c5a;
  --petroleo-tint: #dfeae9;

  /* Alias de categoría: mantiene los nombres usados en el HTML/JS (accent-blue/red/yellow/green) */
  --blue: var(--petroleo);
  --blue-tint: var(--petroleo-tint);
  --red: var(--terracota);
  --red-tint: var(--terracota-tint);
  --yellow: var(--gold);
  --yellow-tint: var(--gold-tint);
  --green: var(--oliva);
  --green-tint: var(--oliva-tint);

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;

  /* Fijos: el botón CTA lleva un logo blanco superpuesto, así que su fondo
     no debe invertirse con el modo oscuro. */
  --cta-bg: #221d18;
  --cta-text: #faf6ef;

  --shadow-soft: 0 2px 10px rgba(34, 29, 24, 0.12);
  --shadow-elevated: 0 16px 48px rgba(34, 29, 24, 0.18);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1712;
    --bg-alt: #24211a;
    --text: #f1ebe0;
    --text-secondary: #b3a996;
    --border: #3e3728;

    --gold: #c9a04e;
    --gold-tint: #3a2f18;
    --terracota: #d17c5c;
    --terracota-tint: #3a2621;
    --oliva: #9aab5e;
    --oliva-tint: #262c1a;
    --petroleo: #5b9c98;
    --petroleo-tint: #172726;

    --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-elevated: 0 16px 48px rgba(0, 0, 0, 0.45);
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  font-size: 24px;
  line-height: 1;
  user-select: none;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 72px;
  padding: 0 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.lang-switcher {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.lang-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.lang-link svg {
  display: block;
  border-radius: 3px;
}

.lang-link:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.lang-link.active {
  background: var(--gold-tint);
  color: var(--gold);
}

.logo {
  height: 44px;
  width: auto;
  display: block;
}

.logo-stars {
  color: var(--gold);
  font-weight: 900;
}

/* ---------- Layout with sidebar ---------- */
.layout {
  display: flex;
  align-items: flex-start;
}

.sidebar {
  flex-shrink: 0;
  width: 260px;
  height: calc(100vh - 72px);
  position: sticky;
  top: 72px;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--bg);
  transition: width 0.2s ease;
}

.sidebar.collapsed {
  width: 88px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0.75rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, padding 0.2s ease, justify-content 0.2s ease;
}

.nav-item:hover {
  background: var(--bg-alt);
}

.nav-item.active {
  background: var(--gold-tint);
  color: var(--gold);
  font-weight: 700;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.15s ease;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0;
}

.sidebar.collapsed .nav-label {
  opacity: 0;
  width: 0;
}

.sidebar-partner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 72px;
  margin: 0.25rem 0.75rem 0;
  padding: 0 1rem;
  border-radius: var(--radius-md);
}

.sidebar-partner:hover {
  background: var(--bg-alt);
}

.partner-logo {
  height: 48px;
  width: auto;
}

.partner-icon {
  display: none;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  object-fit: contain;
}

.sidebar.collapsed .sidebar-partner {
  justify-content: center;
  padding: 0;
}

.sidebar.collapsed .partner-logo {
  display: none;
}

.sidebar.collapsed .partner-icon {
  display: block;
}

.content {
  flex: 1;
  min-width: 0;
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
}

/* ---------- Hero ---------- */
.hero {
  padding: 4rem 1.5rem 2.5rem;
  text-align: center;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: "Fraunces", "Roboto", serif;
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--text);
}

.subtitle {
  color: var(--text-secondary);
  margin: 0;
  font-size: 1.15rem;
}

/* ---------- Card grid ---------- */
.grid {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: grid;
  align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.5rem;
}

.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.75rem;
  cursor: pointer;
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: var(--bg-alt);
}

.card[hidden] {
  display: none;
}

.card:hover {
  transform: translateY(-4px);
}

.card.accent-blue { background: var(--blue-tint); }
.card.accent-red { background: var(--red-tint); }
.card.accent-yellow { background: var(--yellow-tint); }
.card.accent-green { background: var(--green-tint); }

.card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-md);
  filter: saturate(0.94) contrast(1.03);
}

.card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: #ffffff;
  box-shadow: var(--shadow-soft);
}

.card-icon .material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

.card.accent-blue .card-icon { background: var(--blue); }
.card.accent-red .card-icon { background: var(--red); }
.card.accent-yellow .card-icon { background: var(--yellow); }
.card.accent-green .card-icon { background: var(--green); }

.card h3 {
  margin: 0;
  font-family: "Fraunces", "Roboto", serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.45;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 500;
}

.card-price {
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
}

.category-tag {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.card.accent-blue .category-tag { color: var(--blue); }
.card.accent-red .category-tag { color: var(--red); }
.card.accent-yellow .category-tag { color: var(--yellow); }
.card.accent-green .category-tag { color: var(--green); }

footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 2rem;
  border-top: 1px solid var(--border);
}

/* ---------- Dialog ---------- */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(34, 29, 24, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 10;
}

.scrim.open {
  display: flex;
}

.dialog {
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-elevated);
}

.icon-button {
  border: none;
  background: none;
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.icon-button:hover {
  background: var(--bg-alt);
}

.dialog-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2;
}

.dialog-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #ffffff;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
}

.dialog-icon[hidden] {
  display: none;
}

.dialog-icon .material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

.dialog-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  filter: saturate(0.94) contrast(1.03);
}

.dialog-image[hidden] {
  display: none;
}

.dialog-gallery {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.dialog-gallery img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex: 0 0 auto;
  cursor: pointer;
  filter: saturate(0.94) contrast(1.03);
}

.dialog-gallery[hidden] {
  display: none;
}

/* ---------- Lightbox ---------- */
.lightbox-scrim {
  z-index: 20;
  background: rgba(0, 0, 0, 0.85);
}

.lightbox {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  filter: saturate(0.94) contrast(1.03);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  z-index: 2;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.45);
}

.lightbox-close {
  top: 0.75rem;
  right: 0.75rem;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 0.5rem;
}

.lightbox-next {
  right: 0.5rem;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev[hidden],
.lightbox-next[hidden] {
  display: none;
}

.dialog h2 {
  margin: 0 0 0.5rem;
  font-family: "Fraunces", "Roboto", serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.dialog-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.dialog-meta {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 500;
}

.dialog-meta span:last-child {
  color: var(--text);
  font-weight: 700;
}

/* ---------- Botón CTA ---------- */
.btn-pill {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-pill:hover {
  background: var(--gold);
}

.btn-pill[hidden] {
  display: none;
}

.btn-pill-logo {
  height: 32px;
  width: auto;
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 4rem 1rem;
  grid-column: 1 / -1;
}

/* ---------- Aviso de cookies ---------- */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 5; /* por debajo de .scrim (10), para que un modal abierto quede siempre por encima */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  max-width: 640px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
}

.cookie-banner p {
  flex: 1 1 320px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.cookie-banner a {
  color: var(--text);
}

.cookie-banner .btn-pill {
  width: auto;
  flex-shrink: 0;
  padding: 0 1.5rem;
}

.cookie-banner[hidden] {
  display: none;
}
