:root {
  --color-cream: #fbf3e7;
  --color-cream-dark: #f2e4d0;
  --color-terracotta: #c1633c;
  --color-terracotta-dark: #a24f2f;
  --color-brown: #4a3428;
  --color-gold: #d9a441;
  --color-white: #ffffff;
  --shadow: 0 4px 16px rgba(74, 52, 40, 0.1);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--color-cream);
  color: var(--color-brown);
}

h1, h2, h3 {
  font-family: "Fraunces", Georgia, serif;
  margin: 0;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: var(--color-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-terracotta);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.logo-text {
  font-family: "Fraunces", serif;
  font-size: 1.4rem;
  color: var(--color-brown);
}

.cart-toggle {
  position: relative;
  background: var(--color-terracotta);
  color: var(--color-white);
  border: none;
  border-radius: 50px;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-toggle:hover {
  background: var(--color-terracotta-dark);
}

.cart-badge {
  background: var(--color-gold);
  color: var(--color-brown);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

/* Hero */

.hero {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.4rem;
  color: var(--color-terracotta-dark);
}

.hero p {
  font-size: 1.1rem;
  color: var(--color-brown);
  opacity: 0.85;
  margin-top: 0.75rem;
}

.how-it-works {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.how-step {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  min-width: 140px;
}

.how-step strong {
  display: block;
  color: var(--color-terracotta-dark);
  font-size: 1.3rem;
}

/* Filters */

.filters {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

#search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.7rem 1rem;
  border-radius: 50px;
  border: 1px solid var(--color-cream-dark);
  font-size: 1rem;
  background: var(--color-white);
}

#search-input:focus {
  outline: 2px solid var(--color-gold);
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-chip {
  border: 1px solid var(--color-terracotta);
  background: transparent;
  color: var(--color-terracotta-dark);
  border-radius: 50px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s;
}

.category-chip.active,
.category-chip:hover {
  background: var(--color-terracotta);
  color: var(--color-white);
}

/* Product grid */

.product-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-card img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
}

.product-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.product-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gold);
  font-weight: 700;
}

.product-info h3 {
  font-size: 1.1rem;
}

.product-description {
  font-size: 0.88rem;
  opacity: 0.75;
  margin: 0;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.product-price {
  font-weight: 700;
  color: var(--color-terracotta-dark);
  font-size: 1.05rem;
}

.add-btn {
  background: var(--color-brown);
  color: var(--color-cream);
  border: none;
  border-radius: 50px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.add-btn:hover {
  background: var(--color-terracotta-dark);
}

.empty-state {
  text-align: center;
  opacity: 0.6;
  grid-column: 1 / -1;
  padding: 2rem;
}

/* Cart drawer */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 52, 40, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 20;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: var(--color-cream);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 21;
  transition: right 0.25s ease;
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  right: 0;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: var(--color-white);
  box-shadow: var(--shadow);
}

.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-brown);
}

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
}

.cart-items {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-empty {
  text-align: center;
  opacity: 0.6;
  margin-top: 2rem;
}

.cart-item {
  display: flex;
  gap: 0.75rem;
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: var(--shadow);
}

.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.qty-control button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--color-terracotta);
  background: var(--color-white);
  color: var(--color-terracotta-dark);
  font-size: 1rem;
  line-height: 1;
}

/* Endereço de entrega */

.address-section {
  padding: 0 1.5rem 1rem;
}

.address-section h3 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.field {
  display: flex;
  flex-direction: column;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-brown);
  gap: 0.25rem;
}

.field input {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 400;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--color-cream-dark);
  background: var(--color-white);
}

.field input:focus {
  outline: 2px solid var(--color-gold);
}

.field-wide {
  grid-column: 1 / -1;
}

.field-uf input {
  text-transform: uppercase;
}

.cep-status {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: var(--color-terracotta-dark);
  min-height: 1em;
}

/* Totais e checkout */

.cart-footer {
  padding: 1.25rem 1.5rem;
  background: var(--color-white);
  box-shadow: 0 -4px 16px rgba(74, 52, 40, 0.08);
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 0.4rem;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--color-cream-dark);
}

.checkout-status {
  font-size: 0.82rem;
  color: var(--color-terracotta-dark);
  margin: 0 0 0.5rem;
  min-height: 1.1em;
}

/* Painel Pix */

.pix-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-cream-dark);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pix-panel h3 {
  font-size: 1rem;
}

.pix-qr {
  display: flex;
  justify-content: center;
}

.pix-qr svg {
  width: 180px;
  height: 180px;
}

.pix-code {
  width: 100%;
  min-height: 70px;
  font-family: monospace;
  font-size: 0.75rem;
  padding: 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--color-cream-dark);
  resize: none;
  background: var(--color-cream);
}

.pix-note {
  font-size: 0.78rem;
  opacity: 0.7;
  margin: 0;
}

#pix-copy-btn {
  width: 100%;
  text-align: center;
  padding: 0.7rem;
}

#whatsapp-btn {
  background: #25d366;
}

#whatsapp-btn:hover {
  background: #1ebe57;
}

.checkout-btn {
  width: 100%;
  background: var(--color-terracotta);
  color: var(--color-white);
  border: none;
  border-radius: 50px;
  padding: 0.9rem;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.checkout-btn:hover:not(:disabled) {
  background: var(--color-terracotta-dark);
}

.checkout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Footer */

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  opacity: 0.7;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.9rem;
  }
}
