:root {
  --bg: #f3f4f6;
  --card: #fff;
  --text: #111318;
  --muted: #69707b;
  --line: #e2e5e9;
  --dark: #0f1115;
  --accent: #e88b2c;
  --danger: #a52834;
  --shadow: 0 12px 34px rgba(17, 19, 24, .09);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}
body.landing-mode {
  overflow: hidden;
  padding-bottom: 0;
  background: #100012;
}
body.modal-open { overflow: hidden; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(232, 139, 44, .35);
  outline-offset: 2px;
}

.landing {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: start center;
  overflow: hidden auto;
  background: #100012;
}
.landing-frame {
  position: relative;
  width: min(100vw, calc(100vh * 1069 / 1471));
  aspect-ratio: 1069 / 1471;
  flex: 0 0 auto;
  background: #100012;
}
.landing-frame picture { display: contents; }
.landing-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.landing-hotspot {
  position: absolute;
  display: block;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(8, 184, 203, .2);
}
.landing-hotspot:focus-visible {
  outline: 3px solid #20d5e4;
  outline-offset: 3px;
  background: rgba(8, 184, 203, .08);
}
.hotspot-lgi { left: 22%; top: 13%; width: 58%; height: 17%; }
.hotspot-tiffany { left: 13%; top: 45%; width: 36%; height: 13%; }
.hotspot-union { left: 50%; top: 45%; width: 39%; height: 13%; }
.hotspot-paul { left: 13%; top: 58%; width: 36%; height: 13%; }
.hotspot-embo { left: 51%; top: 58%; width: 38%; height: 13%; }
.hotspot-enter { left: 22%; top: 75%; width: 57%; height: 11%; }
.landing-install {
  position: absolute;
  left: 27%;
  top: 86.5%;
  z-index: 5;
  width: 46%;
  min-height: 4.8%;
  border: 1px solid rgba(121, 239, 247, .85);
  border-radius: 999px;
  background: linear-gradient(180deg, #08b8cf, #0094ad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 176, 201, .28);
  font-size: clamp(10px, 1.35vw, 15px);
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1;
  text-transform: uppercase;
}
.landing-install:hover { filter: brightness(1.08); }
.landing-install:focus-visible { outline-color: #fff; }
.install-help {
  position: absolute;
  left: 12%;
  top: 79.5%;
  z-index: 8;
  width: 76%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(121, 239, 247, .55);
  border-radius: 14px;
  background: rgba(12, 2, 17, .94);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .42);
  font-size: clamp(11px, 1.35vw, 14px);
  line-height: 1.35;
  text-align: center;
}
.landing-caption {
  position: absolute;
  left: 12%;
  top: 92.5%;
  z-index: 2;
  width: 76%;
  height: 5.5%;
  margin: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, #170218 0 48%, rgba(23, 2, 24, .97) 68%, transparent 100%);
  color: #fff;
  font-size: clamp(10px, 1.7vw, 18px);
  font-weight: 400;
  letter-spacing: .1em;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
  white-space: nowrap;
  pointer-events: none;
}
.catalog-app[hidden], .landing[hidden] { display: none; }

.offline-banner {
  position: sticky;
  top: 0;
  z-index: 80;
  padding: 8px 16px;
  background: #fff1c2;
  color: #58460b;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topin {
  max-width: 1200px;
  margin: auto;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brandmark { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.company-logo { display: block; width: auto; height: 50px; border-radius: 8px; }
.status { color: var(--muted); font-size: 10px; }
.status { text-align: right; }

main { max-width: 1200px; margin: auto; padding: 20px 18px; }
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #101318, #303641);
  color: #fff;
  border-radius: 26px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -80px;
  top: -105px;
  border: 44px solid rgba(255,255,255,.05);
  border-radius: 50%;
}
.hero-copy, .search-wrap, .install { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 7px; color: #f1a14f !important; font-size: 10px !important; font-weight: 800; letter-spacing: .15em; }
.hero h1 { margin: 0 0 8px; font-size: clamp(28px, 5vw, 36px); line-height: 1; }
.hero p { margin: 0; color: #d4d7dc; font-size: 13px; }
.install {
  position: absolute;
  right: 24px;
  top: 24px;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 999px;
  padding: 9px 13px;
}
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
  padding: 0 14px;
  background: #fff;
  color: #616873;
  border-radius: 15px;
}
.search { width: 100%; padding: 14px 0; border: 0; outline: 0; background: transparent; }
.search-status { margin: 14px 2px 4px; color: var(--muted); font-size: 12px; }

.brands { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.brand {
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.brand::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: #bbb; }
.brand[data-key="union-pacific"]::before { background: #e88b2c; }
.brand[data-key="tiffany"]::before { background: #31b7ba; }
.brand[data-key="paul-riviere"]::before { background: #bd9c5d; }
.brand[data-key="embo"]::before { background: #5d6470; }
.brand.active { box-shadow: var(--shadow); transform: translateY(-2px); }
.brand b, .brand span { display: block; }
.brand span { margin-top: 3px; font-size: 11px; color: var(--muted); }

.tools { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin: 12px 0 14px; }
.tabs { display: flex; gap: 8px; overflow: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab, .pill, .sheetactions button, .order-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  white-space: nowrap;
}
.tab.active { background: var(--dark); color: #fff; border-color: var(--dark); }
.pill.active { background: #fff0f2; color: #9a1f2e; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 26px rgba(0,0,0,.045);
}
.card-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.img { aspect-ratio: 1000/1300; overflow: hidden; background: #f7f7f8; }
.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info { padding: 12px; }
.info b { font-size: 14px; }
.info span { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.heart {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  font-size: 20px;
  box-shadow: 0 5px 16px rgba(0,0,0,.13);
}
.empty, .error { grid-column: 1/-1; background: #fff; padding: 28px; border-radius: 18px; color: var(--muted); }
.error { color: var(--danger); }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0,0,0,.62);
  display: none;
  padding: 18px;
  overflow: auto;
}
.overlay.show { display: block; }
.sheet { max-width: 1050px; margin: auto; background: var(--bg); border-radius: 24px; min-height: 70vh; overflow: hidden; }
.sheethead {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(243,244,246,.95);
  backdrop-filter: blur(12px);
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.sheethead h2 { margin: 0; }
.sheethead small { color: var(--muted); }
.sheetactions { display: flex; gap: 8px; }
.sheetactions button { border-radius: 12px; padding: 10px; }
.variants { display: grid; grid-template-columns: 1fr; gap: 18px; padding: 18px; max-width: 760px; margin: 0 auto; }
.variant { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; width: 100%; }
.variant img { width: 100%; display: block; }
.vf { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px; }
.vf b { font-size: 13px; }
.variant-actions { display: flex; gap: 6px; }
.primary {
  border: 0 !important;
  background: var(--dark) !important;
  color: #fff !important;
  border-radius: 10px !important;
  padding: 9px 11px !important;
}
.order-sheet { max-width: 820px; }
.order-body { padding: 16px; }
.order-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px;
  margin-bottom: 9px;
}
.order-item img { width: 70px; height: 90px; object-fit: cover; border-radius: 9px; }
.order-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.qty { display: flex; gap: 7px; align-items: center; margin-top: 8px; }
.qty button, .remove { border: 1px solid var(--line); background: #fff; border-radius: 8px; min-width: 30px; min-height: 30px; }
.remove { border: 0; background: transparent; font-size: 18px; }
.field-label { display: block; margin: 18px 0 6px; font-weight: 700; }
.customer-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.customer-field { display: grid; gap: 6px; font-weight: 700; }
.customer-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font-weight: 400;
}
textarea { width: 100%; min-height: 100px; resize: vertical; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; }
.order-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.whatsapp { background: #16864b !important; }

.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 35;
  display: flex;
  justify-content: space-around;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.nav { border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 74px; font-size: 19px; }
.nav span { font-size: 10px; }
.nav.active { color: #111; font-weight: 800; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + env(safe-area-inset-bottom));
  z-index: 90;
  transform: translateX(-50%);
  background: #111318;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  font-size: 12px;
}

@media (max-width: 1199px) and (min-width: 768px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status { display: none; }
}
@media (max-width: 767px) and (orientation: portrait) {
  .landing-frame {
    width: 100vw;
    height: 100svh;
    aspect-ratio: auto;
  }
  .landing-art { object-fit: cover; }
  .hotspot-lgi { left: 12%; top: 17%; width: 76%; height: 13%; }
  .hotspot-tiffany { left: 5%; top: 45%; width: 44%; height: 10%; }
  .hotspot-union { left: 50%; top: 45%; width: 46%; height: 10%; }
  .hotspot-paul { left: 5%; top: 56%; width: 44%; height: 11%; }
  .hotspot-embo { left: 51%; top: 56%; width: 43%; height: 11%; }
  .hotspot-enter { left: 13%; top: 72%; width: 74%; height: 10%; }
  .landing-install { left: 21%; top: 88%; width: 58%; min-height: 5.5%; font-size: clamp(10px, 3.3vw, 14px); }
  .install-help { left: 7%; top: 79.5%; width: 86%; font-size: 12px; }
  .landing-caption {
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
@media (max-width: 767px) {
  main { padding: 12px; }
  .topin { padding: 10px 12px; }
  .company-logo { height: 44px; }
  .hero { padding: 19px; border-radius: 22px; }
  .install { position: static; margin-top: 14px; }
  .brands { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .brand { padding: 12px 10px; border-radius: 14px; }
  .brand b { font-size: 12px; line-height: 1.1; }
  .brand span { font-size: 9px; }
  .tools { align-items: flex-start; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card { border-radius: 18px; }
  .img { aspect-ratio: auto; }
  .img img { width: 100%; height: auto; object-fit: contain; }
  .info { padding: 12px 14px 14px; }
  .info b { font-size: 16px; }
  .info span { font-size: 12px; }
  .status { display: none; }
  .overlay { padding: 0; }
  .sheet { min-height: 100vh; border-radius: 0; }
  .sheethead { align-items: flex-start; }
  .sheetactions { flex-direction: column; }
  .vf { align-items: flex-start; flex-direction: column; }
  .variant-actions { width: 100%; }
  .variant-actions button { flex: 1; }
  .customer-fields { grid-template-columns: 1fr; }
  .order-actions button { flex: 1 1 100%; min-height: 46px; }
}
@media (min-aspect-ratio: 1069/1471) {
  .landing { overflow: hidden; }
}
@media (orientation: landscape) {
  .landing-frame {
    width: min(100vw, calc(100vh * 1448 / 1086));
    aspect-ratio: 1448 / 1086;
  }
  .hotspot-lgi { left: 27%; top: 11%; width: 46%; height: 24%; }
  .hotspot-tiffany { left: 8%; top: 53%; width: 21%; height: 15%; }
  .hotspot-union { left: 31%; top: 53%; width: 21%; height: 15%; }
  .hotspot-paul { left: 53%; top: 53%; width: 20%; height: 15%; }
  .hotspot-embo { left: 74%; top: 53%; width: 18%; height: 15%; }
  .hotspot-enter { left: 28%; top: 75%; width: 44%; height: 14%; }
  .landing-install { left: 36%; top: 89.5%; width: 28%; min-height: 5%; }
  .install-help { left: 25%; top: 78%; width: 50%; }
  .landing-caption { left: 25%; top: 94.5%; width: 50%; height: 5%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
