/* =========================================================
   Eletrolara — tema moderno / formato app
   Só visual: não altera nenhuma função existente.
   ========================================================= */
:root {
  --el-primary: #1e3c72;            /* sobrescrito via JS com a cor real de .bg-blue */
  --el-accent: #dc3545;
  --el-bg: #f4f6fa;
  --el-surface: #ffffff;
  --el-text: #1d2433;
  --el-muted: #6b7280;
  --el-radius: 16px;
  --el-shadow: 0 1px 3px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.07);
  --el-nav-h: 62px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--el-bg);
  color: var(--el-text);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  animation: elFade .3s ease;
}
@keyframes elFade { from { opacity: 0 } to { opacity: 1 } }

/* ---------- Barra de progresso ao navegar ---------- */
#el-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--el-primary), var(--el-accent));
  z-index: 20000; opacity: 0; transition: width .4s ease, opacity .2s;
  box-shadow: 0 0 8px rgba(30,60,114,.4);
}
#el-progress.on { opacity: 1; width: 75%; transition: width 6s cubic-bezier(.1,.8,.2,1), opacity .2s; }

/* ---------- Cabeçalho ---------- */
nav.navbar { box-shadow: 0 2px 18px rgba(16,24,40,.07); }
nav.navbar input[name="key"] {
  height: 42px;
  border-radius: 999px 0 0 999px;
  background: #f1f3f7;
  border: 1.5px solid transparent;
  padding-left: 18px;
  font-size: 15px;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
nav.navbar input[name="key"]:focus {
  background: #fff;
  border-color: var(--el-primary);
  box-shadow: 0 0 0 4px rgba(30,60,114,.12);
}
nav.navbar form .input-group > .btn:last-child {
  border-radius: 0 999px 999px 0 !important;
  padding: 0 18px;
}
nav.navbar form[role="search"] { position: relative; }
nav.navbar form .input-group { flex-wrap: nowrap; }

/* botão de voz (inserido via JS) */
.el-mic {
  background: #f1f3f7; border: 0; color: var(--el-muted);
  padding: 0 12px; font-size: 16px;
}
.el-mic.ouvindo { color: #fff; background: var(--el-accent); animation: elPulse 1s infinite; }
@keyframes elPulse { 50% { opacity: .6 } }

/* painel de sugestões / buscas recentes */
.el-sugestoes {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border-radius: 14px; box-shadow: var(--el-shadow);
  padding: 12px; z-index: 1060; text-align: left; display: none;
}
.el-sugestoes.on { display: block; animation: elFade .15s ease; }
.el-sugestoes h6 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--el-muted); margin: 4px 0 8px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.el-sugestoes h6 button { border: 0; background: none; color: var(--el-accent); font-size: 11px; font-weight: 600; }
.el-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.el-chip {
  border: 1px solid #e5e7eb; background: #f9fafb; color: var(--el-text);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.el-chip:active { transform: scale(.96); }
.el-chip i { color: var(--el-muted); margin-right: 4px; font-size: 11px; }

/* destaque das palavras buscadas */
mark.el-hl { background: #fff3a3; padding: 0 1px; border-radius: 3px; color: inherit; }

/* Menu de categorias */
.bg-blue .navbar-nav .nav-link { font-weight: 600; letter-spacing: .01em; }
.bg-blue .dropdown-menu {
  border: 0; border-radius: 14px; box-shadow: var(--el-shadow); overflow: hidden;
}
.bg-blue .dropdown-item { padding: 10px 16px !important; font-size: 14px; }
.bg-blue .dropdown-item:active { background: var(--el-primary); }

/* ---------- Títulos de seção ---------- */
h4.fw-bold.text-blue.border-bottom {
  border: 0 !important;
  position: relative;
  padding-bottom: 10px;
  margin-bottom: 4px;
  font-weight: 800 !important;
  letter-spacing: -.01em;
}
h4.fw-bold.text-blue.border-bottom::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 44px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--el-primary), var(--el-accent));
}

/* ---------- Cards de produto ---------- */
.product-item .card {
  border: 0;
  border-radius: var(--el-radius);
  overflow: hidden;
  box-shadow: var(--el-shadow);
  background: var(--el-surface);
  transition: transform .2s ease, box-shadow .2s ease;
}
.product-item .card:active { transform: scale(.98); }
@media (hover: hover) {
  .product-item .card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(16,24,40,.12); }
}
.product-item .card-img-top {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  padding: 10px;
}
.product-item .card-body { padding: 10px 12px 12px !important; }
.product-item .card-body [id^="Valor-"] { font-size: 1.15em; font-weight: 800 !important; }
.product-item .btn-danger {
  border-radius: 999px;
  padding: 7px 0 !important;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(220,53,69,.25);
}
.dynamic-discount-badge, .discount-badge {
  top: 8px !important; left: 8px !important;
  border-radius: 999px !important;
  padding: 3px 8px !important;
  background: #16a34a !important;
  box-shadow: 0 2px 6px rgba(22,163,74,.35);
}
.video-badge { top: 8px !important; right: 8px !important; border-radius: 999px !important; padding: 3px 8px !important; }

/* ---------- Componentes gerais ---------- */
.btn { border-radius: 12px; font-weight: 600; }
.btn-sm { border-radius: 10px; }
.form-control, .form-select { border-radius: 12px; }
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 4px rgba(30,60,114,.12); }
.alert { border: 0; border-radius: 14px; }
.card { border-radius: var(--el-radius); }
.modal-content { border: 0; border-radius: 20px; }

/* Categorias da home (classe aplicada via JS) */
.el-cats img {
  aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 20px; box-shadow: var(--el-shadow);
  transition: transform .2s;
}
.el-cats a:active img { transform: scale(.95); }
.el-cats h6 { margin-top: 8px; font-weight: 700 !important; }

/* Rodapé */
footer.row h6 { letter-spacing: .06em; }

/* =========================================================
   CELULAR — formato app
   ========================================================= */
@media (max-width: 767.98px) {
  input, select, textarea { font-size: 16px !important; } /* evita zoom no iPhone */

  /* ----- Cabeçalho do celular: [LOGO] [busca com microfone e lupa] em uma linha ----- */
  nav.navbar { position: sticky; top: 0; z-index: 1030; background: #fff; }
  nav.navbar > .container {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "logo busca";
    align-items: center; column-gap: 10px;
    padding: 8px 12px !important;
  }
  nav.navbar > .container > script { display: none; }
  nav.navbar .col-md-3,
  nav.navbar .col-md-3 > .row,
  nav.navbar .col-md-9 { display: contents !important; }

  nav.navbar .col-md-3 .col-10 {
    grid-area: logo; width: auto !important; max-width: none !important; padding: 0 !important;
  }
  nav.navbar .col-md-3 .col-10 img { display: block; height: auto; width: auto; max-height: 46px; max-width: 34vw; }

  /* menu, carrinho e "Entrar" do topo ficam na barra inferior no celular (os originais continuam no código) */
  nav.navbar .col-md-3 .col-2,
  nav.navbar .col-md-9 > div { display: none !important; }

  html, body { overflow-x: clip; }
  nav.navbar form[role="search"] { grid-area: busca; min-width: 0; width: 100% !important; }
  nav.navbar form .input-group { width: 100%; }
  nav.navbar form .input-group > input { flex: 1 1 auto; width: 1% !important; }
  nav.navbar input[name="key"] { height: 44px; min-width: 0; padding-left: 14px; }
  nav.navbar form .el-mic { display: flex; align-items: center; padding: 0 10px; }
  nav.navbar form .input-group > .btn:last-child { padding: 0 14px; display: flex; align-items: center; }

  /* faixa azul some quando o menu está fechado; abre normal pelo botão de menu */
  nav.navbar > .container-fluid.bg-blue { padding: 0 !important; }
  #navbars .navbar-nav { max-height: 60vh; overflow-y: auto; padding: 6px 0; }
  #navbars .nav-link { padding: 10px 18px !important; }

  /* chips de categorias */
  .el-chipcats {
    display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px 4px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .el-chipcats::-webkit-scrollbar { display: none; }
  .el-chipcats a, .el-chipcats button {
    flex: none; border: 0; border-radius: 999px; padding: 8px 16px;
    font-size: 13.5px; font-weight: 600; white-space: nowrap; text-decoration: none;
    background: #fff; color: var(--el-text); box-shadow: 0 2px 8px rgba(16,24,40,.07);
  }
  .el-chipcats .ativo { background: var(--el-primary); color: #fff; }

  #carouselExampleCaptions { margin: 12px 14px 0; border-radius: 18px; overflow: hidden; box-shadow: var(--el-shadow); }

  /* categorias em carrossel horizontal */
  .el-cats {
    flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 4px 8px 8px; scrollbar-width: none;
  }
  .el-cats::-webkit-scrollbar { display: none; }
  .el-cats > div { flex: 0 0 30%; max-width: 30%; padding: 8px 6px !important; scroll-snap-align: start; }
  .el-cats h6 { font-size: 12px; }

  /* grade de produtos compacta */
  .row > .product-item { padding-left: 6px; padding-right: 6px; padding-top: 12px !important; }
  .product-item .card-body { padding: 8px 10px 10px !important; }

  .container.py-4 { padding-top: 16px !important; }
  footer.row { padding-top: 24px !important; margin-top: 24px !important; }

  body.el-has-nav { padding-bottom: calc(var(--el-nav-h) + env(safe-area-inset-bottom)); }
  body.el-has-nav .wa-float { bottom: calc(var(--el-nav-h) + 14px + env(safe-area-inset-bottom)) !important; }
  .wa-float img { width: 48px !important; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
}

/* ---------- Barra inferior (só celular) ---------- */
.el-bottomnav { display: none; }
@media (max-width: 767.98px) {
  .el-bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0;
    height: calc(var(--el-nav-h) + env(safe-area-inset-bottom));
    padding: 0 6px env(safe-area-inset-bottom);
    background: rgba(255,255,255,.94);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 -6px 20px rgba(16,24,40,.06);
    z-index: 1040;
    justify-content: space-around; align-items: center;
  }
}
.el-bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: #8a93a3; text-decoration: none; font-size: 10.5px; font-weight: 600;
  position: relative; padding: 6px 0;
}
.el-bottomnav a i { font-size: 19px; transition: transform .2s; }
.el-bottomnav a.ativo { color: var(--el-primary); }
.el-bottomnav a.ativo i { transform: translateY(-2px); }
.el-bottomnav a.ativo::before {
  content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 3px;
  background: var(--el-primary);
}
.el-bottomnav a:active i { transform: scale(.85); }
.el-bottomnav .el-badge {
  position: absolute; top: 2px; left: 50%; margin-left: 6px;
  background: var(--el-accent); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 999px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.el-bottomnav .el-badge:empty, .el-bottomnav .el-badge[data-zero] { display: none; }

/* ---------- Instalar app (bottom sheet) ---------- */
.el-install-bg {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  z-index: 10050; opacity: 0; pointer-events: none; transition: opacity .25s;
}
.el-install-bg.on { opacity: 1; pointer-events: auto; }
.el-install {
  position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 480px;
  background: #fff; border-radius: 24px 24px 0 0;
  padding: 10px 22px calc(22px + env(safe-area-inset-bottom));
  z-index: 10051; transform: translateY(110%);
  transition: transform .35s cubic-bezier(.2,.9,.3,1.1);
  box-shadow: 0 -10px 40px rgba(0,0,0,.2);
}
.el-install.on { transform: translateY(0); }
@media (min-width: 768px) {
  .el-install { bottom: 24px; right: 24px; left: auto; border-radius: 22px; max-width: 380px; }
}
.el-install .el-grip { width: 40px; height: 5px; background: #e5e7eb; border-radius: 5px; margin: 0 auto 14px; }
.el-install .el-head { display: flex; gap: 14px; align-items: center; }
.el-install .el-head img { width: 110px; height: auto; max-height: 60px; object-fit: contain; }
.el-install .el-head b { font-size: 17px; display: block; }
.el-install .el-head small { color: var(--el-muted); }
.el-install ul { list-style: none; padding: 0; margin: 16px 0; }
.el-install li { display: flex; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.el-install li i { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #eef2ff; color: var(--el-primary); font-size: 13px; }
.el-install .el-passos { background: #f6f7fb; border-radius: 14px; padding: 12px 14px; font-size: 14px; margin: 14px 0; }
.el-install .el-passos div { display: block; position: relative; padding: 6px 0 6px 34px; line-height: 1.4; }
.el-install .el-passos .n { position: absolute; left: 0; top: 5px; width: 22px; height: 22px; border-radius: 50%; background: var(--el-primary); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.el-install .el-passos svg { width: 18px; height: 18px; vertical-align: -3px; color: #007aff; }
.el-install .el-btns { display: flex; gap: 10px; }
.el-install .el-btns button { flex: 1; border: 0; border-radius: 14px; padding: 13px; font-weight: 700; font-size: 15px; }
.el-install .el-sim { background: var(--el-primary); color: #fff; box-shadow: 0 6px 16px rgba(30,60,114,.3); }
.el-install .el-nao { background: #f1f3f7; color: var(--el-text); }

/* Quando aberto como app instalado */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
}

/* ---------- Folha de subcategorias (celular) ---------- */
.el-subsheet-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 10040; opacity: 0; pointer-events: none; transition: opacity .25s; }
.el-subsheet-bg.on { opacity: 1; pointer-events: auto; }
.el-subsheet {
  position: fixed; left: 0; right: 0; bottom: 0; max-height: 75vh; overflow-y: auto;
  background: #fff; border-radius: 24px 24px 0 0; z-index: 10041;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(110%); transition: transform .3s cubic-bezier(.2,.9,.3,1.1);
}
.el-subsheet.on { transform: translateY(0); }
.el-subsheet .el-grip { width: 40px; height: 5px; background: #e5e7eb; border-radius: 5px; margin: 0 auto 12px; }
.el-subsheet h5 { font-weight: 800; margin: 4px 0 10px; }
.el-subsheet a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 4px; border-bottom: 1px solid #f0f2f6; color: var(--el-text); text-decoration: none; font-size: 15px;
}
.el-subsheet a i { color: #b0b7c3; font-size: 12px; }

/* ---------- Ícones SVG próprios ---------- */
.el-ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; }
.el-bottomnav a .el-ico { width: 22px; height: 22px; transition: transform .2s; }
.el-bottomnav a.ativo .el-ico { transform: translateY(-2px); }
.el-bottomnav a:active .el-ico { transform: scale(.85); }
.el-mic .el-ico { width: 18px; height: 18px; }
.el-install li i .el-ico { width: 15px; height: 15px; }
.el-subsheet .el-seta { color: #b0b7c3; font-size: 22px; line-height: 1; }

/* ---------- Faixa "Baixe o app" ---------- */
.el-appbar {
  align-items: center; gap: 10px; padding: 8px 12px;
  background: linear-gradient(90deg, var(--el-primary), #2a5298); color: #fff;
}
.el-appbar-ic { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; flex: none; }
.el-appbar-ic .el-ico { width: 18px; height: 18px; }
.el-appbar-tx { flex: 1; line-height: 1.15; min-width: 0; }
.el-appbar-tx b { display: block; font-size: 14px; }
.el-appbar-tx small { font-size: 11.5px; opacity: .85; }
.el-appbar-bt { border: 0; background: #fff; color: var(--el-primary); font-weight: 800; font-size: 13px; border-radius: 999px; padding: 7px 14px; flex: none; }
.el-appbar-x { border: 0; background: none; color: #fff; opacity: .8; padding: 4px; flex: none; display: flex; }
.el-appbar-x .el-ico { width: 18px; height: 18px; }
@media (min-width: 768px) { .el-appbar { display: none !important; } }

/* lupa própria no botão de busca (não depende do Font Awesome) */
nav.navbar form .input-group > .btn.el-lupa-ok > i { display: none; }
nav.navbar form .input-group > .btn.el-lupa-ok .el-ico { width: 18px; height: 18px; color: #fff; }
