/* Preciador GE — estilos
   Paleta: fondo neutro claro, naranja y verde de La Comer (logo),
   tarjetas blancas con sombra suave, tipografía del sistema para máxima
   compatibilidad y carga instantánea en celulares de piso de venta. */

:root {
  --bg: #f4f6f5;
  --card: #ffffff;
  --ink: #16211d;
  --ink-soft: #5b6b64;
  --accent: #ee5a24;
  --accent-dark: #c8440f;
  --accent-soft: #fdece4;
  --green: #7fb320;
  --border: #e3e8e6;
  --danger: #c23b3b;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(16, 40, 30, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.screen { min-height: 100vh; }

/* ---------- Login ---------- */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% -10%, var(--accent-soft), var(--bg) 55%);
}

.login-screen[hidden] { display: none; }

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px;
  text-align: center;
}

.brand-logo-full {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.brand-logo-img {
  height: 46px;
  width: auto;
  display: block;
}

.brand-pelican-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
  border-radius: 50%;
}

.brand h1 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 4px;
}

#loginForm { text-align: left; }

#loginForm label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

#loginForm input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  font-size: 16px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.15s;
}

#loginForm input:focus { border-color: var(--accent); }

.btn-primary {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-secondary {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin: -6px 0 6px;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.topbar-title { display: flex; align-items: center; gap: 10px; }
.topbar-title h2 { margin: 0; font-size: 16px; }
.topbar-sub { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }

.topbar-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
}

.icon-btn:hover { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- Layout ---------- */
.content {
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

/* ---------- Buscador ---------- */
.search-card label { font-size: 13px; font-weight: 600; color: var(--ink-soft); display:block; margin-bottom: 6px; }

#searchInput {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  font-size: 16px;
  outline: none;
}

#searchInput:focus { border-color: var(--accent); }

.search-results {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.search-results[hidden] { display: none; }

.result-item {
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fbfcfb;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.result-item:hover { border-color: var(--accent); background: var(--accent-soft); }

.result-item .name { font-weight: 600; font-size: 14px; }
.result-item .cat { font-size: 11px; color: var(--ink-soft); }

.empty-msg {
  margin-top: 10px;
  font-size: 13px;
  color: var(--danger);
  background: #fbeaea;
  padding: 10px 12px;
  border-radius: 10px;
}

/* ---------- Selección ---------- */
.selected-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.chip-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.selected-name { margin: 0; font-size: 16px; font-weight: 600; }

.selected-card label { font-size: 13px; font-weight: 600; color: var(--ink-soft); display:block; margin-bottom: 6px; }

.price-field {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  margin-bottom: 4px;
}

.price-field:focus-within { border-color: var(--accent); }

.price-prefix { font-size: 18px; font-weight: 600; color: var(--ink-soft); }

#priceInput {
  border: none;
  outline: none;
  padding: 14px 8px;
  font-size: 20px;
  font-weight: 700;
  width: 100%;
}

/* ---------- Instalación ---------- */
.install-wrap { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); }

.install-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.install-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Resultado ---------- */
.result-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  margin-bottom: 2px;
}

.result-sub { font-size: 12px; color: var(--ink-soft); margin-bottom: 10px; }

/* ===== Navegación estilo app de muestra: inicio con banners / vista de categoría ===== */
#homeView, #quoteView { display: flex; flex-direction: column; gap: 14px; }
#homeView[hidden], #quoteView[hidden] { display: none; }
.banner-grid[hidden], .banner[hidden] { display: none; }
.bn-tab {
  content: ""; position: absolute; top: 0; bottom: 0; border-radius: 0 0 40px 0;
}

.banner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.banner {
  position: relative; overflow: hidden; background: var(--accent); color: #fff; border: 0;
  border-radius: 14px; padding: 14px 12px 12px 44px; min-height: 150px; text-align: left; cursor: pointer;
  font: inherit; display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s;
}
.banner:active { transform: scale(.98); }
.banner.has-img { padding: 0; min-height: 0; background: none; box-shadow: none; display: block; }
.bn-img { display: block; width: 100%; height: auto; border-radius: 14px; }
.bn-tab { width: 26px; border-radius: 0 0 22px 0; }
.bn-tab-green { left: 0; background: var(--green); }
.bn-tab-soft { left: 16px; width: 26px; background: rgba(255,255,255,.35); }
.bn-shields { position: relative; display: flex; gap: 3px; flex-wrap: wrap; }
.bn-shield {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 30px; padding: 3px 5px 6px; border: 2px solid #fff; border-radius: 8px 8px 16px 16px;
  line-height: 1; font-weight: 800;
}
.bn-shield b { font-size: 14px; }
.bn-shield i { font-style: normal; font-size: 7px; margin-top: 2px; letter-spacing: .03em; }
.bn-text { position: relative; font-size: 14px; font-weight: 800; line-height: 1.2; }
.bn-text small { display: block; font-size: 12px; font-weight: 500; opacity: .9; }
.bn-logo {
  position: relative; align-self: flex-start; height: 18px; width: auto;
  background: #fff; border-radius: 999px; padding: 2px 8px;
}

.cat-header {
  position: relative; overflow: hidden; background: var(--accent); color: #fff;
  border-radius: 16px; padding: 18px 18px 18px 70px;
}
.cat-header::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 40px; background: var(--green); border-radius: 0 0 30px 0; }
.cat-header::after { content: ""; position: absolute; left: 24px; top: 0; bottom: 0; width: 34px; background: rgba(255,255,255,.35); border-radius: 0 0 30px 0; }
.cat-header.has-img { padding: 0; background: none; border-radius: 16px; }
.cat-header.has-img::before, .cat-header.has-img::after, .cat-header.has-img h2, .cat-header.has-img p { display: none; }
.ch-img { display: block; width: 100%; height: auto; border-radius: 16px; }
.inst-card { max-width: 380px; text-align: left; }
.inst-card h3 { padding-right: 36px; }
.inst-card #instSearch {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--border);
  font-size: 16px; outline: none;
}
.inst-card #instSearch:focus { border-color: var(--accent); }
.inst-msg { font-size: 14px !important; font-weight: 600; color: var(--danger) !important; background: #fbeaea; padding: 12px 14px; border-radius: 10px; }
#instMsgBox[hidden], #instSearchBox[hidden] { display: none; }
.price-clear {
  flex: 0 0 auto; width: 30px; height: 30px; margin-right: 8px; border: 0; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark); font-size: 14px; font-weight: 800;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn[hidden] { display: none; }
.price-clear:active { background: var(--accent); color: #fff; }
.price-clear[hidden] { display: none; }
.cat-footer[hidden] { display: none; }
.cat-footer .ch-img { border-radius: 16px; }
.cat-header h2 { position: relative; z-index: 1; margin: 0; font-size: 20px; }
.cat-header p { position: relative; z-index: 1; margin: 2px 0 0; font-size: 14px; font-weight: 600; opacity: .95; }

.breadcrumb {
  background: #fff; border-radius: 10px; padding: 10px 14px; font-size: 13px;
  box-shadow: var(--shadow); color: var(--ink-soft);
}
.breadcrumb a { color: var(--accent-dark); font-weight: 700; text-decoration: none; }
.crumb-sep { margin: 0 8px; }
.selected-row[hidden] { display: none; }

/* Opciones de GE en el resultado: una por renglón, seleccionable */
.res-options { display: grid; gap: 8px; margin-bottom: 10px; }
.res-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: #fff; border: 2px solid var(--border); border-radius: 14px;
  padding: 10px 12px; font: inherit; color: inherit; text-align: left; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.res-shield {
  flex: 0 0 auto; min-width: 46px; text-align: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 18px;
  padding: 6px 10px 9px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--accent);
  border-radius: 10px 10px 20px 20px;
}
.res-txt { flex: 1; font-size: 13px; font-weight: 600; color: var(--ink-soft); line-height: 1.25; }
.res-txt small { display: block; font-weight: 500; font-size: 11px; opacity: .85; }
.res-price { flex: 0 0 auto; font-size: 17px; font-weight: 800; color: var(--ink); }
/* Mensaje de ahorro (compra de 1 año N veces vs. la de N años) */
.ahorro {
  display: flex; flex-direction: column; gap: 4px; margin: 4px 0 10px;
  padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--green);
  background: linear-gradient(135deg, #f3f9e6 0%, #e6f2c9 100%);
}
.ahorro[hidden] { display: none; }
.ahorro-tag {
  align-self: flex-start; background: var(--green); color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px;
}
.ahorro-monto { font-size: 22px; font-weight: 800; color: #3f6b00; line-height: 1.15; }
.ahorro-det { font-size: 13px; color: var(--ink-soft); line-height: 1.35; }
.ahorro-det s { color: #8a8f8c; }
.ahorro-det b { color: #3f6b00; }
.ahorro-cta { font-size: 13px; font-weight: 700; color: var(--accent-dark); margin-top: 2px; }
.ahorro-invita { cursor: pointer; border-color: #f6c9ab; background: linear-gradient(135deg, #fff8f3 0%, #fdeadc 100%); }
.ahorro-invita .ahorro-tag { background: #f9d9c3; color: var(--accent-dark); }
.ahorro-invita .ahorro-monto { color: var(--accent-dark); }
.ahorro-invita:active { filter: brightness(.97); }
.res-row.selected {
  background: var(--accent-soft); border-color: var(--accent); border-width: 3px; padding: 9px 11px;
  box-shadow: 0 0 0 3px rgba(238,90,36,.25);
}
.res-row.selected .res-txt { color: var(--accent-dark); font-weight: 800; }
.res-row.selected .res-price { color: var(--accent-dark); }
.res-row.selected .res-shield::after { content: " \2713"; font-size: 14px; }

.result-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 800;
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 14px;
  color: var(--accent-dark);
}

.install-nota {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.5;
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 8px 0 16px;
}

.disclaimer {
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.5;
  margin-top: 6px;
}

/* ---------- Tarjeta informativa (final) ---------- */
.info-card {
  background: var(--green);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.info-card[hidden] { display: none; }
.info-title { margin: 0; font-size: 18px; font-weight: 800; }
.info-sub { margin: 2px 0 14px; font-size: 13px; opacity: 0.95; }
.info-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.info-fab { font-size: 11px; line-height: 1.3; }
.info-shield {
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 10px 10px 18px 18px;
  font-weight: 800;
  font-size: 15px;
  padding: 4px 10px;
}
.info-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.info-list li { font-size: 14px; font-weight: 600; padding-left: 22px; position: relative; }
.info-list li::before { content: "\2713"; position: absolute; left: 0; font-weight: 800; }
.info-asist { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.info-asist b { background: #fff; color: var(--green); border-radius: 999px; padding: 3px 12px; font-size: 12px; margin-right: 4px; }
.info-asist span { font-size: 13px; font-weight: 600; }
.info-asist span:not(:last-child)::after { content: " ·"; }
.info-elig { font-size: 12px; line-height: 1.5; margin: 0 0 10px; }
.info-nota { font-size: 10px; line-height: 1.4; margin: 4px 0 0; opacity: 0.95; }

/* ---------- Modal compartir ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 16, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}

.modal[hidden] { display: none; }

.modal-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow);
}

.modal-card h3 { margin: 4px 0 8px; }
.modal-card p { font-size: 13px; color: var(--ink-soft); margin: 0 0 16px; }

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.qr-holder {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.qr-url {
  font-size: 11px;
  word-break: break-all;
  color: var(--ink-soft);
}

@media (max-width: 380px) {
  .options-grid { grid-template-columns: repeat(2, 1fr); }
}
