/* Colores tomados del logo de Grupo Integra ERP */
:root {
  --blue: #0450fa; --blue-d: #0340c8; --navy: #041c4c; --navy2: #3c547c; --teal: #04acac; --teal-d: #038c8c;
  --wa: #1faa59; --wa-d: #178a47;
  --bg: #f4f7fc; --card: #fff; --line: #e3e9f3; --txt: #24324f; --sub: #5f6f8c; --err: #c0392b;
  --tint: linear-gradient(160deg, #e2f8f6 0%, #e6eeff 100%);
  --r: 22px; --tab-h: 72px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; color: var(--txt); font: 16px/1.45 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #d9f4f2 0, #e8efff 340px, var(--bg) 720px) no-repeat, var(--bg); min-height: 100vh; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); }
body.lock { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* Cabecera */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(227, 233, 243, .9); padding-top: env(safe-area-inset-top); }
.top-in { display: grid; grid-template-columns: auto 1fr auto auto; grid-template-areas: "brand search install cart"; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.brand { grid-area: brand; display: flex; align-items: center; }
.brand img { height: 38px; width: auto; display: block; }
.search { grid-area: search; display: flex; align-items: center; gap: 8px; max-width: 560px; width: 100%; justify-self: center; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 0 16px; box-shadow: 0 2px 10px rgba(4, 28, 76, .05); }
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(4, 80, 250, .1); }
.search .ic { color: var(--sub); width: 20px; height: 20px; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 12px 0; outline: none; font-size: 16px; }
.pill-btn { grid-area: install; display: flex; align-items: center; gap: 6px; border: 1.5px solid var(--teal); color: var(--teal-d); background: #fff; border-radius: 999px; padding: 9px 14px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.pill-btn .ic { width: 18px; height: 18px; }
.cart-btn { grid-area: cart; position: relative; display: flex; align-items: center; gap: 8px; border: 0; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; }
.cart-btn:hover { background: #0a2b6c; }
.cart-count { position: absolute; top: -6px; right: -4px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 999px; background: var(--teal); color: #fff; font-size: 12px; display: grid; place-items: center; border: 2px solid #fff; }

/* Portada */
.hero { position: relative; margin-top: 18px; border-radius: 28px; overflow: hidden; color: #fff; padding: 34px 36px; min-height: 220px; display: flex; align-items: center;
  background: radial-gradient(120% 140% at 100% 0%, #0a6cff 0%, transparent 55%), radial-gradient(90% 120% at 0% 100%, #04acac 0%, transparent 55%), linear-gradient(135deg, #041c4c 0%, #0a3a9a 100%); box-shadow: 0 18px 40px rgba(4, 28, 76, .22); }
.hero-txt { position: relative; z-index: 1; max-width: 560px; }
.eyebrow { display: inline-block; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; padding: 4px 12px; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 10px; }
.hero h1 { margin: 0 0 8px; font-size: 2.1rem; line-height: 1.15; font-weight: 700; }
.hero p { margin: 0 0 18px; opacity: .92; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-art { position: absolute; right: 2%; top: 50%; transform: translateY(-50%); height: 118%; opacity: .5; pointer-events: none; }

.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 6px; }
.perk { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .85); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; }
.perk .ic { color: var(--teal); width: 26px; height: 26px; }
.perk b { display: block; font-size: .9rem; color: var(--navy); }
.perk span { font-size: .78rem; color: var(--sub); }

/* Categorías y barra */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 2px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; scroll-snap-align: start; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; font-size: .9rem; font-weight: 500; color: var(--txt); white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 6px 14px rgba(4, 28, 76, .25); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.status { margin: 0; color: var(--sub); font-size: .9rem; }
.sort { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--sub); }
.sort select { border: 1.5px solid var(--line); border-radius: 12px; background: #fff; padding: 7px 10px; font-size: .88rem; }

/* Productos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 4px 16px rgba(4, 28, 76, .05); transition: transform .15s, box-shadow .15s; cursor: pointer; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(4, 28, 76, .12); }
.card.off { opacity: .65; }
.pic { position: relative; aspect-ratio: 1 / 1; background: var(--tint); display: grid; place-items: center; margin: 8px; border-radius: 16px; overflow: hidden; }
.pic img { width: 100%; height: 100%; object-fit: contain; padding: 10px; mix-blend-mode: multiply; }
.pic .ph { font-size: 2.6rem; opacity: .4; }
.tag { position: absolute; top: 8px; left: 8px; background: #fff; color: #8a5a00; font-size: .72rem; padding: 3px 9px; border-radius: 999px; font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, .1); }
.tag.out { color: var(--err); }
.info { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cat { font-size: .72rem; color: var(--teal-d); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.name { margin: 0; font-size: .95rem; line-height: 1.3; font-weight: 600; color: var(--navy); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.buy { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; }
.price { white-space: nowrap; font-size: 1.15rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.price small { display: block; font-size: .68rem; font-weight: 400; color: var(--sub); }
.plus { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; font-size: 1.5rem; line-height: 1; display: grid; place-items: center; box-shadow: 0 6px 14px rgba(4, 28, 76, .28); }
.plus:hover { background: var(--blue); }
.plus:disabled { background: var(--line); color: var(--sub); box-shadow: none; font-size: .7rem; cursor: default; }

.btn { border: 0; border-radius: 14px; padding: 12px 20px; font-weight: 600; text-decoration: none; text-align: center; display: inline-block; }
.btn-wa { background: var(--wa); color: #fff; width: 100%; font-size: 1.05rem; padding: 15px; box-shadow: 0 8px 18px rgba(31, 170, 89, .3); }
.btn-wa:hover { background: var(--wa-d); }
.btn-wa:disabled { opacity: .6; cursor: wait; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-d); }
.btn-light { background: #fff; color: var(--navy); }
.btn-ghost-w { background: rgba(255, 255, 255, .14); color: #fff; border: 1.5px solid rgba(255, 255, 255, .45); }
.btn-outline { background: #fff; border: 1.5px solid var(--line); color: var(--txt); }
.btn-add { background: var(--blue); color: #fff; width: 100%; }
.btn-add:hover { background: var(--blue-d); }
.more { text-align: center; padding: 18px 0 8px; }

.step { display: inline-flex; align-items: center; background: #eaf0ff; border-radius: 999px; padding: 3px; }
.step button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fff; color: var(--blue); font-size: 1.2rem; font-weight: 700; box-shadow: 0 2px 6px rgba(4, 28, 76, .12); }
.step button:disabled { opacity: .4; cursor: default; }
.step span { min-width: 34px; text-align: center; font-weight: 700; color: var(--navy); }
.card .step { align-self: flex-end; }

.foot { padding: 28px 16px 8px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; color: var(--sub); font-size: .82rem; }

/* Barra inferior (móvil) */
.tabbar { position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 25; height: 62px; background: var(--navy); border-radius: 22px; display: flex; justify-content: space-around; align-items: center; padding: 0 6px; box-shadow: 0 12px 28px rgba(4, 28, 76, .35); max-width: 560px; margin: 0 auto; }
.tabbar > * { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: transparent; color: #9fb4de; font-size: .68rem; text-decoration: none; height: 50px; border-radius: 16px; }
.tabbar .on { background: rgba(4, 172, 172, .18); color: #5ff0e8; }
.tabbar i { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--teal); color: #fff; font-style: normal; font-size: 11px; display: grid; place-items: center; }

/* Aviso de instalación */
.banner { position: fixed; left: 12px; right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 24; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 12px; box-shadow: 0 14px 34px rgba(4, 28, 76, .22); }
.banner img { width: 44px; height: 44px; border-radius: 12px; }
.banner div { flex: 1; min-width: 0; line-height: 1.25; }
.banner b { display: block; color: var(--navy); font-size: .92rem; }
.banner span { font-size: .78rem; color: var(--sub); }
.banner .btn { padding: 9px 14px; border-radius: 12px; font-size: .88rem; }

/* Carrito */
.shade { position: fixed; inset: 0; background: rgba(4, 28, 76, .55); z-index: 30; backdrop-filter: blur(2px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(450px, 100%); background: #fff; z-index: 31; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .24s ease; box-shadow: -10px 0 34px rgba(4, 28, 76, .25); border-radius: 24px 0 0 24px; padding-top: env(safe-area-inset-top); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.2rem; color: var(--navy); }
.x { border: 0; background: var(--bg); width: 38px; height: 38px; border-radius: 50%; font-size: 1rem; color: var(--navy); }
.lines { flex: 1; overflow-y: auto; padding: 6px 18px; }
.empty { text-align: center; color: var(--sub); padding: 56px 12px; }
.line { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line img, .line .ph { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; display: grid; place-items: center; background: var(--tint); mix-blend-mode: normal; }
.line .nm { font-size: .9rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.line .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.line .sub { font-weight: 700; color: var(--navy); }
.line .rm { border: 0; background: none; color: var(--err); font-size: .8rem; padding: 6px 0 0; }
.checkout { border-top: 1px solid var(--line); padding: 14px 18px calc(16px + env(safe-area-inset-bottom)); background: #fff; display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.sum { display: flex; justify-content: space-between; align-items: baseline; }
.sum b { color: var(--navy); font-size: 1.4rem; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; font-weight: 600; }
.fld small { font-weight: 400; color: var(--sub); }
.fld input, .fld textarea { border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; font-size: 16px; font-weight: 400; resize: vertical; }
.fld input:focus, .fld textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(4, 80, 250, .1); }
.err { margin: 0; color: var(--err); font-size: .9rem; }
.hint { margin: 0; font-size: .78rem; color: var(--sub); text-align: center; }

/* Hojas (detalle, instalar, pedido listo) */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(4, 28, 76, .6); display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(3px); }
.sheet-card { position: relative; background: #fff; border-radius: 26px; width: min(880px, 100%); max-height: 92vh; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.sheet-x { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(255, 255, 255, .9); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.sh-pic { background: var(--tint); display: grid; place-items: center; min-height: 320px; }
.sh-pic img { width: 100%; height: 100%; max-height: 460px; object-fit: contain; padding: 22px; mix-blend-mode: multiply; }
.sh-pic .ph { font-size: 5rem; opacity: .4; }
.sh-body { padding: 28px 26px; display: flex; flex-direction: column; gap: 10px; }
.sh-body h2 { margin: 0; color: var(--navy); font-size: 1.35rem; line-height: 1.25; }
.sh-desc { margin: 0; color: var(--sub); font-size: .92rem; }
.sh-price { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.sh-price b { font-size: 1.9rem; color: var(--navy); }
.sh-price small { color: var(--sub); }
#sh-act { margin-top: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#sh-act .btn { flex: 1; min-width: 160px; }
.sheet-card.how, .sheet-card.done-card { grid-template-columns: 1fr; width: min(420px, 100%); padding: 28px 24px; gap: 14px; text-align: center; }
.how h2, .done-card h2 { margin: 0; color: var(--navy); }
.how ol { text-align: left; margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--txt); }
.done-card p { margin: 0; color: var(--sub); }
.done-ico { font-size: 2.8rem; }
#done-code { color: var(--navy); font-size: 1.15rem; letter-spacing: .03em; }

/* Escritorio */
@media (min-width: 900px) {
  .tabbar, .banner { display: none !important; }
  body { padding-bottom: 24px; }
}
/* Tableta y móvil */
@media (max-width: 899px) {
  .top-in { grid-template-columns: auto 1fr auto; grid-template-areas: "brand install cart" "search search search"; gap: 8px 10px; }
  .search { max-width: none; }
  .pill-btn { justify-self: end; }
  .hero { padding: 24px 20px; min-height: 190px; border-radius: 24px; }
  .hero h1 { font-size: 1.6rem; }
  .hero-art { opacity: .28; right: -8%; }
}
@media (max-width: 640px) {
  .perks { grid-template-columns: 1fr; gap: 8px; }
  .perks .perk:nth-child(n+3) { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .name { font-size: .86rem; }
  .price { font-size: 1rem; }
  .plus { width: 38px; height: 38px; }
  .cart-total, .pill-btn span { display: none; }
  .pill-btn { padding: 9px; }
  .brand img { height: 32px; }
  .toolbar { flex-wrap: wrap; }
  .sheet { align-items: flex-end; padding: 0; }
  .sheet-card { grid-template-columns: 1fr; border-radius: 26px 26px 0 0; width: 100%; max-height: 94vh; }
  .sh-pic { min-height: 240px; }
  .sh-pic img { max-height: 280px; }
  .sh-body { padding: 20px 18px calc(22px + env(safe-area-inset-bottom)); }
  .sheet-card.how, .sheet-card.done-card { width: 100%; }
  .drawer { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
