/* ============================================================================
 * CUNHA REPAIR — folha de estilo principal
 * ----------------------------------------------------------------------------
 * Construída sobre css/tokens.css. Não há aqui uma única cor, espaço ou raio
 * escrito à mão: tudo sai das variáveis, para o site ser coerente de ponta a
 * ponta e para uma mudança de identidade ser uma linha, não uma tarde.
 *
 * Índice
 *   01 Base e reset            08 Grelha de produtos
 *   02 Estrutura e secções     09 Categorias
 *   03 Tipografia              10 Catálogo (filtros, ordenação)
 *   04 Botões                  11 Assistente rápido
 *   05 Formulários             12 Carrinho e conta
 *   06 Cabeçalho e navegação   13 Reparações
 *   07 Banner principal        14 Rodapé, toast, utilitários
 * ========================================================================== */

/* == 01 · Base e reset ==================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
svg.ico { flex-shrink: 0; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--brand); color: #fff; }

/* Foco visível e consistente — requisito de acessibilidade, não decoração. */
:is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* == 02 · Estrutura e secções ============================================= */

.container {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.block { padding: var(--s9) 0; }

.section {
  padding: var(--s9) 0;
}
.section.alt { background: var(--surface-2); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-bottom: var(--s6);
}

.section-title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: var(--track-tight);
  line-height: var(--lh-tight);
  margin: 0;
  color: var(--ink);
}

.section-sub {
  margin: var(--s2) 0 0;
  color: var(--ink-3);
  font-size: var(--fs-md);
}

.section-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: var(--s3);
}

.grid { display: grid; gap: var(--s5); }

/* == 03 · Tipografia ====================================================== */

h1, h2, h3, h4 {
  margin: 0 0 var(--s3);
  font-weight: 700;
  letter-spacing: var(--track-tight);
  line-height: var(--lh-tight);
  color: var(--ink);
}

p { margin: 0 0 var(--s4); }

.page-title {
  font-size: var(--fs-3xl);
  font-weight: 750;
  letter-spacing: var(--track-tight);
  margin: 0 0 var(--s3);
}

.page-sub {
  font-size: var(--fs-lg);
  color: var(--ink-3);
  max-width: 62ch;
  margin: 0 0 var(--s6);
}

.link-brand {
  color: var(--brand);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  transition: gap var(--t-fast) var(--ease), color var(--t-fast);
}
.link-brand:hover { color: var(--brand-dark); gap: var(--s3); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: var(--s1) var(--s3);
  border-radius: var(--r-full);
}

/* == 04 · Botões ========================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 13px var(--s6);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  font-size: var(--fs-base);
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease),
              background var(--t-base), border-color var(--t-base), color var(--t-base);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }

.btn-brand {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--sh-brand);
}
.btn-brand:hover { background: var(--brand-dark); box-shadow: 0 12px 28px rgba(226, 10, 3, 0.32); }

.btn-dark {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--sh-md);
}
.btn-dark:hover { background: #000; }

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--ink); background: var(--surface-2); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--surface-3); }

.btn-lg { padding: 16px var(--s7); font-size: var(--fs-md); }
.btn-sm { padding: 9px var(--s4); font-size: var(--fs-sm); }
.btn-block { width: 100%; }

.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Botão-pílula do cabeçalho (CTA principal) */
.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-full);
  padding: 11px var(--s5);
  font-size: var(--fs-sm);
  font-weight: 650;
  white-space: nowrap;
  transition: background var(--t-base), transform var(--t-fast) var(--ease), box-shadow var(--t-base);
  box-shadow: var(--sh-brand);
}
.btn-pill:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-pill.active { background: var(--ink); box-shadow: var(--sh-md); }

/* == 05 · Formulários ===================================================== */

.form-group { margin-bottom: var(--s5); }

.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--ink-2);
  margin-bottom: var(--s2);
}

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="search"], input[type="date"], select, textarea {
  width: 100%;
  padding: 13px var(--s4);
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-4); }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
::placeholder { color: var(--ink-4); }

select {
  appearance: none;
  padding-right: var(--s8);
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--s4) center;
  cursor: pointer;
}
select:disabled { background-color: var(--surface-2); color: var(--ink-4); cursor: not-allowed; }

/* == 06 · Cabeçalho e navegação =========================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base) var(--ease);
}
.site-header.scrolled {
  box-shadow: var(--sh-md);
  border-bottom-color: transparent;
}
.site-header.hide {
  transform: translateY(-100%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--s2);
  height: var(--header-h);
}
@media (min-width: 480px) { .header-inner { gap: var(--s4); } }

/* Logótipo -------------------------------------------------------------- */

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  flex-shrink: 0;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
  color: var(--ink);
}
/* Logótipo Cunha Repair (SVG). No telemóvel estreito mostra só o monograma "CR";
   a partir de 560px mostra o nome completo. Ficheiros em img/logo/. */
.logo img { display: block; height: auto; }
.logo .logo-marca { width: 50px; }
.logo .logo-completo { display: none; width: 200px; }
/* O nome completo só entra quando há espaço para ele e para os botões todos
   (abaixo disso o topo transbordava e o "Apoio Técnico" ficava cortado). */
@media (min-width: 700px) {
  .logo .logo-marca { display: none; }
  .logo .logo-completo { display: block; }
}
@media (min-width: 1024px) { .logo .logo-completo { width: 230px; } }

/* Espaçador entre o logótipo e as ações --------------------------------- */

.header-spacer { flex: 1; min-width: var(--s4); }

/* Pesquisa — linha própria, a toda a largura, por baixo da barra principal */

.header-search-row {
  border-top: 1px solid var(--border);
  padding: var(--s3) 0;
}

.header-search-row .search-form { max-width: none; }

.search-form {
  display: flex;
  align-items: center;
  gap: var(--s2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 4px 4px 4px var(--s5);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.search-form:focus-within {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.search-form input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 0;
  font-size: var(--fs-base);
  line-height: 38px;
  color: var(--ink);
}
.search-form input:hover, .search-form input:focus { box-shadow: none; border: none; }
/* A barra inteira já fica realçada ao escrever: o campo lá dentro não leva um segundo contorno. */
.search-form input:focus-visible, .drawer-search-form input:focus-visible { outline: none; }
.search-form input::-webkit-search-cancel-button { display: none; }
.search-form button {
  flex: 0 0 38px;
  height: 38px;
  border: none;
  border-radius: var(--r-full);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--t-fast), transform var(--t-fast) var(--ease);
}
.search-form button:hover { background: var(--brand); }
.search-form button:active { transform: scale(0.94); }

/* Ações à direita -------------------------------------------------------- */

.header-actions {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
@media (min-width: 480px) { .header-actions { gap: var(--s1); } }

.icon-btn, .action-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  border-radius: var(--r-md);
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
@media (min-width: 480px) { .icon-btn, .action-btn { width: 42px; height: 42px; } }
.icon-btn:hover, .action-btn:hover { background: var(--surface-2); color: var(--ink); }

.action-btn .label {
  display: none;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}
@media (min-width: 1024px) {
  .action-btn { width: auto; min-width: 56px; height: 46px; gap: 2px; padding: 0 var(--s2); grid-auto-flow: row; }
  .action-btn .label { display: block; }
}

.cart-badge, .fav-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--brand);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  line-height: 1;
}
@media (min-width: 1024px) { .cart-badge, .fav-badge { top: 0; right: 6px; } }

.menu-toggle { flex-shrink: 0; }
@media (min-width: 1024px) { .menu-toggle { display: none; } }

.header-cta {
  display: inline-flex;
  margin-left: var(--s1);
  padding: 8px var(--s3);
  font-size: 0.74rem;
  gap: 5px;
}
@media (min-width: 480px) { .header-cta { padding: 9px var(--s4); font-size: 0.78rem; margin-left: var(--s2); } }
@media (min-width: 768px) { .header-cta { padding: 11px var(--s5); font-size: var(--fs-sm); } }

/* Ecrãs estreitos (até 419px, inclui iPhone 16/16 Pro/Plus): some o texto, fica só o ícone. */
@media (max-width: 419px) {
  .header-cta { padding: 9px; gap: 0; }
  .header-cta .cta-label { display: none; }
}

/* Barra de categorias (só computador) ------------------------------------ */

.catbar {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
@media (min-width: 1024px) { .catbar { display: block; } }

.catbar-inner {
  display: flex;
  align-items: center;
  gap: var(--s1);
  height: 52px;
  overflow: visible;
}

.catbar-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.catbar-link:hover, .catbar-item:hover > .catbar-link { background: var(--surface-2); color: var(--brand); }
.catbar-link.active { color: var(--brand); }
.catbar-link .ico { color: var(--ink-4); transition: color var(--t-fast); }
.catbar-link:hover .ico, .catbar-item:hover .catbar-link .ico { color: var(--brand); }

.catbar-spacer { flex: 1; }

.catbar-service {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--ink-2);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-md);
  transition: background var(--t-fast), color var(--t-fast);
}
.catbar-service:hover { background: var(--brand-tint); color: var(--brand); }

/* Mega menu: preparado para crescer — hoje mostra marcas e modelos. */
.catbar-item { position: relative; }

.megamenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  padding: var(--s6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease), visibility var(--t-base);
  z-index: 90;
}
.catbar-item:hover > .megamenu,
.catbar-item:focus-within > .megamenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.megamenu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--s5) var(--s6);
}
.megamenu-col-title {
  font-size: var(--fs-sm);
  font-weight: 750;
  margin-bottom: var(--s2);
  color: var(--ink);
}
.megamenu-col a {
  display: block;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  padding: 5px 0;
  transition: color var(--t-fast), padding-left var(--t-fast) var(--ease);
}
.megamenu-col a:hover { color: var(--brand); padding-left: 4px; }
.megamenu-foot {
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
}

/* Gaveta lateral (telemóvel) --------------------------------------------- */

body.drawer-lock { overflow: hidden; }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
  z-index: 90;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 88%;
  max-width: 360px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--t-slow) var(--ease-out);
  z-index: 95;
  box-shadow: var(--sh-xl);
}
.mobile-nav.open { transform: translateX(0); }

.drawer-tabs { display: flex; height: 50px; flex-shrink: 0; }
.drawer-tab {
  flex: 1;
  border: none;
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  background: var(--ink);
  color: #fff;
  opacity: 0.7;
  transition: background var(--t-fast), opacity var(--t-fast);
}
.drawer-tab:hover { opacity: 0.9; }
.drawer-tab.active { background: var(--brand); opacity: 1; }
.drawer-close {
  flex: 0 0 50px;
  border: none;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
}
.drawer-close:hover { background: var(--border); }

.drawer-search { flex-shrink: 0; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.drawer-search-form {
  display: flex;
  align-items: center;
  gap: var(--s2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 4px 6px 4px 4px;
}
.drawer-search-form:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.drawer-search-go {
  flex: 0 0 34px; height: 34px;
  border: none; border-radius: var(--r-full);
  background: var(--ink); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.drawer-search-go:hover { background: var(--brand); }
.drawer-search-form input {
  flex: 1; min-width: 0;
  border: none; background: none; padding: 0;
  font-size: var(--fs-base);
}
.drawer-search-form input:hover, .drawer-search-form input:focus { border: none; box-shadow: none; }
.drawer-search-form input::-webkit-search-cancel-button { display: none; }
.drawer-search-clear {
  border: none; background: none; cursor: pointer;
  color: var(--ink-4); display: grid; place-items: center; padding: var(--s1);
}
.drawer-search-clear:hover { color: var(--ink); }
.drawer-search-clear[hidden] { display: none; }

.drawer-user { padding: var(--s4) 0 var(--s2); display: flex; flex-direction: column; gap: 2px; }
.drawer-user strong { font-size: var(--fs-md); }
.drawer-user span { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 400; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--s1) var(--s5) var(--s6);
  font-size: var(--fs-base);
  font-weight: 600;
}
.drawer-body[hidden] { display: none; }

.mobile-nav .menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: 13px 0;
  border-bottom: 1px solid var(--surface-3);
}
.mobile-nav a.mobile-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--s2);
  transition: color var(--t-fast);
}
.mobile-nav a.mobile-link::after {
  content: "";
  width: 6px; height: 6px;
  margin-left: auto;
  border-right: 2px solid var(--border-strong);
  border-bottom: 2px solid var(--border-strong);
  transform: rotate(-45deg);
}
.menu-row.has-children a.mobile-link::after { content: none; }
.mobile-nav a.active { color: var(--brand); }
.mobile-nav a:hover { color: var(--brand); }

.mobile-nav-label {
  font-size: var(--fs-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--ink-4);
  padding-top: var(--s5);
}
.mobile-nav-divider { border-top: 1px solid var(--border); margin: var(--s2) 0 var(--s1); }

.menu-badge {
  display: inline-block;
  margin-left: var(--s2);
  padding: 2px 7px;
  border-radius: var(--r-sm);
  background: var(--ok);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 800;
}

.menu-item { position: relative; }
.menu-expand {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border: none;
  background: none;
  border-radius: var(--r-full);
  color: var(--ink-4);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
}
.menu-expand:hover { color: var(--brand); background: var(--surface-2); }
.menu-expand .ic { display: none; line-height: 1; font-size: 1.3rem; font-weight: 400; }

/* -- Modo acordeão (toque) -- */
.menu-mode-acordeao .submenu {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--t-base) var(--ease);
}
.menu-mode-acordeao .submenu-inner { overflow: hidden; padding-left: var(--s4); }
.menu-mode-acordeao .menu-item.open > .submenu { grid-template-rows: 1fr; }
.menu-mode-acordeao .menu-item.open > .menu-row {
  background: var(--surface-2);
  margin: 0 calc(var(--s5) * -1);
  padding-left: var(--s5);
  padding-right: var(--s5);
  border-bottom-color: transparent;
}
.menu-mode-acordeao .menu-item.depth-2.open > .menu-row { margin: 0 calc(var(--s3) * -1); padding-left: var(--s3); padding-right: var(--s3); }
.menu-mode-acordeao .menu-item.depth-1 > .menu-row > .menu-expand .ic-plus { display: block; }
.menu-mode-acordeao .menu-item.depth-1.open > .menu-row > .menu-expand .ic-plus { display: none; }
.menu-mode-acordeao .menu-item.depth-1.open > .menu-row > .menu-expand .ic-minus { display: block; }
.menu-mode-acordeao .menu-item:not(.depth-1) > .menu-row > .menu-expand .ic-caret { display: block; }
.menu-mode-acordeao .menu-item:not(.depth-1).open > .menu-row > .menu-expand .ic-caret { transform: rotate(90deg); }
.menu-mode-acordeao .menu-expand .ic-caret { transition: transform var(--t-base) var(--ease); }
.menu-mode-acordeao .menu-item.open > .menu-row > .menu-expand { color: var(--ink); }

/* -- Modo painel flutuante (rato) -- */
.menu-mode-flyout .submenu {
  position: fixed;
  top: 0; left: 0;
  min-width: 240px;
  max-width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xl);
  padding: var(--s2) var(--s4);
  opacity: 0;
  visibility: hidden;
  overflow: visible;
  z-index: 150;
  /* Sem `transform`: um elemento transformado passa a ser o bloco de
     referência dos descendentes fixed e o painel seguinte ficaria preso. */
  transition: opacity var(--t-fast) var(--ease), visibility var(--t-fast);
}
.menu-mode-flyout .submenu.scrollable { max-height: 70vh; overflow-y: auto; overscroll-behavior: contain; }
.menu-mode-flyout .submenu-inner { overflow: visible; }
.menu-mode-flyout .menu-item.open > .submenu { opacity: 1; visibility: visible; }
.menu-mode-flyout .menu-expand .ic-chevron { display: block; }
.menu-mode-flyout .menu-row-all { display: none; }

.menu-row-all { border-bottom: 1px solid var(--surface-3); }
.menu-all {
  font-size: var(--fs-sm) !important;
  font-weight: 700 !important;
  color: var(--brand) !important;
}
.depth-2 .mobile-link, .depth-2 a.mobile-link { font-weight: 600; font-size: var(--fs-sm); }
.depth-3 .mobile-link, .depth-3 a.mobile-link { font-weight: 500; font-size: var(--fs-sm); color: var(--ink-2); }

/* == 07 · Banner principal ================================================ */

.carousel-wrap { padding-top: var(--s6); }

.carousel {
  position: relative;
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--sh-lg);
  isolation: isolate;
}

.carousel-track { display: flex; transition: transform 0.7s var(--ease-out); }

.carousel-slide {
  min-width: 100%;
  color: #fff;
  padding: var(--s9) 0;
  position: relative;
}
.carousel-slide::after {
  /* brilho subtil no canto: dá profundidade sem precisar de imagem */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 120% at 85% 15%, rgba(255,255,255,0.16), transparent 60%);
  pointer-events: none;
}
.slide-1 { background: linear-gradient(125deg, #17191d 0%, #2b2f36 55%, #3a3f47 100%); }
.slide-2 { background: linear-gradient(125deg, var(--brand-deep) 0%, var(--brand) 60%, #ff4d42 100%); }
.slide-3 { background: linear-gradient(125deg, #0f2544 0%, #1b3d6d 60%, #2f5ea3 100%); }
.slide-4 { background: linear-gradient(125deg, #10302a 0%, #175045 60%, #1f7a63 100%); }
.slide-5 { background: linear-gradient(125deg, #2a1b3d 0%, #452c66 60%, #63409a 100%); }

.hero-inner {
  display: grid;
  gap: var(--s6);
  align-items: center;
  position: relative;
  z-index: 1;
}
@media (min-width: 768px) { .hero-inner { grid-template-columns: 1.35fr 0.65fr; } }

.hero-inner h1 {
  font-size: var(--fs-3xl);
  font-weight: 750;
  color: #fff;
  margin: 0 0 var(--s4);
  max-width: 20ch;
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}
.hero-inner p {
  font-size: var(--fs-lg);
  color: rgba(255,255,255,0.86);
  max-width: 48ch;
  margin: 0 0 var(--s6);
}
.hero-actions { display: flex; gap: var(--s3); flex-wrap: wrap; }
.hero-emoji {
  font-size: clamp(4rem, 12vw, 8rem);
  text-align: center;
  line-height: 1;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,0.32));
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(-3deg); }
}

.carousel-dots {
  position: absolute;
  bottom: var(--s5);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--s2);
  z-index: 2;
}
.carousel-dot {
  width: 8px; height: 8px;
  border-radius: var(--r-full);
  border: none;
  background: rgba(255,255,255,0.42);
  cursor: pointer;
  padding: 0;
  transition: width var(--t-base) var(--ease), background var(--t-base);
}
.carousel-dot.active { width: 26px; background: #fff; }

/* == 08 · Grelha de produtos ============================================== */

.grid-products {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: var(--s4);
}
@media (min-width: 768px) {
  .grid-products { grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: var(--s5); }
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-base);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-lg);
  border-color: transparent;
}

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, var(--surface-2), #fff 70%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.product-media .emoji {
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  line-height: 1;
  transition: transform var(--t-slow) var(--ease);
  filter: drop-shadow(0 8px 16px rgba(16,24,40,0.12));
}
.product-card:hover .product-media .emoji { transform: scale(1.08) rotate(-3deg); }

.product-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--s4);
  gap: var(--s1);
}

.product-card .name {
  font-size: var(--fs-base);
  font-weight: 650;
  line-height: var(--lh-snug);
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card .compat {
  font-size: var(--fs-xs);
  color: var(--ink-4);
  margin-bottom: var(--s2);
}

.product-card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  margin-top: auto;
  padding-top: var(--s3);
}
.price-block { display: flex; flex-direction: column; line-height: 1.2; }
.product-card .price { font-size: var(--fs-lg); font-weight: 750; color: var(--ink); letter-spacing: -0.02em; }
.price-old { font-size: var(--fs-xs); color: var(--ink-4); text-decoration: line-through; }

.add-btn {
  border: none;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-full);
  padding: 9px var(--s4);
  font-size: var(--fs-sm);
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), transform var(--t-fast) var(--ease);
}
.add-btn:hover { background: var(--brand); transform: scale(1.04); }
.add-btn:active { transform: scale(0.97); }

/* Selos e favorito */
.card-badges {
  position: absolute;
  top: var(--s3);
  left: var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  z-index: 2;
  align-items: flex-start;
}
.card-badge {
  background: var(--ok);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 4px var(--s2);
  border-radius: var(--r-sm);
  text-transform: lowercase;
}
.card-badge.promo { background: var(--brand); }
.card-badge.estado { background: var(--surface); color: var(--ink-2); border: 1px solid var(--border); text-transform: none; }

.fav-btn {
  position: absolute;
  top: var(--s3);
  right: var(--s3);
  z-index: 2;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  color: var(--ink-3);
  cursor: pointer;
  transition: color var(--t-fast), transform var(--t-fast) var(--ease), border-color var(--t-fast), background var(--t-fast);
}
.fav-btn:hover { color: var(--brand); border-color: var(--brand); transform: scale(1.1); }
.fav-btn.on { color: var(--brand); border-color: var(--brand); background: var(--brand-tint); }
.fav-btn:active { transform: scale(0.92); }

/* == 09 · Categorias ====================================================== */

.grid-cats-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(104px, 1fr);
  gap: var(--s3);
  overflow-x: auto;
  padding-bottom: var(--s3);
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
@media (min-width: 900px) {
  .grid-cats-scroll { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); grid-auto-columns: auto; overflow: visible; }
}

.cat-circle-item {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
  text-align: center;
  padding: var(--s4) var(--s2);
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  transition: background var(--t-base), border-color var(--t-base), transform var(--t-base) var(--ease);
}
.cat-circle-item:hover { background: var(--surface); border-color: var(--border); transform: translateY(-3px); box-shadow: var(--sh-md); }
.cat-circle {
  width: 58px; height: 58px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition: background var(--t-base), color var(--t-base);
}
.cat-circle-item:hover .cat-circle { background: var(--brand-tint); color: var(--brand); }
.cat-circle-item .name { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); line-height: var(--lh-snug); }
.cat-circle-item:hover .name { color: var(--ink); }

/* == 10 · Catálogo ======================================================== */

.catalog-layout { display: flex; flex-direction: column; gap: var(--s6); }
.catalog-main { flex: 1; min-width: 0; }

.catalog-toolbar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s5);
}
.results-count { font-size: var(--fs-base); color: var(--ink-3); font-weight: 600; }
.sort-field { margin-left: auto; display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); color: var(--ink-3); }
.sort-field select { width: auto; padding: 9px var(--s7) 9px var(--s4); font-size: var(--fs-sm); font-weight: 600; border-radius: var(--r-full); }

.filters-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--r-full);
  padding: 9px var(--s4);
  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.filters-btn:hover { border-color: var(--ink); background: var(--surface-2); }
.filters-count {
  background: var(--brand); color: #fff;
  border-radius: var(--r-full);
  min-width: 18px; height: 18px;
  font-size: 0.66rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

.active-filters { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.active-filters[hidden] { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--r-full);
  padding: 7px var(--s3);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }
.chip span[aria-hidden] { font-size: 0.7rem; opacity: 0.6; }
.chip-clear { background: none; border-color: transparent; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }

.filters-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 88%;
  max-width: 340px;
  background: var(--surface);
  padding: 0 var(--s5) var(--s5);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform var(--t-slow) var(--ease-out);
  z-index: 96;
  box-shadow: var(--sh-xl);
}
.filters-sidebar.open { transform: translateX(0); }

.filters-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 12, 16, 0.5);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
  z-index: 95;
}
.filters-backdrop.open { opacity: 1; pointer-events: auto; }

.filters-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 750; font-size: var(--fs-md);
  padding: var(--s5) 0 var(--s4);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.filters-close {
  border: none; background: var(--surface-2);
  border-radius: var(--r-full);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  cursor: pointer; color: var(--ink);
}
.filters-close:hover { background: var(--surface-3); }

.filters-block { border-bottom: 1px solid var(--border); padding-bottom: var(--s4); }
.filters-block:last-of-type { border-bottom: none; }
.filters-title { font-weight: 750; font-size: var(--fs-sm); margin-bottom: var(--s2); }

.filter-check {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-size: var(--fs-base);
  padding: 7px 0;
  cursor: pointer;
  transition: color var(--t-fast);
}
.filter-check input { accent-color: var(--brand); width: 17px; height: 17px; flex-shrink: 0; margin: 0; }
.filter-check span { flex: 1; min-width: 0; }
.filter-check em { font-style: normal; font-size: var(--fs-xs); color: var(--ink-4); font-weight: 600; }
.filter-check:hover span { color: var(--brand); }

.filters-more {
  border: none;
  background: none;
  padding: var(--s2) 0 0;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
}
.filters-more:hover { color: var(--brand-dark); }
.filter-check.extra { display: none; }
.filters-block.expanded .filter-check.extra { display: flex; }
/* Caixa "Procurar modelo" dentro do filtro: enquanto se escreve, mostra todos os que batem certo. */
.filter-search { width: 100%; box-sizing: border-box; margin: 0 0 var(--s2); padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: var(--fs-sm); background: var(--surface, #fff); color: inherit; }
.filter-search:focus { outline: none; border-color: var(--brand); }
.filters-block.searching .filter-check.extra { display: flex; }
.filters-block .filter-check.no-match { display: none !important; }
.filter-empty { font-size: var(--fs-sm); color: var(--ink-4); margin: var(--s2) 0 0; }

.filters-reset { background: none; border: none; cursor: pointer; padding: 0; font: inherit; font-size: var(--fs-sm); text-align: left; }
.filters-apply { display: block; }

.catalog-empty { color: var(--ink-3); padding: var(--s7) 0; }
.catalog-empty[hidden] { display: none; }

@media (min-width: 900px) {
  .catalog-layout { flex-direction: row; align-items: flex-start; gap: var(--s7); }
  .filters-sidebar {
    position: sticky;
    top: calc(var(--header-h) + var(--s5));
    width: 240px;
    max-width: none;
    flex-shrink: 0;
    transform: none;
    box-shadow: none;
    padding: 0;
    background: none;
    max-height: calc(100vh - var(--header-h) - var(--s8));
    overflow-y: auto;
  }
  .filters-head, .filters-apply, .filters-btn, .filters-backdrop { display: none; }
}

/* == 11 · Assistente rápido =============================================== */

.wizard-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s6);
  margin-bottom: var(--s7);
}
.wizard-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.wizard-title { font-size: var(--fs-lg); font-weight: 700; letter-spacing: var(--track-tight); }
.wizard-sub { font-size: var(--fs-sm); color: var(--ink-3); margin: var(--s1) 0 0; }
.wizard-fields { display: grid; gap: var(--s4); align-items: end; }
@media (min-width: 720px) { .wizard-fields { grid-template-columns: 1fr 1fr auto; } }
.wizard-code-row { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s4); }
.wizard-or { font-size: var(--fs-sm); color: var(--ink-4); font-weight: 650; flex-shrink: 0; }

.help-icon {
  position: relative;
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-3);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: help;
  display: grid; place-items: center;
}
.help-icon:hover { border-color: var(--brand); color: var(--brand); }
.help-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: var(--lh-snug);
  text-align: left;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--t-fast), visibility var(--t-fast);
  z-index: 30;
}
.help-icon:hover .help-tooltip, .help-icon:focus-visible .help-tooltip { visibility: visible; opacity: 1; }

/* == 12 · Carrinho, conta e estados ======================================= */

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s5) 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.cart-item .name { font-weight: 650; }
.cart-item .meta { font-size: var(--fs-sm); color: var(--ink-3); }

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  overflow: hidden;
}
.qty-stepper button {
  border: none; background: none;
  width: 34px; height: 34px;
  cursor: pointer;
  font-size: var(--fs-md);
  color: var(--ink-2);
  transition: background var(--t-fast);
}
.qty-stepper button:hover { background: var(--surface-2); color: var(--brand); }
.qty-value { min-width: 30px; text-align: center; font-weight: 650; font-size: var(--fs-sm); }

.remove-link {
  border: none; background: none;
  color: var(--ink-4);
  font-size: var(--fs-sm);
  cursor: pointer;
  padding: var(--s1) 0;
  transition: color var(--t-fast);
}
.remove-link:hover { color: var(--brand); text-decoration: underline; }

.cart-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s6);
}
.total-label { font-size: var(--fs-sm); color: var(--ink-3); }
.total-amount { font-size: var(--fs-2xl); font-weight: 750; letter-spacing: var(--track-tight); }

.help-tag {
  display: inline-block;
  margin-top: var(--s2);
  font-size: var(--fs-xs);
  font-weight: 650;
  color: var(--ok);
  background: var(--ok-bg);
  padding: 3px var(--s2);
  border-radius: var(--r-sm);
}

.empty-state { text-align: center; padding: var(--s10) var(--s4); }
.empty-state .emoji { font-size: 3.4rem; margin-bottom: var(--s4); }
.empty-state h1 { font-size: var(--fs-2xl); }
.empty-state p { color: var(--ink-3); max-width: 46ch; margin: 0 auto var(--s6); }
.empty-actions { display: flex; gap: var(--s3); justify-content: center; flex-wrap: wrap; }

.info-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s5);
}
.info-box > div { margin-bottom: var(--s2); }

.steps { display: grid; gap: var(--s4); margin: var(--s7) 0; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(2, 1fr); } }
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s5);
  transition: box-shadow var(--t-base), transform var(--t-base) var(--ease);
}
.step-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.step-card .title { font-weight: 700; margin-bottom: var(--s2); }
.step-card p { font-size: var(--fs-sm); color: var(--ink-3); margin: 0; }

/* Faixa de garantias (confiança) */
.features { background: var(--surface-2); padding: var(--s9) 0; border-top: 1px solid var(--border); }
.features .grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s6); }
.features > .container > .grid > div { display: flex; gap: var(--s4); align-items: flex-start; }
.feature-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--brand);
  display: grid; place-items: center;
}
.feature-title { font-weight: 700; margin-bottom: var(--s1); }
.features p { font-size: var(--fs-sm); color: var(--ink-3); margin: 0; }

/* Cartões dos dois serviços âncora (homepage) */
.service-card {
  display: flex;
  gap: var(--s5);
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s6);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base), border-color var(--t-base);
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); border-color: transparent; }
.service-icon {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: var(--r-lg);
  background: var(--brand-tint);
  color: var(--brand);
  display: grid; place-items: center;
}
.service-body { display: flex; flex-direction: column; gap: var(--s2); }
.service-body strong { font-size: var(--fs-lg); font-weight: 700; letter-spacing: var(--track-tight); }
.service-body > span { font-size: var(--fs-base); color: var(--ink-3); }
.service-body .link-brand { font-size: var(--fs-sm); margin-top: var(--s1); }

/* Aviso / chamada de atenção reutilizável */
.notice {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
  background: var(--info-bg);
  border: 1px solid rgba(26, 79, 160, 0.18);
  border-radius: var(--r-lg);
  padding: var(--s5);
}
.notice-icon { flex-shrink: 0; color: var(--info); }
.notice-body { flex: 1; min-width: 200px; }
.notice-body strong { display: block; font-size: var(--fs-md); margin-bottom: 2px; }
.notice-body span { font-size: var(--fs-sm); color: var(--ink-2); }
.notice .btn { flex-shrink: 0; }

/* == 13 · Reparações ====================================================== */

.repair-hero {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: var(--s7) 0 var(--s8);
}
.breadcrumb { font-size: var(--fs-sm); color: var(--ink-4); margin-bottom: var(--s4); }
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--brand); }

.brand-row {
  display: flex;
  gap: var(--s5);
  align-items: flex-start;
  padding: var(--s6) 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand-badge-col { display: flex; flex-direction: column; align-items: center; gap: var(--s2); width: 92px; flex-shrink: 0; }
.brand-badge {
  width: 62px; height: 62px;
  border-radius: var(--r-full);
  display: grid; place-items: center;
  font-size: 1.5rem; font-weight: 800;
  box-shadow: var(--sh-sm);
}
.brand-name { font-size: var(--fs-sm); font-weight: 700; }
.brand-families { display: flex; flex-wrap: wrap; gap: var(--s2); flex: 1; min-width: 200px; }
.brand-families a {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-full);
  padding: 9px var(--s4);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  transition: border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-base);
}
.brand-families a:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); box-shadow: var(--sh-sm); }

.family-toolbar { display: flex; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s6); }
.family-toolbar input { flex: 1; min-width: 220px; }
.family-toolbar select { width: auto; min-width: 180px; }

.family-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 7px var(--s4);
  font-size: var(--fs-sm);
  font-weight: 650;
  margin-bottom: var(--s4);
}
.chip-emoji { font-size: var(--fs-md); }
.chip-change { color: var(--brand); font-size: var(--fs-xs); text-decoration: underline; text-underline-offset: 2px; }

.grid-models { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s4); }
.model-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--s3);
  text-align: center;
  padding: var(--s5) var(--s3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base), border-color var(--t-base);
}
.model-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: transparent; }
.model-emoji { font-size: 2rem; }
.model-name { font-size: var(--fs-sm); font-weight: 650; }

.promo-banner {
  display: flex; align-items: center; gap: var(--s4);
  background: var(--brand-tint);
  border: 1px solid rgba(226, 10, 3, 0.14);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
  margin-bottom: var(--s6);
  font-size: var(--fs-sm);
}
.promo-emoji { font-size: 1.6rem; }

.repair-grid-layout { display: grid; gap: var(--s6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .repair-grid-layout { grid-template-columns: 1fr 320px; align-items: start; } }

.grid-parts { grid-template-columns: repeat(auto-fill, minmax(min(150px, calc(50% - var(--s3))), 1fr)); gap: var(--s3); }
.part-card { min-width: 0; }
.part-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
  text-align: center;
  padding: var(--s5) var(--s3);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-base), background var(--t-fast);
}
.part-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--sh-sm); }
.part-card.selected { border-color: var(--brand); background: var(--brand-tint); }
/* "Pedir orçamento": é um link (não entra no carrinho) — abre o pedido grátis no Apoio Técnico. */
a.part-card { color: inherit; text-decoration: none; }
.part-card-pedido { border-style: dashed; }
.part-card-pedido .part-hint { font-size: var(--fs-xs); line-height: 1.35; color: var(--ink-3); max-width: 22ch; }
.part-card-pedido .part-price { color: var(--success, #12805c); font-weight: 800; }
.part-icon { font-size: 1.7rem; }
.part-name { font-size: var(--fs-sm); font-weight: 650; }
.part-price { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 600; }

.repair-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s6);
  box-shadow: var(--sh-sm);
  position: sticky;
  top: calc(var(--header-h) + var(--s5));
}
.repair-summary-emoji { font-size: 2rem; margin-bottom: var(--s3); }
.summary-list { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s4); }
.summary-row { display: flex; justify-content: space-between; gap: var(--s3); font-size: var(--fs-sm); }
.summary-total {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px solid var(--border);
  padding-top: var(--s4);
  margin-bottom: var(--s5);
  font-weight: 750;
  font-size: var(--fs-lg);
}
.repair-summary-note { font-size: var(--fs-xs); color: var(--ink-4); margin-top: var(--s4); }

/* Produto individual */
.product-detail { display: grid; gap: var(--s7); }
@media (min-width: 800px) { .product-detail { grid-template-columns: 1fr 1fr; align-items: start; } }
.product-image {
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  font-size: clamp(4rem, 14vw, 7rem);
  background: linear-gradient(155deg, var(--surface-2), #fff 70%);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
}
.product-price { font-size: var(--fs-3xl); font-weight: 780; letter-spacing: var(--track-tight); margin-bottom: var(--s5); }

.back-link { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); color: var(--ink-3); margin-bottom: var(--s5); }
.back-link:hover { color: var(--brand); }

/* == 14 · Rodapé, toast e utilitários ===================================== */

.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.72);
  padding: var(--s10) 0 var(--s6);
  margin-top: var(--s11);
  font-size: var(--fs-sm);
}
.footer-inner {
  display: grid;
  gap: var(--s7);
  grid-template-columns: 1fr;
  padding-bottom: var(--s8);
}
@media (min-width: 700px) { .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; } }
@media (min-width: 980px) { .footer-inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-logo { margin-bottom: var(--s4); }
.footer-logo img { display: block; width: 220px; max-width: 100%; height: auto; }
.footer-tagline { display: block; margin-top: 8px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.footer-title { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: var(--track-wide); color: #fff; margin-bottom: var(--s4); }
.site-footer a { display: block; padding: var(--s1) 0; color: rgba(255,255,255,0.72); transition: color var(--t-fast), padding-left var(--t-fast) var(--ease); }
.site-footer a:hover { color: #fff; padding-left: 3px; }
.site-footer p { margin: 0 0 var(--s3); max-width: 42ch; line-height: var(--lh-base); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: var(--s5);
  text-align: center;
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.5);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--s6);
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: var(--s3) var(--s5);
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: var(--sh-xl);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base), transform var(--t-base) var(--ease);
  z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Entrada suave dos blocos ao entrar no ecrã (ativada por js/layout.js) */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }

/* == 15 · Checkout ========================================================= */

.form-grid-2 { display: grid; gap: var(--s4); }
@media (min-width: 560px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }

.form-hint { font-size: var(--fs-sm); color: var(--ink-4); line-height: var(--lh-base); margin: 0; }
.optional-tag { font-weight: 400; color: var(--ink-4); font-size: 0.85em; }

.checkout-grid { display: grid; gap: var(--s7); align-items: start; }
@media (min-width: 900px) { .checkout-grid { grid-template-columns: 1.6fr 1fr; } }

.checkout-main { display: flex; flex-direction: column; gap: var(--s6); min-width: 0; }

.co-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s6);
}
.co-panel-title {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: var(--s5);
}

.co-options { display: flex; flex-direction: column; gap: var(--s3); }

.option-card {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s4);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.option-card:hover { border-color: var(--border-strong); }
.option-card.selected { border-color: var(--brand); background: var(--brand-tint); }
.option-card.disabled { opacity: 0.45; cursor: not-allowed; }
.option-card input[type="radio"] { margin-top: 3px; accent-color: var(--brand); flex-shrink: 0; }
.option-card-body { display: flex; flex-direction: column; gap: 3px; }
.option-card-title { font-weight: 650; display: flex; gap: var(--s2); align-items: baseline; }
.option-card-desc { font-size: var(--fs-sm); color: var(--ink-3); }

.co-check {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  cursor: pointer;
  line-height: 1.5;
}
.co-check input { margin-top: 3px; accent-color: var(--brand); flex-shrink: 0; }

.checkout-summary { position: relative; }
@media (min-width: 900px) {
  .checkout-summary { position: sticky; top: calc(var(--header-h) + var(--s5)); }
}

.co-lines {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin-bottom: var(--s4);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
}
.co-line { display: flex; justify-content: space-between; gap: var(--s3); font-size: var(--fs-sm); }
.co-line span:first-child { color: var(--ink-2); }
.co-line.muted span { color: var(--ink-4); font-style: italic; }
.co-line.total {
  font-size: var(--fs-lg);
  font-weight: 800;
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
  margin-top: var(--s2);
}

/* == 16 · Páginas legais ==================================================== */

.legal-page { max-width: 760px; }
.legal-page h2 { margin-top: var(--s8); margin-bottom: var(--s3); font-size: var(--fs-xl); }
.legal-page p, .legal-page li { color: var(--ink-2); line-height: var(--lh-base); }
.legal-page ul { padding-left: 1.2em; margin: var(--s3) 0; }
.legal-page li { margin-bottom: var(--s2); }
.legal-updated { color: var(--ink-4); font-size: var(--fs-sm); margin-bottom: var(--s7); }

/* == 17 · Página de produto ================================================ */

.pdp-grid { display: grid; gap: var(--s8); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 800px) { .pdp-grid { grid-template-columns: 1fr 1fr; align-items: start; } }

.pdp-media { position: relative; }
.pdp-brand { color: var(--ink-3); font-weight: 650; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: var(--track-wide); margin-bottom: var(--s2); }
.pdp-price-row { display: flex; align-items: baseline; gap: var(--s3); margin: var(--s3) 0 var(--s5); }
.pdp-price-old { font-size: var(--fs-lg); color: var(--ink-4); text-decoration: line-through; }

.stock-badge { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 650; padding: 6px 12px; border-radius: var(--r-full); margin-bottom: var(--s5); }
.stock-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock-badge.ok { background: var(--ok-bg); color: var(--ok); }
.stock-badge.low { background: var(--warn-bg); color: var(--warn); }
.stock-badge.out { background: var(--surface-2); color: var(--ink-4); }

.pdp-qty-row { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s5); }
.pdp-trust { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s6); font-size: var(--fs-sm); color: var(--ink-3); }
.pdp-trust div { display: flex; align-items: center; gap: var(--s2); }

.pdp-related { margin-top: var(--s11); }
.pdp-related .section-title { font-size: var(--fs-xl); font-weight: 750; margin-bottom: var(--s5); }

/* Aviso de orçamento por pagar (carrinho e conta) */
.orcamento-aviso {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 14px 18px;
  border-radius: 14px;
  background: #fdecea;
  border: 1px solid #f5b5b0;
  color: #9b1c14;
  font-weight: 600;
  text-decoration: none;
}
.orcamento-aviso:hover { background: #fbdcd8; }
.orcamento-aviso-icone {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.orcamento-aviso-texto { flex: 1 1 220px; }
.orcamento-aviso-acao { white-space: nowrap; text-decoration: underline; }

/* Seletor de língua */
.lang-select select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line, #e5e7eb);
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-select.compacto { display: inline-flex; align-items: center; }
.drawer-lang .lang-select select { width: 100%; font-size: 0.95rem; padding: 10px 12px; border-radius: 12px; }
@media (max-width: 1023px) { .header-actions .lang-select.compacto { display: none; } }

/* Traduções mais compridas (EN/ES/FR): a barra de categorias e o botão do topo cabem na mesma */
.catbar-service { white-space: nowrap; }
@media (max-width: 499px) {
  html:not([lang="pt-PT"]) .header-cta { padding: 9px; gap: 0; }
  html:not([lang="pt-PT"]) .header-cta .cta-label { display: none; }
}
/* Níveis da barra de categorias (ver ajustarCatbar em js/layout.js) */
.catbar-inner { justify-content: center; }
.catbar-spacer { flex: 0 0 1px; align-self: center; height: 20px; background: var(--border); margin: 0 var(--s2); }
.catbar-inner.sem-icones .catbar-link .ico, .catbar-inner.sem-icones .catbar-link svg, .catbar-inner.sem-icones .catbar-service svg { display: none; }
.catbar-inner.compacta { gap: 0; }
.catbar-inner.compacta .catbar-link, .catbar-inner.compacta .catbar-service { padding: 6px 8px; font-size: 0.8rem; }
.catbar-inner.quebra { flex-wrap: wrap; height: auto; min-height: 52px; padding-top: 4px; padding-bottom: 4px; }

/* Conversa dos pedidos de assistência: anexos */
.conv-anexos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.conv-anexo {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(127,127,127,.35);
  background: rgba(127,127,127,.12); color: inherit; font: inherit; font-size: .82rem; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-anexo small { opacity: .7; }
.conv-escolhidos { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.conv-escolhidos:empty { display: none; }
.conv-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 5px 8px 5px 10px; border-radius: 999px; background: rgba(127,127,127,.15); font-size: .8rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-chip button { border: 0; background: none; color: inherit; font-size: 1rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.conv-clip {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid rgba(127,127,127,.35);
  cursor: pointer; font-size: 1.1rem;
}
.dxb-compose input[type="text"] { min-width: 0; }

/* Janela de pagamento (Stripe) */
.pay-modal-fundo {
  position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.pay-modal {
  width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface, #fff); color: var(--ink, #111); border-radius: 18px; padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.pay-modal-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pay-modal-topo h2 { margin: 0; font-size: 1.25rem; }
.pay-fechar { border: 0; background: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: inherit; padding: 4px 8px; }
.pay-total { margin: 0 0 16px; color: var(--ink-3, #555); }
.pay-erro { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #fdecea; color: #9b1c14; font-size: .9rem; }
.pay-botao { margin-top: 16px; min-height: 48px; }
.pay-nota { margin: 12px 0 0; font-size: .78rem; color: var(--ink-4, #777); text-align: center; }
@media (max-width: 520px) {
  .pay-modal-fundo { padding: 0; align-items: flex-end; }
  .pay-modal { max-width: none; max-height: 92vh; border-radius: 18px 18px 0 0; }
}

.conv-fechado { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: rgba(34,197,94,.10); border: 1px solid rgba(34,197,94,.35); }

/* Telefone com indicativo (js/telefone.js) */
.tel-wrap { display: flex; gap: 8px; width: 100%; align-items: stretch; }
.tel-wrap > input { flex: 1 1 auto; min-width: 0; }
.tel-ind {
  position: relative; flex: 0 0 auto; display: flex; align-items: center;
  width: auto !important; min-width: 0; padding: 0 14px !important; white-space: nowrap; cursor: pointer;
  font-size: var(--fs-base); color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
}
.tel-ind span { font-weight: 600; font-size: .92em; pointer-events: none; }
.tel-ind select {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
  padding: 0; border: 0; font-size: 16px; /* 16px: o iPhone não faz zoom */
}
.tel-ind:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

/* == Chat flutuante (js/chat.js) — estilo Messenger ===================== */
.chat-flutuante[hidden] { display: none; }
.chat-bolha {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 85;
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; box-shadow: 0 10px 28px rgba(226,10,3,.35), 0 2px 6px rgba(0,0,0,.15);
  transition: transform var(--t-fast), background var(--t-fast);
}
.chat-bolha:hover { transform: scale(1.06); }
.chat-bolha:active { transform: scale(.96); }
.chat-bolha.aberta { background: var(--ink); box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.chat-bolha-icone { display: flex; }
.chat-bolha-num {
  position: absolute; top: -3px; right: -3px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: #111; color: #fff; border: 2px solid #fff;
  font-size: .74rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.chat-bolha-num[hidden] { display: none; }

.chat-painel {
  position: fixed; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 86;
  width: 380px; height: min(600px, calc(100vh - 120px)); max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.22);
  animation: chat-entrar .18s var(--ease-out, ease-out);
}
.chat-painel[hidden] { display: none; }
@keyframes chat-entrar { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.chat-topo { display: flex; align-items: center; gap: 6px; padding: 12px 10px 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.chat-topo-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-topo-txt strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-topo-txt span { font-size: .76rem; color: var(--ink-3, #6b7280); }
.chat-topo-btn {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700;
  color: var(--ink-2); cursor: pointer; text-decoration: none;
}
.chat-topo-btn:hover { background: var(--surface-2); color: var(--brand); }

.chat-fio { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2, #f6f7f9); overscroll-behavior: contain; }
.chat-msg { max-width: 82%; padding: 9px 12px; border-radius: 18px; font-size: .92rem; line-height: 1.4; display: flex; flex-direction: column; gap: 4px; word-wrap: break-word; }
.chat-msg.loja { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.chat-msg.eu { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.chat-txt { white-space: pre-wrap; }
.chat-hora { font-size: .68rem; opacity: .65; align-self: flex-end; }
.chat-anexo { align-self: flex-start; border: 1px solid rgba(127,127,127,.35); background: rgba(255,255,255,.15); color: inherit; border-radius: 10px; padding: 5px 9px; font-size: .8rem; cursor: pointer; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-vazio { margin: auto 0; text-align: center; color: var(--ink-3, #6b7280); font-size: .88rem; padding: 12px; }

.chat-escolhidos { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px; }
.chat-escolhidos:not(:empty) { padding-top: 8px; }
.chat-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; background: var(--surface-2); border-radius: 10px; padding: 4px 8px; max-width: 100%; }
.chat-chip button { border: 0; background: none; cursor: pointer; font-size: 1rem; line-height: 1; color: inherit; }
.chat-compor { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--surface); }
.chat-compor textarea {
  flex: 1; min-width: 0; resize: none; max-height: 120px; min-height: 40px; padding: 9px 14px;
  border-radius: 20px; border: 1px solid var(--border-strong); font: inherit; font-size: 16px; line-height: 1.35; background: var(--surface-2, #f6f7f9);
}
.chat-clip, .chat-enviar {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 0; font-size: 1.1rem;
}
.chat-clip { background: var(--surface-2); }
.chat-enviar { background: var(--brand); color: #fff; }
.chat-enviar:disabled { opacity: .5; cursor: default; }
.chat-fechado { padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); font-size: .88rem; }
.chat-fechado a { color: var(--brand); font-weight: 700; }

.chat-lista { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.chat-lista-item { position: relative; text-align: left; border: 0; background: transparent; border-radius: 14px; padding: 12px 34px 12px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; color: inherit; font: inherit; }
.chat-lista-item:hover { background: var(--surface-2); }
.chat-lista-titulo { font-weight: 650; font-size: .92rem; }
.chat-lista-item.novo .chat-lista-titulo { font-weight: 800; }
.chat-lista-meta { font-size: .76rem; color: var(--ink-3, #6b7280); }
.chat-ponto { position: absolute; right: 14px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--brand); }
.chat-novo { margin: 8px 12px; text-align: center; font-weight: 700; color: var(--brand); font-size: .9rem; text-decoration: none; }

.chat-fundo { display: none; }
.chat-link-pagar { display: inline-block; margin: 4px 0; padding: 8px 14px; border-radius: 999px; background: var(--brand); color: #fff !important; font-weight: 700; text-decoration: none; }
.chat-txt a:not(.chat-link-pagar) { color: inherit; text-decoration: underline; word-break: break-all; }

/* Telemóvel: a conversa sobe de baixo (como no Messenger) e deixa o topo da página
   visível por trás, escurecido; tocar nesse fundo minimiza a conversa. */
@media (max-width: 599px) {
  .chat-fundo:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 119; background: rgba(0,0,0,.35); animation: chat-fundo .2s ease-out; }
  .chat-painel {
    left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none;
    height: min(82vh, 640px); height: min(82dvh, 640px);
    border-radius: 22px 22px 0 0; border: 0; z-index: 120;
    animation: chat-subir .22s var(--ease-out, ease-out);
  }
  .chat-painel::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--border-strong); }
  html.chat-ecra-cheio .chat-bolha { display: none; }
  html.chat-ecra-cheio, html.chat-ecra-cheio body { overflow: hidden; }
}
@keyframes chat-subir { from { transform: translateY(100%); } to { transform: none; } }
@keyframes chat-fundo { from { opacity: 0; } to { opacity: 1; } }
@media print { .chat-flutuante { display: none; } }

/* Subcategorias no topo da página de categoria */
.subcat-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 2px; margin-top: 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.subcat-chips::-webkit-scrollbar { display: none; }
.subcat-chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: .88rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; text-decoration: none; }
.subcat-chip:hover { border-color: var(--brand); color: var(--brand); }
.subcat-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* "Reparação de Telemóveis" em destaque: azul com texto branco (barra do computador e menu do telemóvel) */
:root { --azul-reparacao: #0a3cff; --azul-reparacao-escuro: #002bd1; }
.catbar-service.destaque-reparacao,
.mobile-link.destaque-reparacao {
  background: var(--azul-reparacao) !important; color: #fff !important; font-weight: 700;
  border-radius: 999px; box-shadow: 0 4px 12px rgba(10,60,255,.25);
}
.catbar-service.destaque-reparacao { padding: 7px 14px !important; }
.catbar-service.destaque-reparacao svg, .mobile-link.destaque-reparacao svg { color: #fff; stroke: currentColor; }
.catbar-service.destaque-reparacao:hover, .mobile-link.destaque-reparacao:hover,
.catbar-service.destaque-reparacao.active, .mobile-link.destaque-reparacao.active { background: var(--azul-reparacao-escuro) !important; color: #fff !important; }
/* Menu do telemóvel: faixa azul retangular a toda a largura, no lugar da linha
   (entre "Página Inicial" e "Ajuda Técnica Online"). */
.mobile-nav .menu-row.menu-row-destaque { padding: 0; border-bottom: 0; margin: 0 calc(var(--s5) * -1); }
.mobile-nav .menu-row-destaque a.mobile-link.destaque-reparacao {
  display: flex !important; align-items: center; gap: 10px; width: 100%;
  padding: 15px var(--s5) !important; margin: 0; border-radius: 0; box-shadow: none;
}
.mobile-nav .menu-row-destaque a.mobile-link.destaque-reparacao::after { border-color: #fff; }
/* Mesmo com os ícones escondidos na barra (ecrãs médios), a chave inglesa fica neste botão. */
.catbar-inner.sem-icones .catbar-service.destaque-reparacao svg { display: inline-block; }

/* Páginas legais traduzidas: aviso de que vale a versão portuguesa */
.legal-nota-traducao { background: var(--surface-2, #f5f5f7); border-left: 3px solid var(--brand); padding: 10px 14px; border-radius: 8px; font-size: .88rem; color: var(--ink-2); }
.legal-page[hidden] { display: none !important; }

/* Fotografias dos produtos (Medusa → produto → Thumbnail). Quadradas, sem cortar. */
.product-photo { width: 100%; height: 100%; object-fit: contain; padding: 8%; background: #fff; }
.product-image { overflow: hidden; }
.product-image .product-photo { padding: 6%; border-radius: inherit; }

/* Chat: abas "Em aberto" / "Concluídos" */
.chat-abas { display: flex; gap: 6px; padding: 10px 12px 4px; border-bottom: 1px solid var(--border); }
.chat-aba { position: relative; flex: 1; border: 0; background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 8px 10px; font: inherit; font-size: .86rem; font-weight: 700; cursor: pointer; margin-bottom: 8px; }
.chat-aba.ativa { background: var(--ink); color: #fff; }
.chat-aba-num { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: rgba(127,127,127,.25); font-size: .74rem; }
.chat-aba.ativa .chat-aba-num { background: rgba(255,255,255,.22); }
.chat-ponto-aba { position: absolute; top: 4px; right: 8px; margin: 0; width: 8px; height: 8px; }
.chat-novo-txt { color: var(--brand); }

/* Conta → Assistências: solução dos pedidos concluídos */
.acc-solucao { background: #effaf3; border: 1px solid #bfe8cd; border-radius: 14px; padding: 14px 16px; margin: 0 0 16px; }
.acc-solucao-titulo { font-weight: 700; font-size: .85rem; color: #17733a; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .03em; }
.acc-solucao p { margin: 0; color: var(--dx-ink, #1a1a1a); white-space: pre-wrap; line-height: 1.5; }

/* Cartões de produto estreitos (2 colunas no telemóvel): preço em cima e
   botão a toda a largura por baixo, para o "Adicionar" nunca ficar cortado. */
.product-card { container-type: inline-size; }
@container (max-width: 230px) {
  .product-card .row { flex-direction: column; align-items: stretch; gap: var(--s2); }
  .product-card .add-btn { width: 100%; padding: 10px var(--s3); }
  /* Espaço para o preço riscado: os botões ficam todos à mesma altura. */
  .product-card .price-block { min-height: 2.7em; justify-content: flex-end; }
}
/* Botão do resumo da reparação: em ecrãs muito estreitos o texto quebra linha em vez de ser cortado. */
#add-to-cart-btn { white-space: normal; line-height: 1.25; height: auto; min-height: 48px; }

/* Banners com fotografia (o texto fica igual; a foto é só fundo).
   Computador: foto larga com espaço vazio à esquerda para o texto.
   Telemóvel: foto vertical com o texto em cima e o objeto em baixo; por cima da
   foto continua o degradê do topo da imagem (sem "degrau" visível).
   Para um banner novo: classe "slide-foto" + as 4 variáveis abaixo. */
.carousel-slide.slide-foto {
  /* --veu (opcional): escurece o lado do texto quando a foto tem algo por trás dele. */
  background: var(--veu, none), var(--foto-pc) right center / cover no-repeat var(--cor-base);
}
.carousel-slide.slide-foto::after { display: none; }
.carousel-slide.slide-foto .hero-inner > div { max-width: 560px; }
@media (max-width: 767px) {
  .carousel-slide.slide-foto {
    background: var(--foto-tel) center bottom / 100% auto no-repeat, var(--topo-tel);
    padding-bottom: 78vw;
  }
}
.slide-1.slide-foto {
  --cor-base: #07090e;
  --foto-pc: image-set(url("../img/banners/reparacao-desktop.webp") type("image/webp"), url("../img/banners/reparacao-desktop.jpg") type("image/jpeg"));
  --foto-tel: image-set(url("../img/banners/reparacao-mobile.webp") type("image/webp"), url("../img/banners/reparacao-mobile.jpg") type("image/jpeg"));
  --topo-tel: linear-gradient(90deg, rgb(15,18,25) 0%, rgb(47,53,64) 50%, rgb(57,63,75) 100%);
}
.slide-2.slide-foto {
  --cor-base: #930101;
  --foto-pc: image-set(url("../img/banners/apoio-desktop.webp") type("image/webp"), url("../img/banners/apoio-desktop.jpg") type("image/jpeg"));
  --foto-tel: image-set(url("../img/banners/apoio-mobile.webp") type("image/webp"), url("../img/banners/apoio-mobile.jpg") type("image/jpeg"));
  --topo-tel: linear-gradient(90deg, rgb(158,2,3) 0%, rgb(190,10,9) 50%, rgb(240,32,28) 100%);
}
.slide-3.slide-foto {
  --cor-base: #0a2a5a;
  --foto-pc: image-set(url("../img/banners/protecao-desktop.webp") type("image/webp"), url("../img/banners/protecao-desktop.jpg") type("image/jpeg"));
  --foto-tel: image-set(url("../img/banners/protecao-mobile.webp") type("image/webp"), url("../img/banners/protecao-mobile.jpg") type("image/jpeg"));
  --topo-tel: linear-gradient(90deg, rgb(13,41,81) 6%, rgb(12,43,86) 17%, rgb(12,46,92) 28%, rgb(13,48,100) 39%, rgb(16,57,116) 50%, rgb(33,77,138) 61%, rgb(46,86,144) 72%, rgb(50,90,147) 83%, rgb(45,88,149) 94%);
}
.slide-4.slide-foto {
  --cor-base: #0d2e28;
  --foto-pc: image-set(url("../img/banners/comandos-desktop.webp") type("image/webp"), url("../img/banners/comandos-desktop.jpg") type("image/jpeg"));
  --foto-tel: image-set(url("../img/banners/comandos-mobile.webp") type("image/webp"), url("../img/banners/comandos-mobile.jpg") type("image/jpeg"));
  --topo-tel: linear-gradient(90deg, rgb(41,124,107) 0%, rgb(8,49,41) 50%, rgb(2,42,36) 100%);
  --veu: linear-gradient(90deg, rgba(6,30,26,.88) 0%, rgba(6,30,26,.7) 34%, rgba(6,30,26,0) 58%);
}
.slide-5.slide-foto {
  --cor-base: #3a2266;
  --foto-pc: image-set(url("../img/banners/consumiveis-desktop.webp") type("image/webp"), url("../img/banners/consumiveis-desktop.jpg") type("image/jpeg"));
  --foto-tel: image-set(url("../img/banners/consumiveis-mobile.webp") type("image/webp"), url("../img/banners/consumiveis-mobile.jpg") type("image/jpeg"));
  --topo-tel: linear-gradient(rgb(84,53,131), rgb(84,53,131));
}
.slide-4.slide-foto .hero-inner > div { max-width: 470px; }
@media (max-width: 767px) { .slide-4.slide-foto .hero-inner > div { max-width: none; } }

/* == 17 · Modo "só assistência" (js/modo.js) =============================== */
/* Cabeçalho sem loja: três ligações de texto no computador e o botão "Pedir
   ajuda" sempre com o texto (há espaço: não há favoritos nem carrinho). */
.header-nav { display: none; }
@media (min-width: 1024px) {
  .header-nav { display: flex; align-items: center; gap: var(--s1); margin-left: var(--s6); }
  .header-nav a {
    padding: var(--s2) var(--s3);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
    transition: background var(--t-fast), color var(--t-fast);
  }
  .header-nav a:hover, .header-nav a.active { background: var(--surface-2); color: var(--brand); }
}
@media (max-width: 419px) {
  .site-header.so-assistencia .header-cta { padding: 8px var(--s3); gap: 5px; }
  .site-header.so-assistencia .header-cta .cta-label { display: inline; }
}
/* Rodapé com três colunas (sem a coluna da loja). */
@media (min-width: 980px) { .footer-inner.tres-colunas { grid-template-columns: 1.6fr 1fr 1fr; } }
