:root { --wine: #665039; }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, max(220px, calc((100% - 64px) / 5))), 1fr));
  gap: 26px 16px;
}

.catalog-grid .product {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.catalog-grid .product-photo { width: 100%; }
#homeCatalog { display: grid; gap: 26px; }

.catalog-grid .product-photo {
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  background: #f2e8da;
}

.catalog-grid .product-photo img { height: 100%; object-fit: cover; }
.catalog-grid img[src^="assets/demo-"] { object-fit: contain; padding: 10px; }
.catalog-grid h3 { margin: 12px 0 5px; font-size: 15px; }
.catalog-grid .price { margin-bottom: 12px; font-weight: 800; }
.catalog-grid .btn {
  margin-top: auto;
  width: auto;
  text-transform: uppercase;
  min-height: 44px;
  max-width: 100%;
  gap: clamp(6px, 1vw, 12px);
  padding: 0 clamp(8px, 1.5vw, 23px);
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--wine);
  color: #fffdf9;
  font-weight: 600;
}

.catalog-grid .btn:hover {
  border-color: #2d241d;
  background: #2d241d;
  color: #fffdf9;
}

.catalog-grid .btn:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 3px;
}

.catalog-grid .btn-arrow {
  font-size: 16px;
  line-height: 1;
}

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

body:has(.product-dialog[open]) { overflow: hidden; }

.product-dialog {
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  width: min(1200px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
}

.product-dialog::backdrop { background: rgba(53, 44, 37, .52); }

.product-detail-layout {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}

.product-detail-gallery { min-width: 0; background: #f2e8da; }

.product-detail-gallery > img {
  display: block;
  width: 100%;
  height: clamp(440px, 74dvh, 760px);
  object-fit: contain;
}

.product-detail-thumbnails {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
}

.product-detail-gallery [hidden] { display: none; }

.product-detail-thumbnails button {
  flex: 0 0 58px;
  padding: 2px;
  border: 1px solid var(--line);
  background: #fffdf9;
  cursor: pointer;
}

.product-detail-thumbnails button[aria-pressed="true"] { border-color: var(--wine); }
.product-detail-thumbnails img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }

.product-detail-content { min-width: 0; padding: clamp(24px, 4vw, 56px); }

.product-detail-category,
.product-detail-content h3 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.product-detail-category { color: var(--wine); }

.product-detail-content h2 {
  margin: 12px 0;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.product-detail-description { line-height: 1.5; }
.product-detail-price { margin: 18px 0 24px; font-size: 25px; font-weight: 800; }
.product-detail-content h3 { margin: 18px 0 8px; }

.product-detail-options,
.product-detail-quantity { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.product-detail-quantity strong { min-width: 24px; text-align: center; }

.product-dialog .option,
.product-detail-quantity button,
.product-detail-close {
  min-width: 40px;
  min-height: 40px;
  border-radius: 999px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--ink);
  cursor: pointer;
}

.product-dialog .option.selected {
  border-color: var(--wine);
  background: var(--wine);
  color: #fffdf9;
}

.product-detail-close { position: absolute; top: 12px; right: 12px; font-size: 22px; }

.product-detail-content .btn {
  width: 100%;
  margin-top: 10px;
  border-radius: 999px;
  border-color: var(--wine);
  background: #fffdf9;
  color: var(--wine);
}

.product-detail-content .btn.primary { margin-top: 22px; background: var(--wine); color: #fffdf9; }
.product-detail-content .btn:hover { background: var(--ink); color: #fffdf9; }
.product-detail-feedback { margin: 8px 0 0; font-size: 13px; }
.product-detail-feedback:empty { margin: 0; }

@media (max-width: 760px) {
  .product-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .product-detail-layout { grid-template-columns: 1fr; }
  .product-detail-gallery > img { height: min(46dvh, 400px); }
}

#colecao.wrap {
  max-width: none;
  padding: 75px clamp(18px, 3vw, 72px);
}

#colecao .sort-premium,
#colecao .btn:not(.catalog-grid .btn),
a.btn[href="#colecao"] {
  border-radius: 0;
}

#colecao .chip {
  border-radius: 999px;
}

#colecao .chip.active {
  border-color: var(--wine);
  background: var(--wine);
}

@media (max-width: 760px) {
  #colecao.wrap { padding: 55px 12px; }
}

