/* ============================================================
   CATÁLOGO — catalogo.css
   Layout: sidebar fijo izquierda + main scrollable derecha
   ============================================================ */

/* ── Body override para página catálogo ───────────────────── */
.page-catalogo {
  background: #f0f0f0;
  color: #111;
  overflow: auto; /* sin snap */
}
.page-catalogo .snap-container { display: contents; }
.page-catalogo .snap-section   { min-height: unset; scroll-snap-align: unset; }

/* ── Layout principal ─────────────────────────────────────── */
.cat-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 68px; /* altura navbar */
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
.cat-sidebar {
  width: 270px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow-y: auto;
}
.cat-sidebar::-webkit-scrollbar { width: 4px; }
.cat-sidebar::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 2px; }

.cat-sidebar-inner { padding: 1.5rem 0 2rem; }
.cat-sidebar-title {
  font-family: var(--font-display);
  font-size: .6rem;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(0,0,0,.35);
  padding: 0 1.5rem .75rem;
  border-bottom: 1px solid #ebebeb;
  margin-bottom: .5rem;
}

/* Nav items */
.cat-nav { display: flex; flex-direction: column; }
.cat-nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1.5rem;
  font-size: .82rem;
  font-weight: 500;
  color: rgba(0,0,0,.55);
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  cursor: pointer;
  line-height: 1.3;
}
.cat-nav-item:hover {
  background: #f7f7f7;
  color: var(--green);
}
.cat-nav-item.active {
  background: rgba(32,120,0,.06);
  color: var(--green);
  border-left-color: var(--green);
  font-weight: 700;
}
.cat-nav-num {
  font-family: var(--font-display);
  font-size: .65rem;
  color: rgba(0,0,0,.25);
  min-width: 22px;
  flex-shrink: 0;
}
.cat-nav-item.active .cat-nav-num { color: var(--green); }

/* CTA sidebar */
.cat-sidebar-cta {
  margin: 1.5rem 1.5rem 0;
  background: rgba(32,120,0,.06);
  border: 1px solid rgba(32,120,0,.2);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
}
.cat-sidebar-cta p {
  font-size: .78rem;
  color: rgba(0,0,0,.5);
  margin-bottom: .75rem;
  line-height: 1.45;
}

/* ── MAIN ─────────────────────────────────────────────────── */
.cat-main {
  flex: 1;
  padding: 2rem 3rem 4rem;
  max-width: 1100px;
  overflow-x: hidden;
}

/* Breadcrumb */
.cat-breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  color: rgba(0,0,0,.35);
  margin-bottom: 1.5rem;
}
.cat-breadcrumb a { color: var(--green); transition: opacity .2s; }
.cat-breadcrumb a:hover { opacity: .7; }

/* Header */
.cat-header { margin-bottom: 2.5rem; }
.cat-main-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  font-weight: 400;
  color: var(--blue-dark);
  line-height: 1.1;
}
.cat-main-sub {
  font-size: .85rem;
  color: rgba(0,0,0,.45);
  margin-top: .5rem;
}

/* ── SECTION ─────────────────────────────────────────────── */
.cat-section {
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid #e8e8e8;
  margin-bottom: 1.5rem;
  overflow: hidden;
  scroll-margin-top: 88px; /* offset scroll al hacer click en sidebar */
  transition: box-shadow .2s;
}
.cat-section:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
}

/* Section header */
.cat-section-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}
.cat-section-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  color: rgba(0,0,0,.12);
  line-height: 1;
  min-width: 52px;
  border-bottom: 2px solid var(--green);
  padding-bottom: 2px;
}
.cat-section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--blue-dark);
  margin: 0;
}
.cat-section-desc {
  font-size: .78rem;
  color: rgba(0,0,0,.45);
  margin-top: .2rem;
  line-height: 1.5;
}
.cat-section-img {
  margin-left: auto;
  flex-shrink: 0;
}
.cat-section-img img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.12));
}

/* Products grid — 3 columnas */
.cat-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

/* Product item */
.cat-product-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.5rem;
  border-right: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  font-size: .82rem;
  color: rgba(0,0,0,.65);
  font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.cat-product-item:nth-child(3n) { border-right: none; }
.cat-product-item:hover {
  background: rgba(32,120,0,.04);
  color: var(--green);
}
.cat-product-item:hover .cat-product-arrow { opacity: 1; transform: translateX(3px); }
.cat-product-arrow {
  font-size: .8rem;
  color: var(--green);
  opacity: 0;
  transition: opacity .15s, transform .15s;
}
.cat-product-item--cta {
  grid-column: 1 / -1;
  color: var(--green);
  font-style: italic;
}
.cat-product-item--cta .cat-product-arrow { opacity: 1; }

/* ── CTA FINAL ────────────────────────────────────────────── */
.cat-footer-cta {
  background: var(--blue-dark);
  border-radius: var(--radius-xl);
  padding: 3rem;
  text-align: center;
  margin-top: 2rem;
}
.cat-footer-cta h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--white);
}
.cat-footer-cta p {
  font-size: .9rem;
  color: var(--muted);
  margin: .75rem auto 1.5rem;
  max-width: 500px;
  line-height: 1.65;
}
.cat-footer-cta .btn-wa {
  margin-top: 0;
  display: inline-flex;
}

/* ── Navbar override para página light ───────────────────── */
.page-catalogo #navbar {
  background: var(--green-nav);
}
.page-catalogo #navbar.scrolled {
  background: rgba(0,0,0,.92);
}
.page-catalogo .nav-active {
  border-bottom: 2px solid rgba(255,255,255,.6);
  padding-bottom: 2px;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1200px) {
  .cat-main { padding: 2rem 2rem 4rem; }
  .cat-products-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-product-item:nth-child(3n) { border-right: 1px solid #f0f0f0; }
  .cat-product-item:nth-child(2n) { border-right: none; }
}
@media (max-width: 900px) {
  .cat-sidebar { width: 220px; }
  .cat-main { padding: 1.5rem 1.5rem 3rem; }
}
@media (max-width: 768px) {
  .cat-layout { flex-direction: column; }
  .cat-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }
  .cat-nav { flex-direction: row; flex-wrap: wrap; padding: 0 .75rem; gap: .25rem; }
  .cat-nav-item { padding: .4rem .75rem; border-left: none; border-radius: var(--radius); font-size: .75rem; }
  .cat-nav-item.active { background: rgba(32,120,0,.1); border-left: none; }
  .cat-nav-num { display: none; }
  .cat-sidebar-cta { display: none; }
  .cat-products-grid { grid-template-columns: 1fr; }
  .cat-product-item { border-right: none !important; }
  .cat-section-img { display: none; }
}

/* ── Secciones de catálogo clickeables → página de categoría ── */
.cat-section-header { cursor: pointer; transition: background .2s; }
.cat-section-header:hover { background: #f0faf4; }
.cat-section-link-badge {
  margin-left: auto;
  font-size: .7rem;
  font-weight: 700;
  color: var(--green);
  border: 1px solid rgba(32,120,0,.3);
  border-radius: var(--radius);
  padding: .3rem .75rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.cat-section-header:hover .cat-section-link-badge {
  background: var(--green);
  color: #fff;
}

/* Cards de catálogo — degradado verde en imagen */
.cat-section:nth-child(1) .cat-section-img { background: linear-gradient(135deg,#b8edc8,#7ed4a0); border-radius:var(--radius); }
.cat-section:nth-child(2) .cat-section-img { background: linear-gradient(135deg,#7ed4a0,#4fba82); border-radius:var(--radius); }
.cat-section:nth-child(3) .cat-section-img { background: linear-gradient(135deg,#4fba82,#2ea86a); border-radius:var(--radius); }
.cat-section:nth-child(4) .cat-section-img { background: linear-gradient(135deg,#2ea86a,#1a9058); border-radius:var(--radius); }
.cat-section:nth-child(5) .cat-section-img { background: linear-gradient(135deg,#1a9058,#0d7848); border-radius:var(--radius); }
.cat-section:nth-child(6) .cat-section-img { background: linear-gradient(135deg,#0d7848,#086038); border-radius:var(--radius); }
.cat-section:nth-child(7) .cat-section-img { background: linear-gradient(135deg,#086038,#054a2c); border-radius:var(--radius); }
.cat-section:nth-child(8) .cat-section-img { background: linear-gradient(135deg,#054a2c,#032018); border-radius:var(--radius); }
.cat-section:nth-child(9) .cat-section-img { background: linear-gradient(135deg,#0d7848,#086038); border-radius:var(--radius); }


/* ULTRAWIDE — catálogo principal */
@media (min-width: 1920px) {
  .cat-layout   { max-width: 1500px; margin: 0 auto; }
  /* 4 columnas en lugar de 3 para aprovechar el espacio */
  .cat-products-grid { grid-template-columns: repeat(4, 1fr); }
  /* Pero los cards no crecen más de 320px */
  .cat-card     { max-width: 320px; }
}
@media (min-width: 2560px) {
  .cat-products-grid { grid-template-columns: repeat(5, 1fr); }
  .cat-layout   { max-width: 1800px; }
}
