:root {
  --ink: #2a1718;
  --muted: #74696b;
  --wine: #8f2f45;
  --rose: #d95d72;
  --rose-soft: #f7d9dc;
  --cream: #fff8f2;
  --paper: #ffffff;
  --sage: #55745d;
  --gold: #e4ac45;
  --line: #eadfe0;
  --shadow: 0 12px 30px rgba(79, 34, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(85, 116, 93, 0.42);
  outline-offset: 2px;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 10px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(143, 47, 69, 0.14);
  background: rgba(255, 248, 242, 0.96);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--wine);
  font-family: "Patrick Hand", cursive;
  font-size: 22px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "Patrick Hand", cursive;
  font-size: 24px;
  line-height: 0.9;
}

.brand small {
  margin-top: 4px;
  color: var(--wine);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.icon-button {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.counter {
  position: absolute;
  top: -3px;
  right: -2px;
  display: grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--cream);
  border-radius: 10px;
  color: white;
  background: var(--wine);
  font-size: 10px;
  font-weight: 800;
}

.hero {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-height: 520px;
  min-height: 330px;
  background: #efd8ca;
}

.hero img {
  display: block;
  width: 100%;
  height: min(58vw, 520px);
  min-height: 330px;
  object-fit: cover;
  object-position: center 52%;
}

.hero::after {
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(transparent, rgba(42, 23, 24, 0.68));
  content: "";
  pointer-events: none;
}

.hero-actions {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 18px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  color: white;
  background: var(--wine);
  box-shadow: var(--shadow);
}

.primary-button svg,
.secondary-button svg {
  width: 19px;
}

.secondary-button {
  color: var(--wine);
  background: var(--rose-soft);
}

.catalog-toolbar {
  scroll-margin-top: 76px;
  padding: 26px 16px 16px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto 18px;
}

.eyebrow {
  color: var(--wine);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: "Patrick Hand", cursive;
  font-size: clamp(30px, 8vw, 44px);
  font-weight: 400;
  line-height: 1;
}

.result-count {
  flex: none;
  color: var(--muted);
  font-size: 13px;
}

.search-field {
  display: flex;
  width: min(100%, 1180px);
  min-height: 50px;
  align-items: center;
  gap: 10px;
  margin: 0 auto 14px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.search-field > svg {
  width: 20px;
  color: var(--wine);
}

.search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-field button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.category-strip {
  display: flex;
  width: min(100%, 1180px);
  gap: 8px;
  margin: 0 auto;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category-button {
  min-height: 40px;
  flex: none;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  background: var(--paper);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.category-button[aria-selected="true"] {
  border-color: var(--wine);
  color: white;
  background: var(--wine);
}

.product-grid {
  display: grid;
  width: min(calc(100% - 32px), 1180px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 auto;
  padding-bottom: 28px;
}

.product-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

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

.product-photo {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1;
  background-color: #f7f1ed;
}

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

.product-card[data-product-id="prato-floral"] .product-photo img,
.product-card[data-product-id="boleira-cupula"] .product-photo img,
.product-card[data-product-id="caneca-bambu"] .product-photo img {
  object-position: center;
}

.favorite-button {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--wine);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 12px rgba(42, 23, 24, 0.12);
  cursor: pointer;
}

.favorite-button.is-active {
  color: white;
  background: var(--wine);
}

.favorite-button svg {
  width: 18px;
}

.product-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  color: white;
  background: var(--sage);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-copy {
  padding: 12px;
}

.product-copy small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.product-copy h2 {
  min-height: 40px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.35;
}

.product-price {
  display: block;
  margin-bottom: 10px;
  color: var(--wine);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.detail-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--wine);
  font-size: 12px;
  font-weight: 800;
}

.detail-link svg {
  width: 15px;
  height: 15px;
}

.whatsapp-fab {
  position: fixed;
  z-index: 18;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: white;
  background: #1fa855;
  box-shadow: 0 12px 28px rgba(31, 168, 85, 0.34);
  cursor: pointer;
}

.whatsapp-fab svg {
  width: 27px;
  height: 27px;
}

.bag-drawer {
  width: min(100%, 480px);
  height: min(82dvh, 720px);
  max-width: none;
  max-height: none;
  margin: auto 0 0 auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px 0 0 0;
  background: var(--cream);
  box-shadow: -10px -10px 40px rgba(42, 23, 24, 0.2);
}

.bag-drawer::backdrop {
  background: rgba(42, 23, 24, 0.48);
  backdrop-filter: blur(3px);
}

.bag-drawer[open] {
  display: flex;
  flex-direction: column;
}

.product-dialog {
  width: min(calc(100% - 24px), 760px);
  max-width: none;
  max-height: min(90dvh, 760px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(42, 23, 24, 0.3);
}

.product-dialog::backdrop {
  background: rgba(42, 23, 24, 0.58);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  box-shadow: 0 4px 14px rgba(42, 23, 24, 0.18);
}

.product-detail {
  display: grid;
  max-height: inherit;
  overflow-y: auto;
}

.detail-photo {
  overflow: hidden;
  aspect-ratio: 1;
  background: #f7f1ed;
}

.detail-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-copy {
  padding: 22px;
}

.detail-copy h2 {
  margin: 4px 0 12px;
  font-family: "Patrick Hand", cursive;
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
}

.detail-copy p {
  color: var(--muted);
  line-height: 1.6;
}

.detail-price {
  display: block;
  margin: 18px 0;
  color: var(--wine);
  font-size: 26px;
}

.detail-copy .secondary-button {
  margin-top: 10px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px max(92px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.site-footer a {
  color: var(--muted);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  margin: 2px 0 0;
  font-family: "Patrick Hand", cursive;
  font-size: 32px;
  font-weight: 400;
}

.bag-items {
  flex: 1;
  padding: 10px 20px;
  overflow-y: auto;
}

.bag-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.bag-item strong,
.bag-item small {
  display: block;
}

.bag-item small {
  margin-top: 4px;
  color: var(--muted);
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bag-item-copy { min-width: 0; }
.bag-color-field {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.bag-color-field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: white;
  font: inherit;
}
.bag-color-field select:focus-visible {
  outline: 3px solid rgba(85, 116, 93, 0.42);
  outline-offset: 2px;
}
.add-color-button {
  min-height: 36px;
  margin-top: 5px;
  padding: 4px 0;
  border: 0;
  color: var(--wine);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.bag-color-message {
  margin: 0 0 12px;
  color: var(--wine);
  font-size: 13px;
}

.quantity-control button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: white;
  cursor: pointer;
}

.quantity-control svg {
  width: 15px;
}

.bag-summary {
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: white;
}

.bag-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bag-summary strong {
  color: var(--wine);
  font-size: 22px;
}

.bag-summary small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  text-align: center;
}

.full-button {
  width: 100%;
}

.empty-state,
.bag-empty {
  padding: 50px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg,
.bag-empty svg {
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  color: var(--wine);
}

.empty-state h2,
.bag-empty h3 {
  color: var(--ink);
}

.toast {
  position: fixed;
  z-index: 40;
  bottom: calc(88px + env(safe-area-inset-bottom));
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 11px 14px;
  border-radius: 6px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 720px) {
  .site-header {
    padding-right: 28px;
    padding-left: 28px;
  }

  .hero {
    min-height: 420px;
  }

  .hero img {
    min-height: 420px;
  }

  .catalog-toolbar {
    padding: 38px 28px 22px;
  }

  .product-grid {
    width: min(calc(100% - 56px), 1180px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .product-copy h2 {
    font-size: 16px;
  }

  .product-detail {
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  }

  .detail-photo {
    aspect-ratio: auto;
    min-height: 520px;
  }

  .detail-copy {
    align-self: center;
    padding: 36px;
  }
}

@media (min-width: 1024px) {
  .hero img {
    height: 520px;
    object-position: center 48%;
  }

  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
