/* Catálogo — se apoya en los tokens de styles.css */
.cat-page { background: var(--bg-soft); }
.cat-hero { background: linear-gradient(120deg, var(--navy) 0%, #1f2370 100%); color: #fff; padding: 56px 0 40px; }
.cat-hero .eyebrow { color: var(--cyan); }
.cat-hero h1 { font-family: 'Poppins', sans-serif; color: #fff; font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: .6rem; }
.cat-hero > .wrap > p { max-width: 720px; opacity: .88; margin-bottom: 26px; }

.cat-search { position: relative; max-width: 760px; }
.cat-search svg { position: absolute; left: 20px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); fill: none; stroke: var(--navy); stroke-width: 2.2; stroke-linecap: round; }
.cat-search input { width: 100%; font: inherit; font-size: 1.05rem; padding: 18px 52px 18px 54px; border: 0; border-radius: 999px; color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.25); outline: 3px solid transparent; }
.cat-search input:focus { outline-color: var(--cyan); }
.cat-search input::-webkit-search-cancel-button { display: none; }
.cat-search button { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 50%; background: #eef1f5; color: var(--navy); cursor: pointer; font-size: .9rem; }

.cat-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; max-width: 760px; }
.cat-modes a { text-decoration: none; padding: 16px 18px; border-radius: var(--radius); border: 2px solid rgba(255,255,255,.22); background: rgba(255,255,255,.06); transition: background .15s, border-color .15s, transform .15s; }
.cat-modes a:hover { transform: translateY(-2px); border-color: var(--cyan); }
.cat-modes a.on { background: var(--cyan); border-color: var(--cyan); color: var(--navy); }
.cat-modes b { display: block; font-size: 1.05rem; }
.cat-modes small { display: block; opacity: .8; font-size: .82rem; }

.cat-main { padding-top: 26px; padding-bottom: 90px; min-height: 60vh; }
.cat-loading { padding: 60px 0; text-align: center; color: var(--muted); }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 1.2em; }
.crumbs a { color: #0ba8c6; font-weight: 600; text-decoration: none; }
.crumbs i { font-style: normal; opacity: .6; }
.v-title { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.h-ico { width: 34px; height: 34px; fill: none; stroke: #0ba8c6; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.h-logo { height: 46px; width: auto; }

/* Grillas de categorías / aplicaciones */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile { display: flex; gap: 16px; align-items: flex-start; background: #fff; border-radius: var(--radius); padding: 22px 20px; text-decoration: none; box-shadow: var(--shadow); border: 2px solid transparent; transition: transform .15s, border-color .15s; }
.tile:hover { transform: translateY(-3px); border-color: var(--cyan); }
.tile-ico { width: 46px; height: 46px; flex: none; padding: 9px; border-radius: 12px; background: var(--navy); fill: none; stroke: var(--cyan); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile b { display: block; color: var(--navy); font-size: 1.08rem; line-height: 1.25; }
.tile small { display: block; color: var(--muted); font-size: .85rem; margin-top: 4px; line-height: 1.4; }
.tile em { display: inline-block; font-style: normal; font-size: .78rem; font-weight: 700; color: #0ba8c6; margin-top: 8px; }

/* Marcas */
.brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.brand { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 14px 14px; text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 10px; min-height: 120px; border: 2px solid transparent; transition: transform .15s, border-color .15s; }
.brand:hover { transform: translateY(-3px); border-color: var(--cyan); }
.brand img { max-height: 56px; max-width: 80%; object-fit: contain; margin: auto; }
.wordmark { margin: auto; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.25rem; color: var(--navy); letter-spacing: .02em; text-align: center; }
.brand small { color: var(--muted); font-size: .78rem; }

/* Listado */
.l-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.l-count { color: var(--muted); font-size: .9rem; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin-bottom: 10px; scrollbar-width: thin; }
.chip { flex: none; text-decoration: none; padding: 8px 14px; border-radius: 999px; background: #fff; color: var(--navy); font-weight: 600; font-size: .88rem; border: 1px solid #dde3ec; white-space: nowrap; }
.chip small { color: var(--muted); font-weight: 500; margin-left: 2px; }
.chip:hover { border-color: var(--cyan); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip.on small { color: var(--cyan); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.pcard { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.p-top { display: flex; gap: 10px; align-items: center; }
.p-ico { width: 34px; height: 34px; flex: none; padding: 6px; border-radius: 9px; background: var(--bg-soft); fill: none; stroke: var(--navy); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.p-brand { display: block; font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: #0ba8c6; }
.p-sub { display: block; font-size: .78rem; color: var(--muted); line-height: 1.3; }
.pcard h3 { font-size: 1rem; line-height: 1.35; font-family: 'Raleway', sans-serif; font-weight: 700; }
.pcard details { font-size: .85rem; color: var(--muted); }
.pcard summary { cursor: pointer; color: #0ba8c6; font-weight: 600; }
.p-n { font-size: .78rem; color: var(--muted); }
.one { font-size: .88rem; color: var(--muted); }
.vars { display: flex; flex-wrap: wrap; gap: 6px; }
.var { font: inherit; font-size: .82rem; padding: 6px 10px; border-radius: 8px; border: 1px solid #dde3ec; background: #fff; color: var(--text); cursor: pointer; text-align: left; }
.var.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.sel { font: inherit; font-size: .88rem; padding: 9px 10px; border-radius: 8px; border: 1px solid #dde3ec; background: #fff; width: 100%; }
.p-add { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.qty { display: flex; align-items: center; border: 1px solid #dde3ec; border-radius: 999px; overflow: hidden; flex: none; }
.qty button { width: 32px; height: 40px; border: 0; background: #fff; color: var(--navy); font-size: 1.1rem; cursor: pointer; }
.qty input { width: 40px; height: 40px; border: 0; text-align: center; font: inherit; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty.sm button, .qty.sm input { height: 32px; }
.qty.sm button { width: 28px; }
.qty.sm input { width: 34px; }
.add { flex: 1; font: inherit; font-weight: 700; font-size: .88rem; border: 0; border-radius: 999px; background: var(--cyan); color: var(--navy); cursor: pointer; padding: 0 12px; transition: background .15s; }
.add:hover { background: #1fc8e6; }
.add.ok { background: var(--navy); color: #fff; }
.more { text-align: center; margin-top: 26px; }
.more .btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.empty { text-align: center; padding: 30px 10px; }
.empty p { color: var(--muted); max-width: 520px; margin: 10px auto 20px; }
.empty .btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; }

/* ¿No encontrás lo que necesitás? */
.ask { margin-top: 34px; background: #fff; border: 2px dashed #c9d3e2; border-radius: var(--radius); padding: 22px 24px; display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px 24px; align-items: center; }
.ask h3 { font-size: 1.1rem; margin-bottom: 2px; }
.ask p { color: var(--muted); font-size: .9rem; }
.ask-f { display: flex; gap: 8px; }
.ask-f input { flex: 1; min-width: 0; font: inherit; padding: 12px 14px; border: 1px solid #d5dbe5; border-radius: 999px; }
.ask-f input:focus { outline: 2px solid var(--cyan); border-color: transparent; }
.ask-f .btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 12px 20px; white-space: nowrap; }
.ask-wa { grid-column: 2; justify-self: end; font-size: .85rem; color: #0ba8c6; font-weight: 700; text-decoration: none; }
.v-title .nota { font-family: 'Raleway', sans-serif; font-size: .9rem; font-weight: 500; color: var(--muted); }

/* Botón y panel de presupuesto */
.cart-btn[hidden], .drawer[hidden], .drawer-bg[hidden], .cat-search button[hidden] { display: none; }
.cart-btn { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; border: 0; cursor: pointer; font: inherit; font-weight: 800; font-size: 1rem; background: var(--navy); color: #fff; padding: 15px 26px; border-radius: 999px; box-shadow: 0 10px 28px rgba(22,24,83,.4); }
.cart-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--cyan); stroke-width: 2.2; stroke-linecap: round; }
.cart-btn span { background: var(--cyan); color: var(--navy); min-width: 26px; height: 26px; border-radius: 13px; display: inline-grid; place-items: center; padding: 0 6px; font-size: .9rem; }
.cart-btn.bump { animation: bump .4s; }
@keyframes bump { 50% { transform: translateX(-50%) scale(1.08); } }

.drawer-bg { position: fixed; inset: 0; background: rgba(15,17,64,.5); z-index: 70; opacity: 0; transition: opacity .25s; }
.drawer-bg.on { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: #fff; z-index: 80; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s; box-shadow: -10px 0 40px rgba(0,0,0,.2); }
.drawer.on { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid #eef1f5; }
.drawer-head h2 { font-size: 1.3rem; margin: 0; }
.drawer-x { border: 0; background: var(--bg-soft); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; color: var(--navy); }
.drawer-body { overflow-y: auto; padding: 8px 22px 28px; flex: 1; }
.c-list { list-style: none; }
.c-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 14px 0; border-bottom: 1px solid #eef1f5; }
.c-list b { display: block; font-size: .92rem; color: var(--navy); line-height: 1.3; }
.c-list span { display: block; font-size: .84rem; color: var(--text); }
.c-list small { display: block; font-size: .74rem; color: var(--muted); }
.rm { border: 0; background: none; color: #a0a6b4; cursor: pointer; font-size: 1rem; padding: 6px; }
.rm:hover { color: #c0392b; }
.c-form { margin-top: 20px; display: grid; gap: 12px; }
.c-form h3 { font-size: 1.1rem; }
.hint { font-size: .85rem; color: var(--muted); }
.fld span { display: block; font-size: .84rem; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.fld input, .fld textarea { width: 100%; font: inherit; padding: 11px 13px; border: 1px solid #d5dbe5; border-radius: 10px; }
.fld input:focus, .fld textarea:focus { outline: 2px solid var(--cyan); border-color: transparent; }
.hp { position: absolute; left: -9999px; }
.err { color: #c0392b; font-size: .88rem; font-weight: 600; min-height: 1em; }
.send { border: 0; cursor: pointer; font: inherit; font-weight: 800; width: 100%; padding: 16px; }
.send:disabled { opacity: .6; cursor: wait; }
.alt { display: block; text-align: center; color: #0ba8c6; font-weight: 700; font-size: .9rem; background: none; border: 0; cursor: pointer; font-family: inherit; margin: 6px auto 0; }
.done { text-align: center; padding: 36px 6px; display: grid; gap: 12px; justify-items: center; }
.done-ico { width: 56px; height: 56px; fill: none; stroke: #1fa463; stroke-width: 1.8; }
.done .btn { border: 0; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: #1e2235; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: .88rem; z-index: 90; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
body.has-cart .wa-float { bottom: 90px; }

@media (max-width: 760px) {
  .cat-hero { padding: 36px 0 28px; }
  .cat-modes { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .cat-modes a { padding: 12px 10px; text-align: center; }
  .cat-modes b { font-size: .9rem; }
  .cat-modes small { display: none; }
  .cat-search input { font-size: 1rem; padding: 16px 48px 16px 50px; }
  .tiles { grid-template-columns: 1fr; gap: 10px; }
  .tile { padding: 16px; }
  .brands { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .cart-btn { left: 16px; right: 16px; transform: none; justify-content: center; bottom: 14px; }
  @keyframes bump { 50% { transform: scale(1.04); } }
  body.has-cart .wa-float { bottom: 84px; }
  .ask { grid-template-columns: 1fr; padding: 18px; }
  .ask-f { flex-direction: column; }
  .ask-wa { grid-column: 1; justify-self: center; }
}
