:root {
  --beige-claro: #f5ede0;
  --beige-medio: #ece0cc;
  --beige-papel: #faf4ea;
  --marron-oscuro: #3e2c20;
  --marron-suave: #6b4f3a;
  --terracota: #c97b5a;
  --terracota-oscuro: #a85e3f;
  --dorado: #b8935a;
  --whatsapp: #25d366;
  --whatsapp-hover: #1ea855;
  --sombra-suave: 0 2px 12px rgba(62, 44, 32, 0.08);
  --sombra-card: 0 4px 18px rgba(62, 44, 32, 0.12);
  --radio: 12px;
  --max-ancho: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--beige-claro);
  color: var(--marron-oscuro);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--terracota-oscuro);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- HEADER ---------- */
.header {
  background: linear-gradient(180deg, var(--beige-papel) 0%, var(--beige-claro) 100%);
  border-bottom: 1px solid var(--beige-medio);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}

.header-inner {
  max-width: var(--max-ancho);
  margin: 0 auto;
}

.brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--marron-oscuro);
}

.brand-sub {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--terracota);
  margin: 0.25rem 0 0.75rem;
  letter-spacing: 0.15em;
  text-transform: lowercase;
}

.tagline {
  font-size: 0.95rem;
  color: var(--marron-suave);
  margin: 0;
  font-style: italic;
}

/* ---------- NAV CATEGORIAS ---------- */
.categorias-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--beige-papel);
  border-bottom: 1px solid var(--beige-medio);
  box-shadow: var(--sombra-suave);
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.categoria-btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  background: transparent;
  border: 1.5px solid var(--beige-medio);
  color: var(--marron-suave);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.categoria-btn:hover {
  border-color: var(--terracota);
  color: var(--terracota-oscuro);
}

.categoria-btn.activa {
  background: var(--terracota);
  border-color: var(--terracota);
  color: white;
}

/* ---------- BARRA DE ORDEN ---------- */
.orden-barra {
  max-width: var(--max-ancho);
  margin: 0 auto;
  padding: 1rem 1.25rem 0;
  display: flex;
  justify-content: flex-end;
}

.orden-control {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--marron-suave);
}

.orden-control select {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--marron-oscuro);
  background: var(--beige-papel);
  border: 1.5px solid var(--beige-medio);
  border-radius: 999px;
  padding: 0.4rem 2rem 0.4rem 0.9rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b4f3a' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  transition: border-color 0.18s ease;
}

.orden-control select:hover,
.orden-control select:focus {
  border-color: var(--terracota);
  outline: none;
}

@media (max-width: 480px) {
  .orden-barra {
    justify-content: stretch;
    padding: 0.85rem 1rem 0;
  }
  .orden-control {
    width: 100%;
    justify-content: space-between;
  }
  .orden-control select {
    flex: 1;
    margin-left: 0.5rem;
  }
}

/* ---------- CATALOGO ---------- */
.catalogo {
  max-width: var(--max-ancho);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.estado {
  text-align: center;
  font-style: italic;
  color: var(--marron-suave);
  padding: 3rem 1rem;
}

.categoria-seccion {
  margin-bottom: 3.5rem;
  scroll-margin-top: 80px;
}

.categoria-titulo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--marron-oscuro);
  margin: 0 0 0.25rem;
  border-bottom: 2px solid var(--dorado);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.categoria-vacia {
  color: var(--marron-suave);
  font-style: italic;
  margin: 1rem 0 0;
}

.grid-productos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.producto-card {
  background: var(--beige-papel);
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.producto-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(62, 44, 32, 0.16);
}

.producto-img-wrap {
  aspect-ratio: 1 / 1;
  background: var(--beige-medio);
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
}

/* Indicador de "varias fotos" en la portada */
.producto-cant {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  background: rgba(62, 44, 32, 0.78);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.producto-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.producto-info {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.producto-codigo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  color: var(--marron-oscuro);
  margin: 0;
  letter-spacing: 0.04em;
}

.producto-codigo strong {
  color: var(--terracota-oscuro);
  font-weight: 600;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--whatsapp);
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.18s ease;
}

.btn-whatsapp:hover {
  background: var(--whatsapp-hover);
  text-decoration: none;
}

.btn-whatsapp svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ---------- LIGHTBOX / GALERIA ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(30, 20, 12, 0.93);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.lightbox.abierta {
  display: flex;
}

.lb-img {
  max-width: min(100%, 1100px);
  max-height: 85vh;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.lb-btn {
  position: absolute;
  background: rgba(250, 244, 234, 0.9);
  color: var(--marron-oscuro);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lb-btn:hover {
  background: #fff;
}

.lb-cerrar {
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
}

.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}
.lb-prev {
  left: 1rem;
}
.lb-next {
  right: 1rem;
}

.lb-info {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--beige-papel);
  color: var(--marron-oscuro);
  padding: 0.45rem 1.2rem;
  border-radius: 999px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.lb-contador {
  color: var(--marron-suave);
}

@media (max-width: 480px) {
  .lb-prev,
  .lb-next {
    width: 40px;
    height: 40px;
    font-size: 1.6rem;
  }
  .lb-prev {
    left: 0.4rem;
  }
  .lb-next {
    right: 0.4rem;
  }
}

/* ---------- FOOTER ---------- */
.footer {
  background: var(--marron-oscuro);
  color: var(--beige-claro);
  text-align: center;
  padding: 2rem 1rem;
  margin-top: auto;
}

.footer p {
  margin: 0.25rem 0;
}

.footer-wa {
  color: var(--dorado);
  font-weight: 500;
}

.footer-fine {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 0.75rem !important;
}

.footer-credito {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-top: 0.35rem !important;
  letter-spacing: 0.03em;
}

.footer-chroma {
  color: var(--dorado);
  font-weight: 500;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 480px) {
  .header {
    padding: 2rem 1rem 1.75rem;
  }
  .grid-productos {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
  .producto-info {
    padding: 0.65rem 0.75rem 0.85rem;
  }
  .btn-whatsapp {
    font-size: 0.85rem;
    padding: 0.5rem 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
