:root {
  --orange: #ff6500;
  --orange-dark: #e95200;
  --orange-soft: #fff0e6;
  --green: #20a455;
  --text: #202020;
  --muted: #6f6f6f;
  --border: #e9e9e9;
  --background: #f7f7f8;
  --white: #ffffff;
  --shadow: 0 12px 34px rgba(28, 28, 28, .08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.is-hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #ff7b00, #ff4d00);
  color: #fff;
  font-size: 1.45rem;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(255, 91, 0, .25);
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-text strong {
  font-size: 1.05rem;
}

.brand-text small {
  color: var(--muted);
  font-size: .73rem;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.button {
  min-height: 44px;
  padding: 0 17px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.button-primary {
  background: linear-gradient(135deg, #ff7b00, #ff4d00);
  color: #fff;
  box-shadow: 0 8px 22px rgba(255, 91, 0, .2);
}

.button-light {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.hero {
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 220, 190, .8), transparent 35%),
    linear-gradient(145deg, #fff7f1, #fff);
}

.hero-content {
  min-height: 390px;
  padding-block: 70px 58px;
  display: grid;
  align-content: center;
  gap: 32px;
}

.hero-copy {
  max-width: 700px;
}

.eyebrow,
.section-kicker {
  display: inline-block;
  margin-bottom: 9px;
  color: var(--orange-dark);
  font-size: .77rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 750px;
  margin: 0 0 15px;
  font-size: clamp(2.2rem, 6vw, 4.25rem);
  line-height: 1.03;
  letter-spacing: -.045em;
}

.hero p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.6;
}

.search-panel {
  max-width: 900px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px auto;
  gap: 10px;
  border: 1px solid rgba(255, 101, 0, .13);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.search-field {
  min-height: 50px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.search-field span {
  color: var(--orange);
  font-size: 1.3rem;
}

.search-field input,
.search-panel select {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
}

.search-panel select {
  min-height: 50px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.categories-section,
.promotions-section {
  padding-block: 52px;
}

.section-heading {
  margin-bottom: 22px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.section-heading p {
  margin: 7px 0 0;
  color: var(--muted);
}

.clear-button {
  border: 0;
  background: transparent;
  color: var(--orange-dark);
  font-weight: 800;
  cursor: pointer;
}

.categories-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 7px;
  scrollbar-width: thin;
}

.category-chip {
  min-height: 44px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #474747;
  font-weight: 750;
  cursor: pointer;
}

.category-chip.is-active {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.sort-filter {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  outline: none;
}

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

.promotion-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(32, 32, 32, .05);
  transition: transform .2s ease, box-shadow .2s ease;
}

.promotion-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.promotion-image {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  /* Fundo neutro: com contain sobram faixas nas laterais ou em cima,
     e sobre o degradê laranja elas ficavam com cara de erro. */
  background: #f6f6f7;
}

/* contain, não cover: mostra a foto inteira que a empresa enviou.
   Com cover o cartão preenchia o espaço cortando as bordas — foto em pé
   perdia o topo e a base, e era o pedaço que sumia no celular. */
.promotion-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Sem foto, o espaço volta a ter a cor da marca */
.promotion-image:not(:has(img)) {
  background:
    linear-gradient(135deg, rgba(255, 101, 0, .15), rgba(255, 185, 130, .25)),
    #fff3e9;
}

.promotion-image-placeholder {
  display: grid;
  place-items: center;
  gap: 8px;
  color: #b65b25;
  text-align: center;
  font-weight: 800;
}

.promotion-image-placeholder span {
  font-size: 2.2rem;
}

.promotion-content {
  padding: 17px;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.promotion-company {
  margin-bottom: 7px;
  color: var(--orange-dark);
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.promotion-content h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  line-height: 1.3;
}

.promotion-description {
  min-height: 42px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}

.promotion-info-row {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.promotion-category {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: .71rem;
  font-weight: 850;
}

.promotion-time {
  color: #727272;
  font-size: .74rem;
}

.promotion-prices {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.old-price {
  color: #9b9b9b;
  font-size: .84rem;
  text-decoration: line-through;
}

.promo-price {
  color: var(--green);
  font-size: 1.45rem;
  font-weight: 900;
}

.discount-badge {
  margin-left: auto;
  color: var(--green);
  font-size: .78rem;
  font-weight: 900;
}

.whatsapp-button {
  min-height: 44px;
  margin-top: 14px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #20a455;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
}

.whatsapp-button:hover {
  background: #188c47;
}

.loading-state,
.empty-state {
  min-height: 270px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 4px solid #ffd9c1;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.loading-state p,
.empty-state p {
  color: var(--muted);
}

.empty-state > div {
  font-size: 2.6rem;
}

.empty-state h3 {
  margin: 12px 0 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
}

.footer-inner {
  min-height: 145px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-inner p {
  margin: 5px 0 0;
  color: var(--muted);
}

.footer-inner a {
  color: var(--orange-dark);
  font-weight: 800;
  text-decoration: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@media (max-width: 760px) {
  .brand-text small {
    display: none;
  }

  .header-actions .button-light {
    display: none;
  }

  .header-actions .button {
    padding-inline: 13px;
    font-size: .84rem;
  }

  .hero-content {
    min-height: 340px;
    padding-block: 48px 42px;
  }

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

  .search-panel .button {
    width: 100%;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-filter {
    width: 100%;
  }
}

@media (max-width: 590px) {
  .container {
    width: min(100% - 22px, 1180px);
  }

  .header-inner {
    min-height: 68px;
  }

  .brand-icon {
    width: 39px;
    height: 39px;
  }

  .brand-text strong {
    font-size: .95rem;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .categories-section,
  .promotions-section {
    padding-block: 38px;
  }

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

  .footer-inner {
    padding-block: 30px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

/* Etapa 11 — ações dos cartões públicos */
.promotion-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 15px;
}

.details-button,
.promotion-card-actions .whatsapp-button {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  text-decoration: none;
  font-size: .84rem;
  font-weight: 900;
}

.details-button {
  border: 1px solid #ffd1b2;
  background: #fff5ed;
  color: #d94f00;
}

.promotion-card-actions .whatsapp-button {
  margin: 0;
}

@media (max-width: 430px) {
  .promotion-card-actions { grid-template-columns: 1fr; }
}

.city-selector-wrap {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.city-selector-wrap select {
  width: 100%;
}

.city-page-link {
  padding-inline: 4px;
  color: var(--orange-dark);
  font-size: .78rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.city-page-link:hover {
  text-decoration: underline;
}

.promotion-company-link { color: inherit; text-decoration: none; }
.promotion-company-link:hover { text-decoration: underline; }

/* Etapa 15 — Favoritos e compartilhamento */
.promotion-quick-actions { display:flex; gap:8px; margin-top:10px; }
.favorite-button,.share-button { flex:1; border:1px solid #e5e7eb; background:#fff; border-radius:10px; padding:9px 10px; cursor:pointer; font-weight:700; color:#374151; }
.favorite-button:hover,.share-button:hover { border-color:#ef4444; color:#b91c1c; }
.favorite-button.is-favorite { background:#fff1f2; border-color:#fb7185; color:#be123c; }
.favorites-count-link { white-space:nowrap; }
