:root {
  --terracotta: #a9694c;
  --terracotta-dark: #8b5439;
  --forest: #2e4a3b;
  --forest-dark: #1f3329;
  --cream: #f3e8d3;
  --cream-bg: #faf3e7;
  --ink: #2b2420;
  --ink-soft: #5a4f45;
  --white: #ffffff;
  --card-radius: 4px;
  --shadow: 0 2px 10px rgba(43, 36, 32, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream-bg);
  color: var(--ink);
  font-family: 'Archivo', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--cream-bg);
  border-bottom: 3px solid var(--forest);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
}

.site-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wordmark-top {
  font-family: 'Bevan', serif;
  font-size: 28px;
  color: var(--forest);
}

.wordmark-vintage-img {
  height: 34px;
  width: auto;
  display: block;
}

.wordmark-bottom {
  font-family: 'Bevan', serif;
  font-size: 28px;
  color: var(--forest);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  justify-content: flex-end;
  min-width: 260px;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
}

#searchInput {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 2px solid var(--forest);
  border-radius: 999px;
  background: var(--white);
  font-family: 'Archivo', sans-serif;
  font-size: 15px;
  color: var(--ink);
}

#searchInput:focus {
  outline: none;
  border-color: var(--terracotta);
}

.item-count {
  display: none;
}

@media (max-width: 640px) {
  .header-tools { flex-wrap: wrap; }
  .search-wrap { flex: 1 1 100%; max-width: 100%; order: 2; }
  .about-btn { order: 1; }
  .buy-btn { order: 1; }
}

.about-btn {
  font-family: 'Archivo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--forest);
  background: var(--white);
  border: 2px solid var(--forest);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.about-btn:hover {
  background: var(--forest);
  color: var(--white);
}

.buy-btn {
  color: var(--terracotta-dark);
  border-color: var(--terracotta);
}

.buy-btn:hover {
  background: var(--terracotta);
  color: var(--white);
}

/* ---------- Intro ---------- */

.intro {
  max-width: 720px;
  margin: 28px auto 8px;
  padding: 0 20px;
  text-align: center;
}

.intro p {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- Info strip (envíos / retiro / pago) ---------- */

.info-strip {
  max-width: 900px;
  margin: 0 auto 24px;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.info-item {
  background: var(--white);
  border: 2px solid var(--forest);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--forest);
  white-space: nowrap;
  max-width: 100%;
}

@media (max-width: 640px) {
  .info-strip { flex-direction: column; align-items: stretch; }
  .info-item {
    white-space: normal;
    text-align: center;
    border-radius: 14px;
    line-height: 1.4;
  }
}

/* ---------- Pinned row (Gift Cards) ---------- */

.pinned-row {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 20px 4px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
}

.pinned-row:empty {
  display: none;
}

.pinned-row .card {
  position: relative;
  border: 2px solid var(--terracotta);
}

.pin-flag {
  position: absolute;
  top: 10px;
  left: -6px;
  z-index: 2;
  background: var(--terracotta);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px 5px 14px;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pin-flag::after {
  content: '';
  position: absolute;
  left: 0;
  top: 100%;
  border-width: 5px 6px 0 0;
  border-style: solid;
  border-color: var(--terracotta-dark) transparent transparent transparent;
}

/* ---------- Grid ---------- */

.grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
}

.card {
  background: var(--white);
  border-radius: var(--card-radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: 1px solid rgba(43,36,32,0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(43, 36, 32, 0.18);
}

.card-photo-wrap {
  aspect-ratio: 1 / 1;
  background: var(--cream);
  overflow: hidden;
}

.card-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pinned-row .card-photo-wrap img {
  object-position: center top;
}

.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-price {
  margin-top: auto;
  font-family: 'Bevan', serif;
  font-size: 15px;
  color: var(--terracotta-dark);
}

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  padding: 60px 20px;
}

/* ---------- Sort bar ---------- */

.sort-bar {
  max-width: 900px;
  margin: 0 auto;
  padding: 4px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.sort-bar label {
  font-family: 'Archivo', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

.sort-bar select {
  font-family: 'Archivo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--forest);
  border-radius: 999px;
  padding: 8px 34px 8px 16px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232e4a3b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.sort-bar select:focus {
  outline: none;
  border-color: var(--terracotta);
}

@media (max-width: 640px) {
  .sort-bar { justify-content: space-between; padding: 4px 20px 12px; }
  .sort-bar select { flex: 1 1 auto; }
}

/* ---------- Category sections (home overview) ---------- */

.category-sections {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 20px 20px;
}

.category-section {
  margin-bottom: 28px;
}

.category-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 2px solid var(--forest);
}

.category-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Bevan', serif;
  font-size: 17px;
  color: var(--forest);
}

.category-section-title img {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.ver-todo-btn {
  flex-shrink: 0;
  border: 1.5px solid var(--forest);
  background: transparent;
  color: var(--forest);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Archivo', sans-serif;
}

.ver-todo-btn:hover {
  background: var(--forest);
  color: var(--white);
}

.preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  cursor: pointer;
  border-bottom: 1px solid rgba(43,36,32,0.08);
}

.preview-row:last-child {
  border-bottom: none;
}

.preview-row:hover {
  background: rgba(169,105,76,0.06);
}

.preview-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--card-radius);
  object-fit: cover;
  background: var(--cream);
  flex-shrink: 0;
}

.preview-info {
  min-width: 0;
  flex: 1;
}

.preview-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-price {
  font-family: 'Bevan', serif;
  font-size: 13.5px;
  color: var(--terracotta-dark);
  margin-top: 2px;
}

/* ---------- About us (modal) ---------- */

.about-modal {
  background: var(--white);
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 6px;
  position: relative;
}

.about-inner {
  display: flex;
  align-items: stretch;
  background: var(--white);
  overflow: hidden;
}

.about-photo {
  width: 300px;
  height: auto;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.about-text {
  padding: 30px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about-text h2 {
  font-family: 'Bevan', serif;
  color: var(--forest);
  font-size: 22px;
  margin: 0 0 14px;
}

.about-text p {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0 0 12px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .about-inner { flex-direction: column; }
  .about-photo { width: 100%; height: 260px; }
  .about-text { padding: 22px 20px; }
}

/* ---------- Compramos cámaras (modal) ---------- */

.buy-modal {
  background: var(--white);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 6px;
  position: relative;
}

.buy-text {
  padding: 34px 36px;
}

.buy-text h2 {
  font-family: 'Bevan', serif;
  color: var(--forest);
  font-size: 22px;
  margin: 0 0 14px;
}

.buy-lead {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 16px;
}

.buy-subhead {
  color: var(--forest);
  font-size: 14.5px;
  font-weight: 700;
  margin: 0 0 8px;
}

.buy-list {
  margin: 0 0 18px;
  padding-left: 20px;
}

.buy-list li {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.65;
  margin-bottom: 12px;
}

.buy-list li:last-child {
  margin-bottom: 0;
}

.buy-cta {
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--cream-dark, #e6dcc6);
}

@media (max-width: 720px) {
  .buy-text { padding: 24px 20px; }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 3px solid var(--forest);
  margin-top: 40px;
  padding: 22px 20px;
  text-align: center;
}

.site-footer p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 13px;
}

.site-footer p + p {
  margin-top: 8px;
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 25, 20, 0.78);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--white);
  max-width: 920px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 6px;
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

@media (max-width: 720px) {
  .modal { grid-template-columns: 1fr; max-height: 92vh; }
  .modal-gallery { min-height: unset; }
  .modal-image { height: auto; max-height: 48vh; }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}

.modal-gallery {
  position: relative;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.modal-image {
  width: 100%;
  height: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.85);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  color: var(--ink);
  z-index: 4;
}

.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }

.gallery-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 0 10px;
}

.gallery-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(43,36,32,0.3);
}

.gallery-dots span.active {
  background: var(--terracotta-dark);
}

.modal-info {
  padding: 24px 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-info h2 {
  font-family: 'Bevan', serif;
  font-size: 20px;
  color: var(--forest);
  margin: 0 0 2px;
  line-height: 1.3;
}

.modal-price {
  font-family: 'Bevan', serif;
  font-size: 19px;
  color: var(--terracotta-dark);
  margin: 0;
}

.modal-desc {
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 4px 0 8px;
}

.modal-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--forest);
  background: var(--cream);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
  align-self: flex-start;
}

.modal-code {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

/* ---------- Category filter bar ---------- */

.category-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 12px;
  max-width: 1200px;
  margin: 0 auto;
  scrollbar-width: none;
}

.category-bar::-webkit-scrollbar { display: none; }

.category-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--forest);
  background: transparent;
  color: var(--forest);
  padding: 6px 16px;
  border-radius: 999px;
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.category-pill.active {
  background: var(--forest);
  color: var(--white);
}

.category-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  background: var(--forest);
  color: var(--white);
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  margin-top: auto;
}

.whatsapp-btn:hover { background: var(--forest-dark); }
