:root {
  --pink-700: #9b0649;
  --pink-600: #c40c62;
  --pink-500: #e81075;
  --pink-300: #f98fbe;
  --black: #120e10;
  --graphite: #211a1e;
  --cream: #f6efe4;
  --pearl: #fffaf3;
  --nude: #f2dfcf;
  --gold: #c49a55;
  --line: rgba(18, 14, 16, .12);
  --muted: #75676d;
  --soft: rgba(255, 255, 255, .72);
  --shadow: 0 22px 58px rgba(18, 14, 16, .12);
  --radius: 18px;
  --font-display: Georgia, "Times New Roman", serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--black);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: inherit; }

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand img { width: 150px; height: auto; }

.nav {
  justify-self: center;
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .54);
}
.nav-link {
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 10px 18px;
  min-height: 42px;
  color: var(--muted);
  font-weight: 800;
}
.nav-link.active {
  background: var(--black);
  color: #fff;
}

.cart-button,
.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  border: 0;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 850;
}
.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--pink-600);
  color: #fff;
  box-shadow: 0 16px 28px rgba(196, 12, 98, .22);
}
.cart-button strong {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #fff;
  color: var(--pink-700);
  font-size: 13px;
}

main { padding: 20px 0 56px; }
.hidden { display: none !important; }
.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--pink-600);
}

.catalog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: stretch;
  padding: 34px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 20%, rgba(232, 16, 117, .18), transparent 30%),
    linear-gradient(135deg, #fffaf3 0%, #f4e2d0 100%);
  border: 1px solid rgba(196, 154, 85, .35);
  box-shadow: var(--shadow);
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.04;
  letter-spacing: 0;
}
.catalog-hero h1 {
  max-width: 760px;
  margin: 10px 0 14px;
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 500;
}
.catalog-hero p {
  max-width: 650px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}
.sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, .58);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.hero-panel {
  align-self: end;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border-radius: 22px;
  background: var(--black);
  color: #fff;
}
.hero-panel strong {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 500;
}
.hero-panel span {
  color: rgba(255, 255, 255, .72);
}
.hero-panel a {
  display: inline-flex;
  justify-content: center;
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  color: #fff;
  background: var(--pink-600);
  text-decoration: none;
  font-weight: 850;
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 16px;
  margin: 24px 0;
  align-items: end;
}
.search-box {
  display: grid;
  gap: 8px;
}
label span,
.search-box span {
  font-size: 13px;
  font-weight: 850;
  color: var(--graphite);
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  color: var(--black);
  padding: 13px 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--pink-500);
  box-shadow: 0 0 0 4px rgba(232, 16, 117, .12);
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.filter-chip {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, .66);
  color: var(--muted);
  font-weight: 850;
}
.filter-chip.active {
  background: var(--pink-600);
  border-color: var(--pink-600);
  color: #fff;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin: 10px 0 18px;
}
.section-title h2 {
  margin: 6px 0 0;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 500;
}
.section-title > span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 250, 243, .9);
  box-shadow: 0 14px 32px rgba(18, 14, 16, .08);
}
.product-image {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #f7e2d5, #fffaf3);
  overflow: hidden;
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stock-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(18, 14, 16, .78);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}
.stock-badge.low { background: var(--gold); color: var(--black); }
.stock-badge.out { background: #6f252d; }
.product-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
}
.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.product-card h3 {
  min-height: 50px;
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.35;
}
.product-card p {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}
.price-row strong {
  color: var(--pink-700);
  font-size: 20px;
}
.add-button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 10px 13px;
  background: var(--black);
  color: #fff;
  font-weight: 900;
}
.add-button:disabled {
  opacity: .46;
  cursor: not-allowed;
}
.empty-state {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  color: var(--muted);
}
.empty-state strong {
  color: var(--black);
  font-size: 18px;
}

.admin-locked {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 130px);
}
.lock-card {
  width: min(440px, 100%);
  padding: 28px;
  border-radius: 26px;
  background: var(--black);
  color: #fff;
  box-shadow: var(--shadow);
}
.lock-card img { width: 180px; margin-bottom: 22px; }
.lock-card .eyebrow { color: var(--pink-300); }
.lock-card h1 {
  margin: 10px 0;
  font-size: 42px;
  font-weight: 500;
}
.lock-card p {
  color: rgba(255, 255, 255, .72);
  line-height: 1.6;
}
.lock-card form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}
.lock-card label { display: grid; gap: 8px; }
.lock-card label span { color: rgba(255, 255, 255, .8); }
.lock-card small { color: #ff9bab; min-height: 18px; }

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin: 16px 0 24px;
}
.admin-head h1 {
  margin: 6px 0 8px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 500;
}
.admin-head p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 430px) 1fr;
  gap: 20px;
  align-items: start;
}
.product-form,
.admin-list {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 243, .88);
  box-shadow: 0 14px 32px rgba(18, 14, 16, .07);
}
.product-form {
  display: grid;
  gap: 14px;
  padding: 20px;
  position: sticky;
  top: 92px;
}
.form-title,
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.form-title strong,
.list-head strong {
  font-size: 18px;
}
.product-form label {
  display: grid;
  gap: 7px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.check-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  flex-direction: row;
}
.check-row input {
  width: 18px;
  height: 18px;
}
.primary-button {
  width: 100%;
  padding: 12px 18px;
  background: var(--pink-600);
  color: #fff;
  box-shadow: 0 14px 26px rgba(196, 12, 98, .2);
}
.secondary-button {
  padding: 12px 16px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  color: var(--black);
}
.ghost-button {
  padding: 10px 12px;
  background: transparent;
  color: var(--pink-700);
}
.admin-list {
  padding: 18px;
}
.list-head {
  padding: 2px 2px 14px;
  border-bottom: 1px solid var(--line);
}
.list-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.admin-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}
.admin-item:last-child { border-bottom: 0; }
.admin-thumb {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--nude);
}
.admin-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.admin-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-copy span {
  color: var(--muted);
  font-size: 13px;
}
.admin-buttons {
  display: flex;
  gap: 8px;
}
.mini-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  min-height: 38px;
  padding: 8px 12px;
  font-weight: 850;
}
.mini-button.danger { color: #a7192f; }

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}
.cart-drawer.open { pointer-events: auto; }
.cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 14, 16, .38);
  opacity: 0;
  transition: opacity .2s ease;
}
.cart-drawer.open .cart-backdrop { opacity: 1; }
.cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(440px, 100%);
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--pearl);
  box-shadow: -24px 0 56px rgba(18, 14, 16, .18);
  transform: translateX(104%);
  transition: transform .22s ease;
}
.cart-drawer.open .cart-panel { transform: translateX(0); }
.cart-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.cart-head h2 {
  margin: 4px 0 0;
  font-size: 34px;
  font-weight: 500;
}
.icon-button {
  width: 44px;
  padding: 0;
  background: var(--black);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}
.cart-items {
  overflow: auto;
  padding: 12px 22px;
}
.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item strong { line-height: 1.35; }
.cart-item span {
  color: var(--muted);
  font-size: 13px;
}
.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}
.qty-controls button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 900;
}
.cart-footer {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-top: 1px solid var(--line);
}
.cart-total {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
}
.cart-total span {
  color: var(--muted);
  font-weight: 850;
}
.cart-total strong {
  color: var(--pink-700);
  font-size: 24px;
}
.cart-footer small {
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 80;
  transform: translate(-50%, 20px);
  opacity: 0;
  max-width: min(460px, calc(100% - 28px));
  padding: 13px 16px;
  border-radius: 999px;
  background: var(--black);
  color: #fff;
  font-weight: 850;
  text-align: center;
  transition: .2s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }
  .brand img { width: 132px; }
  .nav {
    order: 3;
    grid-column: 1 / -1;
    justify-self: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .catalog-hero,
  .catalog-tools,
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .filter-group {
    justify-content: flex-start;
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .product-form {
    position: static;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
  }
  .topbar {
    gap: 10px;
  }
  .cart-button span { display: none; }
  .catalog-hero {
    padding: 22px;
    border-radius: 22px;
  }
  .catalog-hero h1 {
    font-size: 36px;
  }
  .section-title,
  .admin-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .product-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .admin-item {
    grid-template-columns: 54px 1fr;
  }
  .admin-buttons {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

/* ---------- Admin: abas e CRM ---------- */
.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 20px;
}
.pane-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 0 0 14px;
}
.crm-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.crm-stat {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 250, 243, .88);
  box-shadow: 0 14px 32px rgba(18, 14, 16, .06);
}
.crm-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.crm-stat strong {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
}
.crm-tools {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}
.crm-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
}
.crm-item:last-child { border-bottom: 0; }
.crm-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.crm-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.crm-name strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.crm-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.crm-tag {
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--nude);
  color: var(--pink-700);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.crm-tag.today {
  background: var(--pink-600);
  color: #fff;
}
.crm-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.crm-actions a.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  text-decoration: none;
}
.crm-details {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
}
.crm-details summary {
  cursor: pointer;
  color: var(--graphite);
  font-weight: 850;
}
.crm-details ul {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.65;
}
.crm-empty {
  padding: 28px 8px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- Sacola: etapa de dados da cliente ---------- */
.cart-panel.is-checkout .cart-items,
.cart-panel.is-checkout .cart-footer { display: none; }
.checkout-step {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
}
.checkout-body {
  display: grid;
  gap: 14px;
  align-content: start;
  overflow: auto;
  padding: 18px 22px;
}
.checkout-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.checkout-body label {
  display: grid;
  gap: 7px;
}
.checkout-body label.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.checkout-body .consent input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  padding: 0;
}
.checkout-body .consent span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
.checkout-body input.invalid {
  border-color: #a7192f;
  box-shadow: 0 0 0 4px rgba(167, 25, 47, .1);
}
.back-button {
  justify-self: start;
  min-height: 36px;
  padding-left: 0;
}
.form-error {
  min-height: 18px;
  color: #a7192f;
  font-weight: 700;
  line-height: 1.4;
}
.checkout-footer {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-top: 1px solid var(--line);
}
.primary-button:disabled {
  opacity: .6;
  cursor: wait;
}

@media (max-width: 980px) {
  .crm-tools { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .crm-summary { grid-template-columns: 1fr; }
  .crm-item { grid-template-columns: 1fr; }
  .crm-actions { justify-content: flex-start; }
  .pane-actions { justify-content: flex-start; }
}
