:root {
  /* Modo claro (predeterminado) */
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-2: #f1efeb;
  --text: #1b1d1f;
  --muted: #6c727a;
  --line: #e5e2dc;
  --accent: #96702a;
  --accent-ink: #ffffff;
  --green: #2e7d46;
  --amber: #a5720b;
  --red: #c0392b;
  --header-bg: rgba(255, 255, 255, 0.85);
  --radius: 14px;
  --maxw: 1120px;
}

:root[data-theme="dark"] {
  /* Modo oscuro */
  --bg: #0f1113;
  --surface: #16191c;
  --surface-2: #1d2125;
  --text: #eceff1;
  --muted: #9aa4ad;
  --line: #2a2f34;
  --accent: #c7a15a;
  --accent-ink: #0f1113;
  --green: #3fae6a;
  --amber: #d9a441;
  --red: #d16060;
  --header-bg: rgba(15, 17, 19, 0.85);
}

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-mark { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 16px; }
.site-nav a { color: var(--muted); font-size: 0.95rem; }
.site-nav a:hover { color: var(--text); }
.lang-form { margin: 0; }
.lang-form select {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 8px; font-size: 0.85rem; font-family: inherit; cursor: pointer;
}
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; font-size: 1rem; line-height: 1;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle .to-light { display: none; }
.theme-toggle .to-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: inline; }

/* Hero */
.hero { padding: 40px 0 24px; }
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.hero p { color: var(--muted); margin: 0; max-width: 60ch; }

/* Filtros */
.filters { margin: 8px 0 28px; }
.search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.search-row input {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}
.filter-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.filter-row select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); }

/* Grilla de productos */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.no-photo {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.85rem;
}
.no-photo.large { aspect-ratio: 4 / 3; border-radius: var(--radius); }
.card-body { padding: 14px 16px 16px; }
.card-brand { color: var(--accent); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 2px; }
.card-title { font-size: 1.05rem; margin: 0 0 4px; letter-spacing: -0.01em; }
.card-meta { color: var(--muted); font-size: 0.85rem; margin: 0 0 8px; }
.card-price { font-weight: 700; margin: 0; }

/* Badges */
.badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
}
.badge-available { color: var(--green); }
.badge-reserved { color: var(--amber); }
.badge-sold { color: var(--red); }

/* Paginación */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 32px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.pagination a { color: var(--accent); }

.empty { text-align: center; padding: 60px 0; color: var(--muted); }

/* Detalle */
.back-link { color: var(--muted); font-size: 0.9rem; display: inline-block; margin: 20px 0; }
.back-link:hover { color: var(--text); }
.detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 60px;
}
.gallery-main {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb {
  width: 68px; height: 68px;
  padding: 0; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; cursor: pointer; background: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.detail-brand { color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; margin: 0 0 4px; }
.detail-title { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0 0 14px; letter-spacing: -0.02em; }
.status-line { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.status-line .badge { position: static; }
.pill {
  padding: 4px 10px; border-radius: 999px; font-size: 0.72rem;
  border: 1px solid var(--accent); color: var(--accent);
}
.detail-price { font-size: 1.6rem; font-weight: 700; margin: 0 0 24px; }

.specs {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 0;
  border-top: 1px solid var(--line);
  margin: 0 0 24px;
}
.specs dt {
  padding: 12px 0; color: var(--muted); font-size: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.specs dd {
  padding: 12px 0; margin: 0; font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.video iframe { width: 100%; height: 100%; border: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (min-width: 720px) {
  .filter-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .detail { grid-template-columns: 1.1fr 1fr; align-items: start; }
}
