*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --p-green: #0d5c3a;
  --p-green-dark: #073d27;
  --p-cream: #fbfbf9;
  --p-gold: #bfa34b;
  --p-gold-lt: #d4bc6e;
  --p-text: #1a2e24;
  --p-muted: #6b7d74;
  --p-border: rgba(13, 92, 58, .14);
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --max-w: 1160px;
  --nav-h: 72px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--p-cream);
  color: var(--p-text);
  line-height: 1.6;
  padding-top: var(--nav-h);
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

/* ══════════════════════════════════════
   NAV (mismo comportamiento que index.html)
   ══════════════════════════════════════ */
nav#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  background: rgba(7, 61, 39, .92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background .4s ease, box-shadow .4s ease, transform .38s cubic-bezier(.4, 0, .2, 1);
}

nav#navbar.scrolled {
  box-shadow: 0 2px 28px rgba(0, 0, 0, .18);
}

nav#navbar.nav-hidden {
  transform: translateY(-100%);
}

.nav-logo img {
  height: 56px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .04em;
  transition: color .2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--p-gold-lt);
}

.nav-cta {
  background: var(--p-gold) !important;
  color: var(--p-green-dark) !important;
  padding: .5rem 1.25rem;
  border-radius: 4px;
  font-weight: 600 !important;
  transition: background .2s, transform .2s !important;
}

.nav-cta:hover {
  background: var(--p-gold-lt) !important;
  transform: translateY(-1px);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all .3s;
}

.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile-overlay {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: rgba(7, 61, 39, .97);
  backdrop-filter: blur(20px);
  padding: 1.5rem 2rem;
  z-index: 999;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid rgba(191, 163, 75, .15);
}

.nav-mobile-overlay.open {
  display: flex;
}

.nav-mobile-overlay a {
  color: rgba(255, 255, 255, .8);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: .85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.nav-mobile-overlay a.active {
  color: var(--p-gold-lt);
}

.nav-mobile-overlay a:last-child {
  border-bottom: none;
  padding-top: 1rem;
}

.nav-mobile-overlay .mob-cta {
  background: var(--p-gold);
  color: var(--p-green-dark) !important;
  text-align: center;
  border-radius: 6px;
  padding: .85rem 1rem !important;
  font-weight: 700 !important;
  margin-top: .5rem;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}

/* ══════════════════════════════════════
   HEADER DE PÁGINA
   ══════════════════════════════════════ */
.catalogo-header {
  background: linear-gradient(135deg, var(--p-green-dark) 0%, var(--p-green) 100%);
  color: #fff;
  text-align: center;
  padding: 4rem 1.5rem 3rem;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--p-gold-lt);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: .9rem;
}

.catalogo-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: .75rem;
}

.catalogo-header p {
  color: rgba(255, 255, 255, .72);
  max-width: 520px;
  margin: 0 auto;
  font-size: .98rem;
}

/* ══════════════════════════════════════
   LAYOUT CATÁLOGO
   ══════════════════════════════════════ */
.catalogo-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  padding-top: 3rem;
  padding-bottom: 5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .catalogo-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Filtros ── */
.filtros {
  background: #fff;
  border: 1px solid var(--p-border);
  border-radius: 12px;
  padding: 1.25rem;
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}

@media (max-width: 860px) {
  .filtros { position: static; }
}

/* ── Filtro de marcas ── */
.marca-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding-bottom: 1rem;
  margin-bottom: .75rem;
  border-bottom: 1px solid var(--p-border);
}

.marca-pill {
  background: rgba(13, 92, 58, .06);
  border: 1px solid var(--p-border);
  border-radius: 20px;
  padding: .3rem .75rem;
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 600;
  color: var(--p-muted);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.marca-pill:hover {
  background: rgba(13, 92, 58, .12);
  color: var(--p-green);
  border-color: var(--p-green);
}

.marca-pill.active {
  background: var(--p-green);
  color: #fff;
  border-color: var(--p-green);
}

/* Etiqueta de marca en el acordeón (modo Todas) */
.cat-marca {
  font-size: .72rem;
  font-weight: 400;
  color: var(--p-gold);
  margin-left: .35rem;
  font-style: normal;
}

/* Etiqueta de marca en tarjeta de producto */
.producto-marca-tag {
  font-size: .72rem;
  font-weight: 600;
  color: var(--p-gold);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: .2rem;
}

.filtros-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--p-border);
}

.filtros-head h2 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--p-green-dark);
}

.filtro-reset {
  background: none;
  border: none;
  color: var(--p-green);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  transition: color .2s;
}

.filtro-reset:hover {
  color: var(--p-gold);
}

.cat-item {
  border-bottom: 1px solid var(--p-border);
}

.cat-item:last-child {
  border-bottom: none;
}

.cat-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  padding: .75rem .25rem;
  font-family: var(--font-sans);
  font-size: .92rem;
  font-weight: 600;
  color: var(--p-text);
  cursor: pointer;
  text-align: left;
  transition: color .2s;
}

.cat-toggle:hover {
  color: var(--p-green);
}

.cat-toggle .chevron {
  transition: transform .25s ease;
  color: var(--p-gold);
  font-size: .75rem;
}

.cat-item.open .cat-toggle .chevron {
  transform: rotate(90deg);
}

.subcat-list {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}

.cat-item.open .subcat-list {
  max-height: 600px;
}

.subcat-list button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: .5rem .5rem .5rem 1rem;
  font-family: var(--font-sans);
  font-size: .85rem;
  color: var(--p-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: background .2s, color .2s;
}

.subcat-list button:hover {
  background: rgba(13, 92, 58, .06);
  color: var(--p-green);
}

.subcat-list button.active {
  background: var(--p-green);
  color: #fff;
  font-weight: 600;
}

/* ── Grid de productos ── */
.grid-status {
  font-size: .9rem;
  color: var(--p-muted);
  margin-bottom: 1rem;
}

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

.producto-card {
  background: #fff;
  border: 1px solid var(--p-border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  display: flex;
  flex-direction: column;
}

.producto-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 32px rgba(13, 92, 58, .14);
  border-color: var(--p-gold);
}

.producto-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #f1f3ee 0%, #e6ebe3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.producto-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: .75rem;
}

.producto-img .img-placeholder {
  color: var(--p-muted);
  font-size: .72rem;
  text-align: center;
  padding: 1rem;
}

.producto-body {
  padding: 1rem 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.badge {
  display: inline-block;
  align-self: flex-start;
  background: rgba(191, 163, 75, .15);
  color: var(--p-gold);
  border: 1px solid rgba(191, 163, 75, .35);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .25rem .6rem;
  border-radius: 20px;
  margin-bottom: .65rem;
}

.producto-titulo {
  font-size: .92rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--p-green-dark);
  letter-spacing: .01em;
  margin-bottom: .35rem;
  line-height: 1.3;
}

.producto-invima {
  font-size: .72rem;
  color: var(--p-muted);
  margin-bottom: .75rem;
}

.producto-precio { display: none; }

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--p-green);
  color: #fff;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
  padding: .65rem 1rem;
  border-radius: 8px;
  margin-top: auto;
  transition: background .2s, transform .2s;
}

.btn-whatsapp:hover {
  background: var(--p-gold);
  color: var(--p-green-dark);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════
   MODAL DETALLE
   ══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(7, 31, 22, .72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--p-cream);
  border-radius: 16px;
  max-width: 780px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  transform: scale(.94) translateY(18px);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
  box-shadow: 0 32px 80px rgba(0, 0, 0, .35);
}

.modal-overlay.open .modal-box {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: .9rem; right: .9rem;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(13, 92, 58, .08);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--p-green-dark);
  z-index: 2;
  transition: background .2s;
}

.modal-close:hover {
  background: rgba(13, 92, 58, .18);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

@media (max-width: 640px) {
  .modal-body { grid-template-columns: 1fr; }
}

.modal-galeria {
  background: #f1f3ee;
  padding: 1.5rem;
}

.modal-img-principal {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: .85rem;
}

.modal-img-principal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
}

.modal-thumbs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.modal-thumbs img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  padding: .25rem;
  transition: border-color .2s;
}

.modal-thumbs img.active,
.modal-thumbs img:hover {
  border-color: var(--p-gold);
}

.modal-info {
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
}

.modal-info h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--p-green-dark);
  text-transform: uppercase;
  margin: .6rem 0 .5rem;
  line-height: 1.3;
}

.modal-invima {
  font-size: .8rem;
  color: var(--p-muted);
  margin-bottom: 1rem;
}

.modal-precio {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--p-green);
  margin-bottom: 1rem;
}

.modal-obs {
  font-size: .82rem;
  color: var(--p-muted);
  white-space: pre-line;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal-info .btn-whatsapp {
  font-size: .9rem;
  padding: .85rem 1.25rem;
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */
.catalogo-footer {
  background: var(--p-green-dark);
  color: rgba(255, 255, 255, .6);
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: .82rem;
}

.catalogo-footer img {
  height: 42px;
  filter: brightness(0) invert(1);
  margin-bottom: 1rem;
}

.catalogo-footer a {
  color: var(--p-gold-lt);
  text-decoration: none;
  display: inline-block;
  margin-top: .5rem;
}

.catalogo-footer a:hover {
  text-decoration: underline;
}
