:root {
  --navy: #102f4a;
  --navy-2: #174a6c;
  --purple: #6f3c84;
  --purple-soft: #eee3f1;
  --gold: #c59a55;
  --cream: #f6f1e9;
  --paper: #fffdf9;
  --ink: #18303f;
  --muted: #677985;
  --line: #dfd8ce;
  --green: #15805c;
  --red: #a34444;
  --shadow: 0 18px 50px rgba(16, 47, 74, .13);
  --radius: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; min-width: 320px; background: var(--cream); color: var(--ink); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .8rem 1rem; background: #fff; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; padding: 10px clamp(16px, 4vw, 56px);
  background: rgba(246, 241, 233, .9); border-bottom: 1px solid rgba(16, 47, 74, .08);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: #fff; font: 800 1.35rem Georgia, serif; background: linear-gradient(145deg, var(--purple), var(--navy)); box-shadow: 0 8px 20px rgba(111, 60, 132, .25); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .98rem; letter-spacing: .02em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: .69rem; }
.install-button { border: 0; border-radius: 999px; padding: .72rem 1rem; color: #fff; background: var(--navy); font-weight: 750; cursor: pointer; }

main { padding-bottom: 86px; }
.hero { position: relative; isolation: isolate; display: grid; min-height: 580px; overflow: hidden; background: var(--navy); color: #fff; }
.hero::before { content: ""; position: absolute; inset: -30% -20% auto auto; z-index: -2; width: 70vw; height: 70vw; border-radius: 50%; background: radial-gradient(circle, rgba(197,154,85,.27), transparent 63%); }
.hero::after { content: ""; position: absolute; inset: auto auto -40% -25%; z-index: -2; width: 70vw; height: 70vw; border-radius: 50%; background: radial-gradient(circle, rgba(111,60,132,.38), transparent 65%); }
.hero-copy { align-self: center; padding: 54px 22px 320px; }
.eyebrow { display: inline-block; color: var(--gold); font-size: .75rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { max-width: 760px; margin: 16px 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.45rem, 10vw, 5.4rem); line-height: .98; letter-spacing: -.045em; }
.hero h1 em { color: #dcb6e4; font-weight: 400; }
.hero-copy > p { max-width: 590px; margin: 0; color: #dce8ed; font-size: clamp(1rem, 2vw, 1.18rem); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: .85rem 1.15rem; border: 1px solid transparent; border-radius: 14px; font-weight: 800; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--purple); color: #fff; box-shadow: 0 12px 30px rgba(111,60,132,.25); }
.button.secondary { background: #fff; color: var(--navy); border-color: rgba(16,47,74,.16); }
.hero .button.primary { background: #fff; color: var(--navy); }
.hero .button.secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.button.whatsapp { background: #1b9a69; color: #fff; }
.hero-visual { position: absolute; right: -12px; bottom: -94px; width: min(75vw, 380px); }
.hero-visual img { width: 100%; filter: drop-shadow(0 24px 40px rgba(0,0,0,.35)); }
.speech { position: absolute; z-index: 2; top: 10%; right: 4%; width: min(220px, 65vw); padding: 14px 16px; border-radius: 20px 20px 4px 20px; background: #fff; color: var(--navy); font-size: .86rem; font-weight: 750; box-shadow: var(--shadow); }

.catalog-section { max-width: 1280px; margin: 0 auto; padding: 56px 16px 36px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2, .help-strip h2 { margin: 5px 0 0; font-family: Georgia, serif; color: var(--navy); font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1; letter-spacing: -.03em; }
.section-heading p { margin: 0; color: var(--muted); font-size: .82rem; font-weight: 700; }
.search-panel { position: sticky; top: 72px; z-index: 30; margin-bottom: 24px; padding: 12px; border: 1px solid rgba(16,47,74,.08); border-radius: 20px; background: rgba(246,241,233,.95); backdrop-filter: blur(14px); }
.search-box { display: flex; align-items: center; gap: 9px; height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 6px 22px rgba(16,47,74,.06); }
.search-box > span { color: var(--purple); font-size: 1.65rem; line-height: 1; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 1rem; }
.search-box input::placeholder { color: #86939b; }
.search-box button { border: 0; background: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--navy); font-size: .82rem; font-weight: 750; cursor: pointer; }
.filter-chip.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.secondary-filters .filter-chip { padding: .5rem .75rem; font-size: .76rem; }
.active-view { margin: 0 0 16px; padding: 11px 14px; border-radius: 14px; background: var(--purple-soft); color: var(--purple); font-size: .86rem; font-weight: 800; }

.materials-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.material-card { position: relative; overflow: hidden; min-width: 0; border: 1px solid rgba(16,47,74,.08); border-radius: 20px; background: var(--paper); box-shadow: 0 10px 30px rgba(16,47,74,.08); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.material-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.material-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-image { position: relative; aspect-ratio: 1.06; overflow: hidden; background: #ddd; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.material-card:hover .card-image img { transform: scale(1.025); }
.card-badge { position: absolute; left: 10px; top: 10px; padding: .38rem .58rem; border-radius: 999px; color: #fff; background: rgba(16,47,74,.84); backdrop-filter: blur(5px); font-size: .66rem; font-weight: 850; }
.card-quick-actions { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; }
.card-quick-actions button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--navy); font-size: 1.14rem; box-shadow: 0 5px 14px rgba(0,0,0,.12); cursor: pointer; }
.card-quick-actions button.selected { background: var(--purple); color: #fff; }
.card-body { padding: 13px; }
.card-body h3 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 1.13rem; line-height: 1.1; }
.card-colors { margin: 5px 0 10px; color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-tags { display: flex; gap: 5px; overflow: hidden; }
.mini-tags span { flex: 0 0 auto; padding: .35rem .48rem; border-radius: 8px; background: #f0ece5; color: #536875; font-size: .62rem; font-weight: 750; }

.empty-state { padding: 50px 20px; text-align: center; border: 1px dashed #cfc5b9; border-radius: var(--radius); background: rgba(255,255,255,.4); }
.empty-state > div { font-size: 2.8rem; }
.empty-state h3 { margin: 10px 0 5px; font-family: Georgia, serif; font-size: 1.6rem; }
.empty-state p { margin: 0 0 18px; color: var(--muted); }

.help-strip { display: grid; gap: 24px; max-width: 1248px; margin: 20px 16px 38px; padding: 28px 24px; border-radius: 28px; background: linear-gradient(130deg, #fff, #eee4f1); box-shadow: var(--shadow); }
.help-strip p { max-width: 700px; margin: 12px 0 0; color: var(--muted); line-height: 1.6; }
.help-strip .button { align-self: center; }

.bottom-nav { position: fixed; z-index: 60; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); min-height: 64px; padding: 6px; border: 1px solid rgba(16,47,74,.12); border-radius: 22px; background: rgba(255,253,249,.95); box-shadow: 0 16px 44px rgba(16,47,74,.22); backdrop-filter: blur(18px); }
.bottom-nav button, .bottom-nav a { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; border: 0; border-radius: 16px; background: transparent; color: #657784; font-size: .61rem; font-weight: 800; cursor: pointer; }
.bottom-nav span { font-size: 1.25rem; line-height: 1; }
.bottom-nav .active { background: #ece5f0; color: var(--purple); }

dialog { padding: 0; border: 0; background: transparent; }
dialog::backdrop { background: rgba(8,24,35,.72); backdrop-filter: blur(6px); }
.material-dialog { width: min(720px, calc(100% - 16px)); max-height: calc(100dvh - 20px); border-radius: 26px; }
.detail-card { position: relative; overflow: auto; max-height: calc(100dvh - 20px); border-radius: 26px; background: var(--paper); }
.dialog-close { position: absolute; z-index: 5; right: 12px; top: 12px; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255,255,255,.94); color: var(--navy); font-size: 1.65rem; cursor: pointer; box-shadow: 0 5px 16px rgba(0,0,0,.12); }
.detail-image { position: relative; aspect-ratio: 1.4; overflow: hidden; background: #ddd; }
.detail-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-image span { position: absolute; left: 16px; bottom: 16px; padding: .5rem .7rem; border-radius: 999px; background: rgba(16,47,74,.88); color: #fff; font-size: .75rem; font-weight: 850; }
.detail-content { padding: 20px; }
.detail-title-row { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.detail-title-row p { margin: 0 0 4px; color: var(--muted); font-size: .75rem; }
.detail-title-row h2 { margin: 0; font-family: Georgia, serif; color: var(--navy); font-size: clamp(2rem, 8vw, 3rem); line-height: 1; }
.icon-action { flex: 0 0 auto; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--purple); font-size: 1.5rem; cursor: pointer; }
.icon-action.selected { background: var(--purple); color: #fff; }
.tech-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 22px 0; }
.tech-item { padding: 13px; border-radius: 14px; background: #f1ede6; }
.tech-item small, .tech-item strong { display: block; }
.tech-item small { margin-bottom: 4px; color: var(--muted); font-size: .66rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.tech-item strong { color: var(--navy); font-size: .89rem; }
.detail-section { margin-top: 22px; }
.detail-section h3 { margin: 0 0 10px; color: var(--navy); font-family: Georgia, serif; font-size: 1.22rem; }
.detail-section ul { margin: 0; padding-left: 20px; color: #4f626e; line-height: 1.65; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-list span { padding: .55rem .7rem; border-radius: 10px; background: var(--purple-soft); color: var(--purple); font-size: .75rem; font-weight: 800; }
.pedrita-explains { display: grid; grid-template-columns: 82px 1fr; align-items: end; gap: 10px; margin-top: 24px; padding: 16px 16px 0; overflow: hidden; border-radius: 20px; background: linear-gradient(140deg, var(--navy), #214f69); color: #fff; }
.pedrita-explains img { align-self: end; max-height: 112px; object-fit: contain; object-position: bottom; }
.pedrita-explains div { align-self: center; padding-bottom: 16px; }
.pedrita-explains strong { color: #efca90; }
.pedrita-explains p { margin: 5px 0 0; color: #e3edf1; font-size: .85rem; line-height: 1.5; }
.image-note { margin: 13px 0; color: var(--muted); font-size: .66rem; line-height: 1.45; }
.detail-actions { display: grid; gap: 9px; margin-top: 18px; }
.text-action { padding: .72rem; border: 0; background: transparent; color: var(--purple); font-weight: 800; cursor: pointer; }
.text-action.danger { color: var(--red); }

.info-dialog { width: min(430px, calc(100% - 28px)); border-radius: 24px; }
.info-card { position: relative; padding: 32px 24px 24px; border-radius: 24px; background: var(--paper); text-align: center; box-shadow: var(--shadow); }
.info-card .dialog-close { right: 10px; top: 10px; }
.info-icon { display: grid; place-items: center; width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 22px; background: var(--purple-soft); color: var(--purple); font-size: 2rem; }
.info-card h2 { margin: 0; font-family: Georgia, serif; color: var(--navy); font-size: 2rem; }
.info-card p { margin: 12px 0 22px; color: var(--muted); line-height: 1.6; }
.info-card .button { width: 100%; }
.info-card .text-action { margin-top: 8px; }
.offline-toast { position: fixed; z-index: 80; left: 16px; right: 16px; bottom: 92px; padding: 12px 15px; border-radius: 14px; background: #182c38; color: #fff; text-align: center; font-size: .78rem; box-shadow: var(--shadow); }

@media (min-width: 680px) {
  .hero { min-height: 640px; }
  .hero-copy { padding: 80px 44% 80px clamp(36px, 7vw, 110px); }
  .hero-visual { right: 2%; bottom: -130px; width: min(43vw, 520px); }
  .speech { top: 18%; right: 12%; }
  .catalog-section { padding-inline: 28px; }
  .materials-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .help-strip { grid-template-columns: 1fr auto; margin-inline: 28px; padding: 34px; }
  .bottom-nav { left: 50%; right: auto; width: min(560px, calc(100% - 24px)); transform: translateX(-50%); }
}

@media (min-width: 1040px) {
  main { padding-bottom: 36px; }
  .hero { min-height: 680px; }
  .materials-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .search-panel { display: grid; grid-template-columns: minmax(280px, 1.1fr) 1.6fr; gap: 10px; align-items: center; }
  .search-panel .filter-row { margin-top: 0; }
  .secondary-filters { grid-column: 1 / -1; }
  .help-strip { margin-inline: auto; }
  .bottom-nav { position: static; width: 560px; margin: 26px auto; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
