:root {
  --color-bg: #ffffff;
  --color-surface: #f7f7f5;
  --color-text: #111111;
  --color-text-muted: #6b6b6b;
  --color-border: #e6e4df;
  --color-accent: #b08d57; /* dorado sutil */
  --color-whatsapp: #25d366;
  --radius: 2px;
  --max-width: 1280px;
  --header-height: 72px;
  --transition: 180ms ease;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

h1,
h2,
h3,
.brand-logo-fallback {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
}

body.no-scroll {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #f8f8f8;
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.brand-logo {
  height: 40px;
  width: auto;
}

.brand-logo-fallback {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--color-text);
}

/* Hero */
.hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 64px 0 48px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero p {
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1rem;
}

/* Toolbar */
.toolbar {
  padding: 32px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-wrap {
  position: relative;
  max-width: 420px;
  width: 100%;
}

.search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

#search-input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.95rem;
  background: #fff;
  color: var(--color-text);
}

#search-input::placeholder {
  color: var(--color-text-muted);
}

#search-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

#brand-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-chip {
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.filter-chip:hover {
  border-color: var(--color-text);
}

.filter-chip.active {
  background: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
}

#result-count {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Gallery grid */
.gallery {
  padding: 8px 0 72px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 560px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

@media (min-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.product-card {
  cursor: pointer;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.product-card:hover,
.product-card:focus-visible {
  border-color: #d5d2ca;
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.06);
  transform: translateY(-2px);
  outline: none;
}

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--color-surface);
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.product-card:hover .product-media img {
  transform: scale(1.04);
}

.img-placeholder {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #b7b3a8;
  background: var(--color-surface);
}

.img-placeholder span {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sold-out-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: rgba(17, 17, 17, 0.82);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.modal-sold-out-badge {
  position: static;
  display: inline-block;
  margin-bottom: 10px;
}

.product-info {
  padding: 12px 14px 16px;
}

.product-brand {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.product-model {
  margin: 4px 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  min-height: 2.4em;
}

.product-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.product-price {
  font-weight: 700;
  font-size: 0.95rem;
}

.product-ref {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.empty-state {
  text-align: center;
  padding: 64px 16px;
  color: var(--color-text-muted);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.5);
}

.modal-panel {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  animation: slideUp 220ms ease;
}

@media (min-width: 640px) {
  .modal {
    align-items: center;
  }
  .modal-panel {
    border-radius: 12px;
    padding: 28px;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

.modal-close:hover {
  background: var(--color-surface);
}

.modal-media {
  max-width: 340px;
  margin: 0 auto 20px;
}

.carousel {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--color-surface);
  border-radius: 8px;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.15);
}

.carousel-prev {
  left: 8px;
}

.carousel-next {
  right: 8px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-border);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.carousel-dot.active {
  background: var(--color-text);
  transform: scale(1.3);
}

.grid-status {
  text-align: center;
  padding: 64px 16px;
  color: var(--color-text-muted);
}

.product-grid[hidden] {
  display: none;
}

.modal-brand {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.modal-model {
  margin: 6px 0 10px;
  font-size: 1.35rem;
  font-weight: 700;
}

.modal-ref {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0 0 14px;
}

.modal-price {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 22px;
  display: block;
}

.whatsapp-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--color-whatsapp);
  color: #fff;
  padding: 15px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  width: 100%;
  transition: filter var(--transition);
}

.whatsapp-cta:hover {
  filter: brightness(0.94);
}

.whatsapp-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  object-fit: contain;
}

.modal-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 12px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 32px 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.footer-logo {
  margin: 0 auto 10px;
  opacity: 0.85;
}
