/* Kombunica Detox · portales de clientes y distribuidores (se suma a app.css) */
body.portal { min-height: 100vh; }
.portal .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.portal .inline { display: inline; }
.portal .pt-hide-sm { display: inline; }

/* ----- Encabezado y navegación (sesión iniciada) ----- */
.pt-top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.pt-top-in { max-width: 1080px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pt-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.pt-brand .mark { width: 38px; height: 38px; color: var(--brand); flex: none; }
.pt-brand span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.pt-brand strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-brand small { color: var(--muted); font-size: .78rem; }
.pt-who { display: flex; align-items: center; gap: 12px; }
.pt-who form { margin: 0; }
.pt-who-t { display: flex; flex-direction: column; text-align: right; line-height: 1.15; }
.pt-who-t strong { font-size: .9rem; max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-who-t small { color: var(--muted); font-size: .76rem; }
.pt-nav { max-width: 1080px; margin: 0 auto; padding: 0 12px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.pt-nav::-webkit-scrollbar { display: none; }
.pt-nav a { display: flex; align-items: center; gap: 7px; padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .92rem; white-space: nowrap; border-bottom: 3px solid transparent; }
.pt-nav a:hover { color: var(--ink); }
.pt-nav a.on { color: var(--brand); border-bottom-color: var(--brand); }
.pt-main { max-width: 1080px; margin: 0 auto; padding: 22px 18px 40px; }
.pt-main > .card, .pt-main > .grid, .pt-main > .toolbar { margin-bottom: 18px; }
.pt-foot { max-width: 1080px; margin: 0 auto; padding: 0 18px 28px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; color: var(--muted); font-size: .85rem; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; }
.card-head h3 { margin: 0; }
.pt-main .card.flush .card-head + .table-wrap { margin-top: 6px; }
.pt-info p { margin: 0; max-width: 70ch; }
.pt-pre { white-space: pre-line; margin: 0 0 8px; }
.pt-ok { color: var(--brand); }
.pt-actions { margin-bottom: 18px; }
.pt-main .grid.two { margin-bottom: 18px; }

/* ----- Inicio ----- */
.pt-hero { padding: 26px 24px; margin-bottom: 18px; }
.pt-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.pt-btn-light { background: #fff; color: #1f5c43; border-color: #fff; }
.pt-btn-light:hover { background: #f1f7f3; }
.pt-btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.pt-btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.pt-main .grid.cards { margin-bottom: 18px; }

/* ----- Páginas públicas: entrada, ingreso, registro ----- */
body.pt-public { background: linear-gradient(160deg, var(--bg), color-mix(in srgb, var(--brand) 10%, var(--bg))); }
.pt-wrap { max-width: 900px; margin: 0 auto; padding: 32px 18px 28px; }
.pt-landing-head { text-align: center; margin-bottom: 26px; }
.pt-landing-head .mark { width: 54px; height: 54px; color: var(--brand); }
.pt-landing-head h1 { font-size: 1.9rem; margin: 10px 0 4px; }
.pt-landing-head p { margin: 0; color: var(--muted); }
.access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.access-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.access-card h2 { font-size: 1.35rem; margin: 4px 0 0; }
.access-card p { margin: 0; color: var(--muted); }
.access-ico { display: inline-flex; width: 50px; height: 50px; border-radius: 14px; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); }
.access-ico .ico { width: 26px; height: 26px; }
.access-dist .access-ico { background: var(--warn-soft); color: var(--accent); }
.access-list { margin: 4px 0 6px; padding-left: 18px; color: var(--ink); font-size: .93rem; }
.access-list li { margin: 3px 0; }
.access-actions { margin-top: auto; display: grid; gap: 8px; padding-top: 10px; }
.pt-back { display: inline-block; margin-bottom: 14px; font-size: .92rem; text-decoration: none; }
.pt-auth { max-width: 440px; margin: 0 auto; padding: 26px 24px; }
.pt-auth-wide { max-width: 640px; }
.pt-auth h1 { font-size: 1.35rem; margin: 6px 0 14px; }
.pt-auth-brand { display: flex; align-items: center; gap: 10px; }
.pt-auth-brand .mark { width: 38px; height: 38px; color: var(--brand); }
.pt-auth-brand div { display: flex; flex-direction: column; line-height: 1.15; }
.pt-auth-brand small { color: var(--muted); font-size: .78rem; }
.pt-auth-help { margin-top: 14px; }
.pt-done { text-align: center; }
.pt-done .access-ico { margin: 0 auto 6px; }
.pt-pub-foot { margin-top: 22px; }
body.pt-dist .pt-auth h1 { color: var(--accent); }

/* ----- Hacer pedido ----- */
.pt-note { background: var(--brand-soft); color: var(--ink); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: .93rem; }
.pt-order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.pt-prods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pt-prod { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.pt-prod.is-out { opacity: .65; }
.pt-prod-img { background: var(--surface-2); aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.pt-prod-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pt-prod-img .ico { width: 44px; height: 44px; }
.pt-prod-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pt-prod-body h3 { margin: 0; font-size: 1rem; }
.pt-prod-body p { margin: 0; }
.pt-prod-price strong { font-size: 1.15rem; }
.pt-tachado { text-decoration: line-through; margin-left: 6px; }
.pt-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; align-self: flex-start; margin-top: 4px; }
.pt-qty button { width: 42px; height: 40px; border: 0; background: var(--surface-2); color: var(--ink); font-size: 1.25rem; cursor: pointer; }
.pt-qty button:hover { background: var(--brand-soft); }
.pt-qty input { width: 56px; height: 40px; border: 0; text-align: center; font-size: 1rem; background: var(--surface); color: var(--ink); -moz-appearance: textfield; }
.pt-qty input::-webkit-outer-spin-button, .pt-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pt-order-side { position: sticky; top: 118px; }
.pt-summary { margin-bottom: 0; }
.pt-summary h3 { margin-bottom: 8px; }
.pt-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin: 10px 0 14px; padding-top: 10px; font-size: 1.05rem; }
.pt-total strong { font-size: 1.6rem; letter-spacing: -.02em; }
.pt-pagos { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; }
.pt-pagos legend { font-size: .85rem; color: var(--muted); padding: 0; margin-bottom: 4px; }
.pt-summary .grid.two { gap: 10px; }

@media (max-width: 900px) {
  .pt-order-grid { grid-template-columns: 1fr; }
  .pt-order-side { position: static; }
}
@media (max-width: 720px) {
  .access-grid { grid-template-columns: 1fr; }
  .pt-who-t { display: none; }
  .portal .pt-hide-sm { display: none; }
  .pt-main { padding: 16px 12px 32px; }
  .pt-hero h2 { font-size: 1.35rem; }
}
@media (max-width: 520px) {
  .pt-prods { grid-template-columns: 1fr; }
  .pt-prod { flex-direction: row; }
  .pt-prod-img { width: 120px; aspect-ratio: auto; flex: none; }
  .pt-wrap { padding-top: 20px; }
}

/* Modo oscuro: el banner de inicio queda verde claro, así que el botón "fantasma" lleva texto oscuro */
:root[data-theme="dark"] .pt-btn-ghost { color: var(--brand-ink); border-color: rgba(14, 26, 20, .5); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pt-btn-ghost { color: var(--brand-ink); border-color: rgba(14, 26, 20, .5); } }
