/* =====================================================================
   Página de categorías (productos.php) — 2026-12-01
   Prototipo aprobado: https://claude.ai/artifact/EoAWzS8irbSd9PKcLVJuAF
   Clases wpc-. Color de cada sección en --sec (lo pone el PHP en la pestaña y el panel).
   Ojo: css/styles.css pone button{display:inline-flex} sin centrar; acá se fija todo a mano.
   ===================================================================== */

.wpc { padding-top: 34px; }
.wpc-oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Título */
.wpc-cabeza { text-align: center; margin-bottom: 20px; }
.wpc-titulo { margin: 0; font-size: clamp(28px, 3.4vw, 42px); font-weight: 900; letter-spacing: -.02em; line-height: 1.1; color: #111; }
.wpc-bajada { margin: 8px auto 0; max-width: 640px; color: #4b5563; font-size: 16px; }

/* Franja de registro (visitantes de la web) */
.wpc-reg { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; background: #fff; border: 1px solid #e5e7eb; border-left: 4px solid #ffd718; border-radius: 14px; padding: 12px 16px; margin: 0 0 18px; }
.wpc-reg strong { display: block; font-size: 15px; color: #111; }
.wpc-reg span { display: block; font-size: 13.5px; color: #4b5563; }
.wpc-reg-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.wpc-btn-negro, .wpc-btn-linea { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 9px 16px; font-weight: 900; font-size: 13.5px; line-height: 1; white-space: nowrap; text-decoration: none !important; }
.wpc-btn-negro { background: #111; color: #fff !important; }
.wpc-btn-negro:hover { background: #004a90; }
.wpc-btn-linea { border: 1.5px solid #111; color: #111 !important; font-weight: 700; }

/* Selector de secciones (como las pestañas del home, con el color de cada sección) */
.wpc-contenido { position: relative; }
.wpc-selw { position: sticky; top: var(--wpc-top, 0px); z-index: 30; background: #f8f8f8; padding: 10px 0 14px; margin-bottom: 8px; transition: top .15s ease; }
.wpc-tabs { display: flex; gap: 4px; background: #f0f1f3; border: 1px solid #e2e5ea; border-radius: 999px; padding: 6px; margin: 0 auto; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; box-shadow: 0 8px 22px rgba(20, 30, 60, .06); }
.wpc-tabs::-webkit-scrollbar { display: none; }
.wpc-tab { border: 0; background: none; padding: 11px 22px; border-radius: 999px; color: #111 !important; text-decoration: none !important; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; line-height: 1; white-space: nowrap; flex: 0 0 auto; cursor: pointer; transition: background .15s ease, box-shadow .15s ease; }
.wpc-tab-t { display: flex; align-items: center; font-weight: 900; font-size: 15px; letter-spacing: .02em; }
.wpc-tab small { font-size: 11.5px; font-weight: 400; color: #6b7280; letter-spacing: 0; }
.wpc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sec); margin-right: 7px; }
.wpc-ext { font-size: 12px; margin-left: 4px; }
.wpc-tab:hover { background: rgba(255, 255, 255, .7); }
.wpc-tab.is-on { background: var(--sec); color: #fff !important; box-shadow: 0 6px 14px rgba(20, 30, 60, .22); }
.wpc-tab.is-on .wpc-dot { display: none; }
.wpc-tab.is-on small { color: rgba(255, 255, 255, .86); }
.wpc-tab:focus-visible, .wpc-chip:focus-visible, .wpc-tile:focus-visible, .wpc-mrow a:focus-visible { outline: 3px solid #ffd718; outline-offset: 2px; }

/* Buscador de categorías */
.wpc-bus { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #dfe3ea; border-radius: 999px; padding: 0 16px; max-width: 460px; margin: 12px auto 0; color: #6b7280; }
.wpc-bus input { border: 0 !important; outline: 0; flex: 1; min-width: 0; height: 40px; padding: 0 !important; font: inherit; font-size: 15px; color: #111; background: none !important; box-shadow: none !important; }
.wpc-sinres { text-align: center; color: #4b5563; margin: 18px 0; }

/* Filtros de Golosinas */
.wpc-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 6px 0 18px; }
.wpc-chip { border: 1.5px solid #d6dae2; background: #fff; color: #111; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 13.5px; line-height: 1; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.wpc-chip em { font-style: normal; color: #6b7280; font-weight: 400; }
.wpc-chip:hover { border-color: #111; }
.wpc-chip.is-on { background: #111; border-color: #111; color: #fff; }
.wpc-chip.is-on em { color: #cbd5e1; }

/* Tarjetas: foto entera + pie del color de la sección */
.wpc-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.wpc-grid.wpc-pocas { display: flex; flex-wrap: wrap; justify-content: center; }
.wpc-grid.wpc-pocas > .wpc-tile { flex: 0 0 calc((100% - 90px) / 6); }
.wpc-tile { position: relative; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--sec, #1f2a44); color: #fff !important; text-decoration: none !important; box-shadow: 0 6px 16px rgba(20, 30, 60, .10); transition: transform .12s ease, box-shadow .2s ease; will-change: transform; }
.wpc-tile:hover, .wpc-tile:focus { color: #fff !important; }
.wpc-tile:hover { box-shadow: 0 18px 32px rgba(20, 30, 60, .22); }
.wpc-tile[hidden], .wpc-tile.wpc-fuera { display: none !important; }
.wpc-ph { position: relative; display: block; aspect-ratio: 1 / 1; background: #fff; overflow: hidden; }
.wpc-ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
@supports not (aspect-ratio: 1 / 1) {
    .wpc-ph { height: 0; padding-bottom: 100%; }
    .wpc-ph img { position: absolute; top: 0; left: 0; }
}
.wpc-prov .wpc-ph { background: linear-gradient(160deg, #fff, #eef2f8); }
.wpc-prov .wpc-ph img { object-fit: contain; padding: 10%; }
.wpc-gl { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 2; pointer-events: none; background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, .42), transparent 55%); opacity: 0; transition: opacity .2s ease; }
.wpc-tile:hover .wpc-gl { opacity: 1; }
.wpc-ets { position: absolute; top: 10px; left: 10px; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.wpc-et { padding: 4px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 900; line-height: 1; color: #fff; background: #16a34a; }
.wpc-et-oferta { background: #e11d48; }
.wpc-pie { display: block; padding: 10px 13px 12px; text-align: left; }
.wpc-nom { display: block; font-weight: 900; font-size: 15.5px; line-height: 1.2; color: #fff; }
.wpc-n { display: block; position: relative; height: 1.45em; overflow: hidden; margin-top: 2px; font-size: 13px; line-height: 1.45; }
.wpc-cnt, .wpc-ver { display: block; transition: transform .22s ease, opacity .22s ease; }
.wpc-cnt { color: rgba(255, 255, 255, .86); }
.wpc-ver { position: absolute; left: 0; right: 0; top: 0; font-weight: 900; color: #fff; transform: translateY(100%); opacity: 0; }
.wpc-tile:hover .wpc-cnt { transform: translateY(-100%); opacity: 0; }
.wpc-tile:hover .wpc-ver { transform: none; opacity: 1; }
@media (hover: none) { .wpc-tile:active { transform: scale(.97); } }

/* Lanzamiento (Figuritas) */
.wpc-lanz { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; margin-top: 40px; padding: 22px 26px; border-radius: 20px; color: #fff; background: radial-gradient(420px 220px at 90% 30%, rgba(255, 255, 255, .14), transparent 70%), #111827; }
.wpc-lanz h3 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -.01em; line-height: 1.1; color: #fff; }
.wpc-lanz p { margin: 6px 0 12px; opacity: .92; color: #fff; }
.wpc-lanz-cta { display: inline-flex; align-items: center; background: #fff; color: #111 !important; border-radius: 999px; padding: 9px 16px; font-weight: 900; font-size: 14px; line-height: 1; text-decoration: none !important; }
.wpc-lanz-cta:hover { background: #ffd718; }
.wpc-lanz-fotos { display: flex; padding-left: 18px; }
.wpc-lanz-fotos img { width: 96px; height: 96px; object-fit: contain; background: #fff; border-radius: 16px; border: 3px solid rgba(255, 255, 255, .7); margin-left: -18px; box-shadow: 0 8px 18px rgba(0, 0, 0, .25); }
.wpc-lanz-fotos img:nth-child(2) { transform: translateY(-10px) rotate(-4deg); }

/* Marcas de golosinas: cada logo en su rectángulo blanco */
.wpc-marcas { margin-top: 44px; }
.wpc-marcas h3, .wpc-prods-h h3 { margin: 0; font-size: 21px; font-weight: 900; color: #111; }
.wpc-marcas h3 { margin-bottom: 12px; }
.wpc-mrow { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 14px; }
.wpc-mrow a { display: flex; align-items: center; justify-content: center; padding: 22px 12px; background: #fff; border: 1px solid #e3e7ee; border-radius: 16px; box-shadow: 0 4px 12px rgba(20, 30, 60, .05); transition: transform .2s ease, box-shadow .2s ease; }
.wpc-mrow a:hover { transform: translateY(-3px); box-shadow: 0 12px 22px rgba(20, 30, 60, .12); }
.wpc-mrow img { width: 100%; max-width: 150px; height: auto; }

/* Productos para agregar (separados de las categorías) */
.wpc-prods { margin-top: 48px; padding-top: 30px; border-top: 2px solid #e0e4ec; }
.wpc-prods-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.wpc-prods-h a { font-weight: 700; font-size: 14px; color: #111 !important; text-decoration: underline !important; }

.wpc-seo { margin: 34px auto 0; max-width: 820px; text-align: center; color: #4b5563; font-size: 14px; }
.wpc-solo-buscar { margin-top: 18px; }

/* Buscando: todas las secciones a la vista, solo las tarjetas que coinciden */
.wpc-buscando .wpc-panel { display: block !important; }
.wpc-buscando .wpc-chips, .wpc-buscando .wpc-lanz, .wpc-buscando .wpc-marcas, .wpc-buscando .wpc-prods { display: none !important; }
.wpc-buscando .wpc-panel.wpc-vacio { display: none !important; }
.wpc-buscando .wpc-panel + .wpc-panel { margin-top: 18px; }
.wpc-buscando .wpc-solo-buscar.wpc-con-res { display: flex !important; }

/* Tablet */
@media (max-width: 1199.98px) {
    .wpc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
    .wpc-grid.wpc-pocas > .wpc-tile { flex-basis: calc((100% - 48px) / 4); }
    .wpc-mrow { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Celular */
@media (max-width: 767.98px) {
    .wpc { padding-top: 18px; }
    .wpc-tabs { width: 100%; justify-content: flex-start; }
    .wpc-tab { padding: 10px 14px; }
    .wpc-tab-t { font-size: 13.5px; }
    .wpc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .wpc-grid.wpc-pocas > .wpc-tile { flex-basis: calc((100% - 12px) / 2); }
    .wpc-nom { font-size: 14.5px; }
    .wpc-chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; margin-left: -15px; margin-right: -15px; padding: 0 15px; }
    .wpc-chips::-webkit-scrollbar { display: none; }
    .wpc-chip { flex: 0 0 auto; }
    .wpc-lanz { grid-template-columns: minmax(0, 1fr); padding: 18px; }
    .wpc-lanz h3 { font-size: 22px; }
    .wpc-lanz-fotos { display: none; }
    .wpc-mrow { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 -15px; padding: 0 15px 4px; }
    .wpc-mrow a { flex: 0 0 132px; }
    .wpc-reg-btns { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .wpc-tile, .wpc-cnt, .wpc-ver, .wpc-gl, .wpc-mrow a, .wpc-selw { transition: none !important; }
}
