:root {
  --bg: #08080a;
  --card: #17171b;
  --ink: #f8f8fa;
  --muted: #b7b7bf;
  --line: rgba(255,255,255,.10);
  --accent: #e30613;
  --accent-dark: #a9000a;
  --green: #39d98a;
  --green-dark: #147a4c;
  --green-soft: #dff7e9;
  --shadow: 0 18px 44px rgba(0,0,0,.35);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(227, 6, 19, .24), transparent 30%),
    var(--bg);
}
button, input { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.catalog-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 64px);
  background: rgba(8,8,10,.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.catalog-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.catalog-brand img {
  width: 52px;
  height: 52px;
  padding: 3px;
  border-radius: 15px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 8px 22px rgba(227, 6, 19, .18);
}
.catalog-brand span { display: grid; gap: 2px; }
.catalog-brand strong { font-size: 18px; }
.catalog-brand small { color: var(--muted); }
.header-link {
  color: #ff4b58;
  font-weight: 750;
  text-decoration: none;
}

main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 140px;
}
.catalog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  gap: 22px;
  align-items: end;
  margin-bottom: 26px;
}
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.catalog-hero h1 {
  margin: 8px 0 10px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(38px, 6vw, 70px);
  line-height: .98;
}
.catalog-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}
.safe-note {
  display: grid;
  gap: 7px;
  padding: 18px 20px;
  background: #17171b;
  border: 1px solid rgba(227,6,19,.38);
  border-radius: 20px;
  color: #dce5f2;
  line-height: 1.45;
}
.safe-note span { font-size: 14px; }

.catalog-tools {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(78, 58, 33, .05);
}
.search-box span { color: var(--accent); font-size: 22px; }
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}
.category-list {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 0 5px;
  scrollbar-width: thin;
}
.category-button {
  flex: 0 0 auto;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #202025;
  font-weight: 750;
}
.category-button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent-dark);
}

.status-box {
  margin: 20px 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}
.status-box:empty { display: none; }
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
}
.catalog-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  margin: 12px 12px 0;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
}
.card-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}
.stock-badge, .sale-badge {
  position: absolute;
  top: 11px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 5px 15px rgba(55, 35, 30, .08);
}
.stock-badge { left: 11px; color: var(--green-dark); background: var(--green-soft); }
.sale-badge { right: 11px; color: #fff; background: #e30613; }
.sale-badge[hidden] { display: none; }
.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 17px 18px 18px;
}
.card-category {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.card-name {
  margin: 8px 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 22px;
  line-height: 1.15;
}
.card-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.card-description:empty { display: none; }
.card-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.card-tags span {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}
.card-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: auto;
  margin-bottom: 14px;
}
.old-price { color: #9d8a81; text-decoration: line-through; font-size: 14px; }
.current-price { font-size: 25px; font-weight: 900; }
.add-button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--accent);
  font-weight: 850;
}
.add-button:hover { background: var(--accent-dark); }
.add-button.added { background: var(--accent-dark); }

.selection-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  width: min(430px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 25px 70px rgba(57, 34, 28, .26);
}
.selection-toggle {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 20px;
  border: 0;
  border-radius: 23px;
  color: #fff;
  background: var(--accent);
  font-weight: 850;
}
.selection-content {
  display: none;
  max-height: min(78vh, 760px);
  overflow-y: auto;
  padding: 20px;
}
.selection-panel.open .selection-content { display: block; }
.selection-panel.open .selection-toggle { display: none; }
.selection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.selection-head h2 { margin: 3px 0 0; font-size: 24px; }
.icon-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  background: #f6e7df;
  font-size: 25px;
}
.selection-items { display: grid; gap: 10px; }
.empty-selection {
  padding: 22px 12px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 15px;
}
.selection-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
}
.selection-item img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 11px;
  background: #fff;
}
.selection-item-info { min-width: 0; }
.selection-item-info strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selection-item-info small { color: var(--muted); }
.quantity-controls { display: flex; align-items: center; gap: 5px; }
.quantity-controls button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #202025;
  font-weight: 900;
}
.quantity-controls span { min-width: 24px; text-align: center; font-weight: 850; }
.remove-link {
  display: block;
  margin-top: 5px;
  padding: 0;
  border: 0;
  color: #a44735;
  background: none;
  font-size: 12px;
}
.selection-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px 0;
  padding: 16px;
  border-radius: 16px;
  background: #ffeaec;
  color: #4a0509;
}
.selection-total strong { color: var(--red-dark, #a9000a); font-size: 22px; }
.field { display: grid; gap: 7px; margin-bottom: 13px; }
.field label { font-size: 13px; font-weight: 800; }
.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #202025;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(227, 6, 19, .14); }
.form-help { margin: 4px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.whatsapp-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: #20b85a;
  font-weight: 900;
}
.whatsapp-button:disabled { cursor: wait; opacity: .65; }
.selection-message {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}
.selection-message.show { display: block; }
.selection-message.error { color: #8a2e20; background: #ffe5df; }
.selection-message.success { color: #146b3f; background: #e2f8eb; }
.page-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(37, 22, 18, .38);
  backdrop-filter: blur(2px);
}

@media (max-width: 800px) {
  .catalog-hero { grid-template-columns: 1fr; align-items: start; }
  .safe-note { max-width: 540px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .selection-panel { right: 12px; bottom: 12px; width: calc(100% - 24px); }
}

@media (max-width: 560px) {
  .catalog-header { min-height: 66px; padding: 9px 14px; }
  .catalog-brand img { width: 42px; height: 42px; }
  .catalog-brand strong { font-size: 16px; }
  .catalog-brand small { display: none; }
  .header-link { font-size: 13px; }
  main { width: min(100% - 22px, 1240px); padding-top: 24px; }
  .catalog-hero h1 { font-size: 44px; }
  .catalog-hero p { font-size: 15px; }
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-card { border-radius: 21px; }
  .selection-content { max-height: 84vh; padding: 16px; }
  .selection-item { grid-template-columns: 48px minmax(0, 1fr); }
  .selection-item img { width: 48px; height: 48px; }
  .quantity-controls { grid-column: 2; justify-content: flex-end; }
}
