* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

/* TEMAS */
:root {
  --bg: #ffffff;
  --text: #1f1f1f;
  --card: #ffffff;
  --muted: #6b6b6b;
  --brand: #8b5e3c;
  --accent: #b8865b;
  --border: #e8e8e8;
  --topbar-bg: #3cbec2;
}

body[data-theme="warm"] {
  --bg: #ead27b;
  --text: #2a150c;
  --card: #fff3d4;
  --brand: #e97a0b;
  --accent: #e87c00;
  --topbar-bg: #583820;
}

body[data-theme="cool"] {
  --bg: #f4f8ff;
  --text: #222b34;
  --card: #a9edee;
  --brand: #0f4c81;
  --accent: #7fb3ff;
  --topbar-bg: #3cbec2;
}

/* LAYOUT */
.container {
  padding: 16px;
}

.section-title {
  padding: 16px 16px 0;
  font-size: 1.2rem;
  font-weight: 700;
}

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 5%;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
}

.brand .logo {
  height: 56px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.main-nav a,
.main-nav .link-like {
  background: transparent;
  border: none;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
}

.main-nav a:hover,
.main-nav .link-like:hover {
  text-decoration: underline;
}

.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* BOTONES */
.btn {
  display: inline-block;
  padding: 8px 12px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.btn.small {
  padding: 6px 10px;
  font-size: 0.9rem;
}

.btn.ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}

/* GRID / TARJETAS */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

body[data-theme="warm"] .card {
  color: var(--text);
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #ddd;
}

.card .pad {
  padding: 12px;
}

.price {
  margin: 6px 0 10px;
  color: var(--brand);
  font-weight: 700;
}

/* FOOTER */
.footer {
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

/* DETALLE */
.detalle {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  padding: 20px;
}

.mini {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.mini img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: #eee;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.viewer {
  position: relative;
  background: #0001;
  border-radius: 12px;
  overflow: hidden;
}

.viewer img {
  display: block;
  width: 100%;
}

.lens {
  position: absolute;
  width: 120px;
  height: 120px;
  border: 2px solid var(--brand);
  border-radius: 50%;
  backdrop-filter: brightness(1.05);
  pointer-events: none;
  visibility: hidden;
}

.zoom-result {
  min-height: 320px;
  margin-top: 10px;
  background-repeat: no-repeat;
  background-size: 200% 200%;
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .detalle {
    grid-template-columns: 1fr;
  }
}

/* CONTACTO / MODAL */
.contacto-modal {
  max-width: 500px;
  margin: 3rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.contacto-modal h2 {
  margin-bottom: 1rem;
  text-align: center;
  color: var(--brand);
}

.contacto-modal form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.contacto-modal input,
.contacto-modal textarea {
  width: 100%;
  padding: .5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.contacto-modal button {
  margin-top: 1rem;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: .6rem;
  border-radius: 8px;
  cursor: pointer;
}

.modal-contacto {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-contacto.show {
  display: flex;
}