:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #202532;
  --muted: #697386;
  --line: #dfe4ec;
  --purple: #8236bb;
  --purple-dark: #572481;
  --orange: #f39214;
  --orange-dark: #c66f06;
  --green: #157a57;
  --blue: #255f99;
  --red: #b3261e;
  --shadow: 0 18px 50px rgba(32, 37, 50, 0.10);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(246, 247, 249, 0.98) 360px),
    var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

img {
  display: block;
  max-width: 100%;
}

main {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  min-width: 240px;
}

.brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.2;
}

.brand small,
.contact-strip,
.eyebrow,
.lead,
label,
small {
  color: var(--muted);
}

.main-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  min-width: 0;
}

.tab,
.secondary,
.primary,
.text-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: transparent;
}

.link-tab {
  text-decoration: none;
}

.tab.active {
  color: #ffffff;
  background: var(--purple);
}

.contact-strip {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  text-align: right;
  white-space: nowrap;
}

.contact-info {
  display: grid;
  gap: 2px;
}

.contact-strip strong {
  color: var(--ink);
}

.client-session {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.client-session div {
  display: grid;
  gap: 2px;
  text-align: right;
}

.client-session span,
.client-session small {
  color: var(--muted);
  font-size: 0.78rem;
}

.client-session strong {
  max-width: 150px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pwa-install-button {
  white-space: nowrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.search-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 32px;
  align-items: end;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(130, 54, 187, 0.10), rgba(243, 146, 20, 0.08)),
    #ffffff;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1 {
  max-width: 900px;
  margin-bottom: 16px;
  font-size: clamp(2rem, 5vw, 4.35rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.lead {
  max-width: 680px;
  margin-bottom: 0;
  font-size: 1.08rem;
  line-height: 1.55;
}

.market-search {
  display: grid;
  gap: 8px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  outline: none;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(130, 54, 187, 0.14);
}

.primary {
  color: #ffffff;
  background: var(--orange);
}

.primary:hover {
  background: var(--orange-dark);
}

.secondary {
  color: var(--ink);
  background: #eef1f5;
  border: 1px solid var(--line);
}

.secondary:hover {
  background: #e2e7ee;
}

.secondary.danger {
  color: var(--red);
  background: #fff5f4;
  border-color: #ffd1cc;
}

.text-button {
  min-height: auto;
  padding: 0;
  color: var(--purple);
  background: transparent;
}

.icon-button {
  width: 42px;
  padding: 0;
  color: var(--ink);
  background: #eef1f5;
}

.full {
  width: 100%;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.metric {
  min-height: 98px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  margin-bottom: 4px;
  font-size: 2rem;
  font-weight: 900;
}

.content-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.filter-panel,
.panel,
.admin-sidebar,
.admin-content,
.auth-panel .panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(32, 37, 50, 0.06);
}

.filter-panel {
  position: sticky;
  top: 98px;
  padding: 18px;
}

.section-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading.compact {
  margin-bottom: 12px;
  font-weight: 800;
}

.category-list,
.admin-nav,
.mini-list,
.bid-list {
  display: grid;
  gap: 8px;
}

.category-button,
.admin-nav button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  background: #f7f8fa;
  border: 1px solid transparent;
  border-radius: 8px;
}

.category-button.active,
.admin-nav button.active {
  color: #ffffff;
  background: var(--purple);
}

.catalog-area {
  min-width: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(32, 37, 50, 0.07);
}

.product-card.expired {
  opacity: 0.78;
}

.product-photo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  background: #303846;
}

.product-photo::before,
.product-photo::after {
  content: "";
  position: absolute;
  inset: 0;
}

.product-photo::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.20), transparent 44%),
    radial-gradient(circle at 78% 20%, rgba(243, 146, 20, 0.35), transparent 28%),
    linear-gradient(160deg, rgba(130, 54, 187, 0.55), rgba(32, 37, 50, 0.78));
}

.product-photo::after {
  inset: auto 0 0;
  height: 34%;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 48px),
    linear-gradient(0deg, rgba(0, 0, 0, 0.22), transparent);
}

.product-photo.has-image {
  background: #eef1f5;
}

.product-photo.has-image::before,
.product-photo.has-image::after {
  display: none;
}

.product-photo.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-photo {
  align-items: stretch;
}

.gallery-strip {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
  align-items: center;
  pointer-events: none;
}

.gallery-thumb,
.gallery-more {
  display: grid;
  place-items: center;
  width: 38px;
  height: 30px;
  overflow: hidden;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(32, 37, 50, 0.74);
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 6px;
}

.gallery-thumb.active {
  border-color: var(--orange);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-mark {
  position: relative;
  z-index: 1;
  width: min(58%, 180px);
  height: 48%;
  border: 4px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  opacity: 0.95;
}

.photo-mark::before,
.photo-mark::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 4px;
}

.photo-mark::before {
  width: 56%;
  height: 5px;
  left: 15%;
  top: 28%;
}

.photo-mark::after {
  width: 72%;
  height: 5px;
  left: 15%;
  bottom: 26%;
}

.product-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  background: #eef1f5;
  border-radius: 999px;
}

.badge.orange {
  color: #613400;
  background: #fff0dd;
}

.badge.green {
  color: #0e553d;
  background: #e2f4ec;
}

.badge.blue {
  color: #17456f;
  background: #e4f0fb;
}

.product-meta,
.table-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.price {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
}

.countdown {
  color: var(--purple-dark);
  font-weight: 900;
}

.event-band {
  margin-top: 24px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bid-item,
.mini-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.panel {
  padding: 24px;
}

.stacked-form {
  display: grid;
  gap: 18px;
}

fieldset {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  padding: 0 8px;
  color: var(--ink);
  font-weight: 900;
}

label {
  display: grid;
  gap: 7px;
  font-size: 0.92rem;
  font-weight: 700;
}

.help-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.check-line,
.check-grid label {
  grid-template-columns: auto 1fr;
  align-items: start;
  color: var(--ink);
  line-height: 1.35;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--purple);
}

.lgpd-box {
  background: #fbfbfd;
  border-color: #cfd6df;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.privacy-panel {
  position: sticky;
  top: 98px;
}

.policy-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.policy-list div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.policy-list dt {
  margin-bottom: 4px;
  font-weight: 900;
}

.policy-list dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.cookie-table {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.cookie-table div {
  display: grid;
  gap: 3px;
  padding: 12px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cookie-table span {
  color: var(--muted);
}

.auth-panel {
  display: grid;
  place-items: center;
  min-height: 62vh;
}

.auth-panel .panel {
  width: min(460px, 100%);
}

.admin-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 98px;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.admin-user {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-user img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.admin-user strong,
.admin-user small {
  display: block;
}

.admin-content {
  min-height: 70vh;
  padding: 24px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.client-account {
  display: grid;
  gap: 18px;
}

.account-heading {
  align-items: end;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account-heading h1 {
  margin-bottom: 8px;
}

.account-section {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-table th,
.data-table td {
  padding: 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f7f8fa;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.split-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.empty-state {
  padding: 26px;
  color: var(--muted);
  text-align: center;
  background: #ffffff;
  border: 1px dashed #cfd6df;
  border-radius: 8px;
}

.locked {
  padding: 24px;
  color: var(--red);
  background: #fff5f4;
  border: 1px solid #ffd1cc;
  border-radius: 8px;
}

.modal {
  width: min(760px, calc(100% - 24px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(16, 20, 28, 0.58);
}

.modal-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  width: min(360px, calc(100% - 36px));
  min-height: 0;
  padding: 0;
  color: #ffffff;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  min-height: 48px;
  padding: 14px 16px;
  opacity: 1;
  transform: translateY(0);
}

.whatsapp-float {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 44;
  display: grid;
  gap: 2px;
  min-width: 168px;
  padding: 12px 14px;
  color: #ffffff;
  text-decoration: none;
  background: #168f5a;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.whatsapp-float span {
  font-size: 0.78rem;
  font-weight: 800;
}

.whatsapp-float strong {
  font-size: 0.95rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 22px;
  margin-top: 16px;
}

.detail-gallery,
.detail-main,
.detail-sections {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(32, 37, 50, 0.06);
}

.detail-gallery {
  overflow: hidden;
}

.detail-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #eef1f5;
}

.detail-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  padding: 10px;
}

.detail-thumbs img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
}

.detail-main,
.detail-sections {
  padding: 24px;
}

.detail-sections {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.detail-block {
  padding: 16px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-block p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.cookie-banner {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 45;
  display: grid;
  gap: 14px;
  width: min(560px, calc(100% - 36px));
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.cookie-banner p {
  color: var(--muted);
  line-height: 1.45;
}

.cookie-preferences {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 1120px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .privacy-panel,
  .admin-sidebar {
    position: static;
  }
}

@media (max-width: 860px) {
  main {
    width: min(100% - 20px, 1440px);
    padding-top: 14px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px;
  }

  .brand {
    min-width: 0;
  }

  .main-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    overflow-x: visible;
    padding-bottom: 2px;
    max-width: 100%;
  }

  .tab {
    width: 100%;
    min-height: 40px;
    padding: 0 8px;
    font-size: 0.88rem;
  }

  .contact-strip {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    text-align: left;
    white-space: normal;
  }

  .client-session div {
    text-align: left;
  }

  .search-band,
  .content-grid,
  .form-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .search-band {
    padding: 24px;
  }

  .metric-row,
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-panel {
    position: static;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .detail-layout,
  .detail-sections {
    grid-template-columns: 1fr;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.82rem;
    line-height: 1.08;
  }

  .search-band h1 {
    max-width: 14ch;
  }

  .search-band .lead {
    max-width: 30ch;
  }
}

@media (max-width: 560px) {
  .main-tabs {
    grid-template-columns: 1fr;
    width: min(360px, 100%);
    justify-self: start;
  }

  .metric-row,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .admin-content,
  fieldset {
    padding: 16px;
  }

  .section-heading,
  .bid-item,
  .mini-item,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .cookie-preferences {
    grid-template-columns: 1fr;
  }

  .cookie-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: min(360px, calc(100vw - 20px));
    max-height: min(78vh, 560px);
    overflow: auto;
    padding: 14px;
  }

  .cookie-banner .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .cookie-banner button {
    width: 100%;
  }

  .whatsapp-float {
    right: 10px;
    bottom: 74px;
  }
}
