/*
 * Catálogo & Consulta — Casa Osvaldo
 * Los colores y tipografías salen de las variables que ya define
 * el tema en style.css. Los valores de respaldo son los mismos,
 * escritos a mano, por si el catálogo se usa con otro tema.
 */

.cocc {
  --cocc-paper:  var(--paper,  #FAF7F1);
  --cocc-bone:   var(--bone,   #F4EFE6);
  --cocc-linen:  var(--linen,  #E8E1D2);
  --cocc-carbon: var(--carbon, #1A1A1A);
  --cocc-ink:    var(--ink,    #3A3A38);
  --cocc-mute:   var(--mute,   #8A867D);
  --cocc-rojo:   var(--rojo,   #B33A3A);
  --cocc-azul:   var(--azul,   #1F3A5F);
  --cocc-camel:  var(--camel,  #B58A5C);
  --cocc-sans:   var(--font-sans, "Plus Jakarta Sans", system-ui, sans-serif);
  --cocc-mono:   var(--font-mono, "Helvetica Neue", Helvetica, Arial, sans-serif);

  background: var(--cocc-paper);
  color: var(--cocc-carbon);
  font-family: var(--cocc-sans);
  padding: clamp(64px, 7vw, 112px) clamp(20px, 5vw, 80px) 160px;
  border-top: 1px solid var(--cocc-linen);
  box-sizing: border-box;
}
.cocc *, .cocc *::before, .cocc *::after { box-sizing: border-box; }

/*
 * El tema mete las páginas internas en una columna de 820px que ya
 * trae su propio padding. Si el shortcode cae ahí adentro, sacamos el
 * nuestro para no duplicarlo. Con la plantilla de página (main.cocc-page)
 * el catálogo va a ancho completo y conserva su respiración original.
 */
main:not(.cocc-page) .cocc {
  padding: 8px 0 140px;
  border-top: 0;
  background: transparent;
}

/* El tema no define esta clase de WordPress, así que la trae el plugin. */
.cocc .screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; white-space: nowrap;
  clip: rect(0 0 0 0); clip-path: inset(50%);
}

/* ─── Encabezado ─── */
.cocc-head { max-width: 760px; margin-bottom: 48px; }
.cocc-eyebrow {
  font-family: var(--cocc-mono); font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cocc-rojo); margin: 0 0 20px;
}
.cocc-title {
  font-family: var(--cocc-sans); font-weight: 800;
  font-size: clamp(30px, 3.2vw, 48px);
  line-height: 1.06; letter-spacing: -0.025em;
  color: var(--cocc-carbon); margin: 0 0 20px;
}
.cocc-lede {
  font-size: 16px; line-height: 1.8; font-weight: 300;
  color: var(--cocc-ink); margin: 0; max-width: 520px;
  padding-left: 24px; border-left: 2px solid var(--cocc-rojo);
}
.cocc-aviso {
  font-family: var(--cocc-mono); font-size: 12px; line-height: 1.6;
  color: var(--cocc-rojo); background: rgba(179,58,58,.06);
  border: 1px solid rgba(179,58,58,.2); border-radius: 2px;
  padding: 12px 16px; margin: 0 0 28px;
}

/* ─── Filtros y buscador ─── */
.cocc-tools {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding-bottom: 20px; margin-bottom: 4px;
  border-bottom: 1px solid var(--cocc-linen);
}
.cocc-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.cocc-chip {
  font-family: var(--cocc-mono); font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 8px 15px; border-radius: 2px; cursor: pointer;
  background: rgba(26,26,26,.06);
  color: var(--cocc-ink);
  border: 1px solid rgba(26,26,26,.1);
  transition: background .18s, color .18s, border-color .18s;
}
.cocc-chip:hover { border-color: rgba(26,26,26,.3); }
.cocc-chip.is-on {
  background: var(--cocc-carbon); color: #fff;
  border-color: var(--cocc-carbon);
}
.cocc-search { flex: 0 1 260px; }
.cocc-q {
  width: 100%; font-family: var(--cocc-sans); font-size: 14px;
  color: var(--cocc-carbon); background: transparent;
  border: 0; border-bottom: 1px solid rgba(26,26,26,.2);
  padding: 9px 2px; outline: none;
  transition: border-color .18s;
}
.cocc-q::placeholder { color: var(--cocc-mute); }
.cocc-q:focus { border-bottom-color: var(--cocc-rojo); }

/* ─── Listado ─── */
.cocc-list { margin-top: 4px; }
.cocc-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: start; gap: 18px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--cocc-linen);
  cursor: pointer;
  transition: background .16s;
}
.cocc-item:hover { background: rgba(26,26,26,.02); }
.cocc-item[hidden] { display: none; }

.cocc-check {
  position: absolute; opacity: 0;
  width: 1px; height: 1px; margin: 0; padding: 0;
  overflow: hidden; white-space: nowrap;
  clip: rect(0 0 0 0); clip-path: inset(50%);
}
.cocc-box {
  width: 18px; height: 18px; margin-top: 3px;
  border: 1.5px solid rgba(26,26,26,.28);
  border-radius: 2px; background: #fff;
  position: relative; flex: none;
  transition: border-color .16s, background .16s;
}
.cocc-box::after {
  content: ""; position: absolute;
  left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .16s cubic-bezier(0.2,0,0,1);
}
.cocc-item:hover .cocc-box { border-color: rgba(26,26,26,.55); }
.cocc-check:checked + .cocc-box {
  background: var(--cocc-rojo); border-color: var(--cocc-rojo);
}
.cocc-check:checked + .cocc-box::after { transform: rotate(45deg) scale(1); }
.cocc-check:focus-visible + .cocc-box {
  outline: 2px solid var(--cocc-azul); outline-offset: 2px;
}

.cocc-body { display: block; min-width: 0; }
.cocc-name {
  display: block; font-size: 15px; font-weight: 600;
  line-height: 1.4; color: var(--cocc-carbon);
  letter-spacing: -0.01em;
}
.cocc-ref {
  font-family: var(--cocc-mono); font-size: 9px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cocc-mute); margin-left: 10px;
  white-space: nowrap;
}
.cocc-brand {
  display: block; margin-top: 5px;
  font-family: var(--cocc-mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cocc-camel, #B58A5C);
}
.cocc-desc {
  display: block; margin-top: 5px;
  font-size: 13.5px; line-height: 1.7; font-weight: 300;
  color: var(--cocc-ink); max-width: 620px;
}
.cocc-line {
  font-family: var(--cocc-mono); font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cocc-mute); white-space: nowrap;
  padding-top: 4px;
}
.cocc-empty {
  padding: 48px 4px; font-size: 14px; font-weight: 300;
  color: var(--cocc-mute);
}

/* ─── Anterior / Siguiente ─── */
.cocc-pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 32px 4px 0;
}
.cocc-pager[hidden] { display: none; }
.cocc-prev, .cocc-next {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--cocc-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--cocc-carbon); cursor: pointer;
  background: none; border: 1px solid rgba(26,26,26,.18);
  border-radius: 2px; padding: 13px 24px;
  transition: gap .18s, border-color .18s, color .18s;
}
.cocc-prev:hover, .cocc-next:hover {
  gap: 18px; border-color: var(--cocc-carbon);
}
.cocc-prev:disabled, .cocc-next:disabled {
  opacity: .3; cursor: default; gap: 12px;
  border-color: rgba(26,26,26,.14);
}
.cocc-range {
  font-family: var(--cocc-mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--cocc-mute); margin: 0;
}

/* ─── Barra inferior fija ─── */
.cocc-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--cocc-carbon); color: #fff;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(0.2,0,0,1);
  box-shadow: 0 -12px 40px rgba(0,0,0,.18);
}
.cocc-bar.is-up { transform: translateY(0); }
.cocc-bar-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 18px 80px;
  max-width: 1600px; margin: 0 auto;
}
.cocc-count {
  font-family: var(--cocc-mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,.62); margin: 0;
}
.cocc-count strong { color: #fff; font-size: 13px; letter-spacing: 0.06em; }
.cocc-bar-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cocc-warn {
  font-family: var(--cocc-sans); font-size: 12px; font-weight: 400;
  line-height: 1.4; color: #E8A87C; margin: 0; max-width: 46ch;
}
.cocc-warn[hidden] { display: none; }
.cocc-bar-actions { display: flex; align-items: center; gap: 22px; }
.cocc-clear {
  font-family: var(--cocc-mono); font-size: 9px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,.5);
  background: none; border: none; cursor: pointer; padding: 6px 2px;
  transition: color .18s;
}
.cocc-clear:hover { color: #fff; }
.cocc-copy {
  font-family: var(--cocc-mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: #fff; background: rgba(255,255,255,.1); cursor: pointer;
  border: 1px solid rgba(255,255,255,.3); border-radius: 2px;
  padding: 12px 18px; white-space: nowrap;
  transition: background .18s, border-color .18s;
}
.cocc-copy:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.6); }
.cocc-copy.is-done { background: #3E7C5A; border-color: #3E7C5A; }
.cocc-copy[hidden] { display: none; }
.cocc-send {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--cocc-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: #fff; text-decoration: none;
  padding: 13px 26px; border-radius: 2px;
  background: var(--cocc-rojo);
  transition: gap .18s, background .18s;
}
.cocc-send:hover { gap: 20px; background: var(--rojo-deep, #8E2A2A); color: #fff; }
.cocc-send.is-off { opacity: .4; pointer-events: none; }

/* ─── Plantilla de página ─── */
.cocc-page { padding-top: 96px; }  /* deja pasar el nav fijo del tema */
.cocc-page-intro {
  max-width: 820px; margin: 0 auto;
  padding: 48px 80px 0;
  font-size: 16px; line-height: 1.8;
  color: var(--ink, #3A3A38);
}

/* ─── Mobile ─── */
@media (max-width: 900px) {
  .cocc { padding: 72px 24px 140px; }
  main:not(.cocc-page) .cocc { padding: 8px 0 130px; }
  .cocc-tools { gap: 16px; }
  .cocc-search { flex: 1 1 100%; }
  .cocc-item { grid-template-columns: 20px 1fr; gap: 14px; padding: 20px 2px; }
  .cocc-line { grid-column: 2; padding-top: 8px; }
  .cocc-pager { padding-top: 26px; gap: 12px; }
  .cocc-prev, .cocc-next { flex: 1; justify-content: center; padding: 14px 12px; }
  .cocc-range { order: 3; width: 100%; text-align: center; }
  .cocc-bar-in { padding: 14px 20px; gap: 12px; }
  .cocc-bar-actions { width: 100%; justify-content: space-between; }
  .cocc-bar-info { width: 100%; }
  .cocc-warn { font-size: 11.5px; max-width: none; }
  .cocc-send { flex: 1; justify-content: center; padding: 15px 20px; }
  .cocc-page-intro { padding: 40px 28px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cocc-bar, .cocc-box::after, .cocc-send, .cocc-item { transition: none; }
}
