/* Milk Industries — loja grid (referência Maze) + página de produto. Carregar após style.css */

body { overflow-x: hidden; }

/* ---------- header ---------- */

.loja-header {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
}

.loja-header .back {
  justify-self: start;
  font-size: 18px;
  line-height: 1;
  color: var(--milk-black);
  text-decoration: none;
  padding: 6px 10px;
  transition: color 0.25s ease;
}
.loja-header .back:hover { color: var(--milk-red); }

.brand {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
/* lettering "milk" SEMPRE o original (regra de marca — nunca fonte substituta) */
.brand-lettering {
  width: 78px;
  height: auto;
  display: block;
}
.brand-sub {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.38em;
  padding-left: 0.38em; /* compensa o tracking do último caractere */
  color: var(--milk-black);
}

.bag-btn {
  justify-self: end;
  position: relative;
  border: none;
  background: none;
  cursor: pointer;
  padding: 6px;
  color: var(--milk-black);
}
.bag-btn svg { display: block; }
.bag-count {
  position: absolute;
  top: 0;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--milk-red);
  color: var(--milk-white);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  display: none;
}
.bag-count.on { display: block; }

/* ---------- faixa preta (variante; ?faixa=0 esconde) ---------- */

.ticker {
  background: var(--milk-black);
  color: var(--milk-white);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  padding: 7px 12px;
}
body.no-faixa .ticker { display: none; }

/* ---------- grid de produtos ---------- */

main.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  align-items: stretch; /* anula o align-items:center do main base — 4 células iguais */
  padding: 0;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
/* divisórias 1px estilo Maze via borda (sem vazar fundo nas áreas vazias) */
main.grid .card { border-bottom: 1px solid #e5e5e5; }
main.grid .card:nth-child(odd) { border-right: 1px solid #e5e5e5; }
/* desktop: grid centralizado ganha divisórias laterais */
@media (min-width: 561px) {
  main.grid { border-left: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5; }
}

.card {
  background: var(--milk-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px 22px;
  text-decoration: none;
  color: var(--milk-black);
  -webkit-tap-highlight-color: transparent;
}
.card-imgwrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-imgwrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.card-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em; /* sem transform: grafia oficial dos nomes é do cliente */
  line-height: 1.45;
  margin-top: 12px;
}
.card-price {
  font-size: 12px;
  color: #777;
  margin-top: 6px;
}
a.card:hover .card-name { color: var(--milk-red); }

/* 4ª célula: próximo drop */
.card-soon {
  justify-content: center;
  cursor: default;
}
.soon-logo {
  width: 46%;
  height: auto;
  filter: grayscale(1) opacity(0.28);
}
.card-soon span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  padding-left: 0.26em;
  color: #b3b3b3;
  margin-top: 14px;
}

/* ---------- página de produto ---------- */

main.produto {
  display: block;
  padding: 0 0 30px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.produto-img img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}
.produto-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 0;
}
.produto-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em; /* grafia oficial — sem text-transform */
}
.produto-price {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.sizes {
  display: flex;
  gap: 8px;
}
.size-pill {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--milk-black);
  border-radius: 3px;
  background: var(--milk-white);
  color: var(--milk-black);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.size-pill:hover { border-color: var(--milk-red); color: var(--milk-red); }
.size-pill.selected {
  background: var(--milk-black);
  color: var(--milk-white);
  border-color: var(--milk-black);
}
.size-pill.selected:hover { color: var(--milk-white); }
.size-pill.soldout {
  position: relative;
  color: #bbb;
  border-color: #ddd;
  cursor: not-allowed;
}
.size-pill.soldout:hover { color: #bbb; border-color: #ddd; }
.size-pill.soldout::before,
.size-pill.soldout::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 110%;
  height: 2px;
  background: var(--milk-red);
  opacity: 0.9;
  pointer-events: none;
}
.size-pill.soldout::before { transform: translate(-50%, -50%) rotate(45deg); }
.size-pill.soldout::after { transform: translate(-50%, -50%) rotate(-45deg); }

.qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--milk-black);
  border-radius: 3px;
  height: 34px;
  align-self: flex-start;
}
.qty button {
  width: 30px;
  height: 100%;
  border: none;
  background: none;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  color: var(--milk-black);
  transition: color 0.2s ease;
}
.qty button:hover { color: var(--milk-red); }
.qty-value {
  min-width: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.produto-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.add-btn {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 3px;
  background: var(--milk-black);
  color: var(--milk-white);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 0.25s ease;
}
.add-btn:hover { background: var(--milk-red); }

.panel-msg {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--milk-red);
  min-height: 14px;
}

/* ---------- sacola / drawer (mesmo padrão da revista arquivada) ---------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 50;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(92vw, 380px);
  background: var(--milk-white);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
  transform: translateX(105%);
  transition: transform 0.35s cubic-bezier(0.22, 0.8, 0.3, 1);
  z-index: 51;
  display: flex;
  flex-direction: column;
  padding: 26px 24px;
}
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }

.drawer-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  margin-bottom: 22px;
}
.drawer-close {
  position: absolute;
  top: 18px;
  right: 20px;
  border: none;
  background: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease;
}
.drawer-close:hover { color: var(--milk-black); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cart-empty {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #bbb;
  margin-top: 8px;
}
.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
}
.cart-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 2px;
  flex-shrink: 0;
  background: var(--milk-white);
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em; /* sem lowercase: preserva a grafia oficial dos nomes */
}
.cart-item-meta {
  font-size: 11px;
  color: #888;
  letter-spacing: 0.08em;
  margin-top: 3px;
}
.cart-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.cart-item-price {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.cart-item .qty { height: 26px; align-self: auto; }
.cart-item .qty button { width: 24px; font-size: 13px; }
.cart-item .qty-value { min-width: 20px; font-size: 12px; }
.cart-remove {
  border: none;
  background: none;
  font-size: 14px;
  cursor: pointer;
  color: #bbb;
  transition: color 0.2s ease;
  padding: 2px;
}
.cart-remove:hover { color: var(--milk-red); }

.drawer-footer {
  border-top: 1px solid #eee;
  padding-top: 16px;
  margin-top: 16px;
}
.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}
.checkout-btn {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 3px;
  background: var(--milk-black);
  color: var(--milk-white);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 0.25s ease;
}
.checkout-btn:hover { background: var(--milk-red); }
.checkout-msg {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--milk-red);
  margin-top: 10px;
  min-height: 14px;
}

/* ---------- lightbox de zoom (produto.html) ---------- */

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 60;
}
.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 61;
}
body.lightbox-open .lightbox-backdrop,
body.lightbox-open .lightbox {
  opacity: 1;
  pointer-events: auto;
}
body.lightbox-open { overflow: hidden; }
.lightbox-img {
  max-width: 92vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 3px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
  transform-origin: 0 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
}
.lightbox-img.panning { cursor: grabbing; }
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease;
}
.lightbox-close:hover { color: var(--milk-black); }

@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer-backdrop, .lightbox, .lightbox-backdrop { transition: none; }
}

/* ---------- checkout ---------- */

main.checkout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 22px;
  padding: 22px 18px 30px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.checkout-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: lowercase;
}

.checkout-summary {
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 14px 16px;
}
.summary-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.summary-item-name { color: var(--milk-black); }
.summary-item-price { font-weight: 700; white-space: nowrap; }
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}
.summary-row + .summary-row { border-top: none; padding-top: 4px; }
.summary-total {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: 4px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-msg {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--milk-red);
  min-height: 14px;
}
.form-msg a { color: var(--milk-red); }
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #666;
}
.field input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--milk-black);
  border-radius: 3px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  color: var(--milk-black);
  background: var(--milk-white);
}
.field input:focus {
  outline: none;
  border-color: var(--milk-red);
}
.field-row {
  display: flex;
  gap: 12px;
}
.field-row .field { flex: 1; min-width: 0; }
.field-number { flex: 1 1 40%; }
.field-complement { flex: 1 1 60%; }
.field-uf { flex: 0 0 70px; }

.shipping-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shipping-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 10px 12px;
  font-size: 12px;
  cursor: pointer;
}
.shipping-option:has(input:checked) {
  border-color: var(--milk-black);
}
.shipping-option input { accent-color: var(--milk-black); }

.pay-btn {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 3px;
  background: var(--milk-black);
  color: var(--milk-white);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 0.25s ease;
}
.pay-btn:hover { background: var(--milk-red); }
.pay-btn:disabled { background: #999; cursor: default; }

/* ---------- status do pedido (sucesso/pendente/erro) ---------- */

main.status {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 40px 24px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}
.status-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.status-sub {
  font-size: 13px;
  color: #666;
}
.status-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--milk-black);
}
.status-total {
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
}
.status-actions { margin-top: 14px; }
.status-actions a {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--milk-black);
  text-decoration: none;
  border-bottom: 1px solid var(--milk-black);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.status-actions a:hover { color: var(--milk-red); border-color: var(--milk-red); }

/* ---------- calculador de frete (página de produto) ---------- */

.frete-calc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.frete-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  margin: 0;
}
.frete-row { display: flex; gap: 8px; }
.frete-cep {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--milk-black);
  border-radius: 3px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.06em;
}
.frete-cep:focus { outline: none; border-color: var(--milk-red); }
.frete-btn {
  height: 40px;
  padding: 0 22px;
  border: 1px solid var(--milk-black);
  border-radius: 999px;
  background: var(--milk-white);
  color: var(--milk-black);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.frete-btn:hover { border-color: var(--milk-red); color: var(--milk-red); }
.frete-btn:disabled { opacity: 0.5; cursor: default; }
.frete-results { display: flex; flex-direction: column; }
.frete-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid #eee;
}
.frete-option:first-child { border-top: 1px solid #eee; }
.frete-option-info { display: flex; flex-direction: column; gap: 2px; }
.frete-option-name { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
.frete-option-days { font-size: 11px; color: #666; }
.frete-option-price { font-size: 12px; font-weight: 700; }
.frete-msg {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--milk-red);
  min-height: 14px;
  margin: 0;
}
.frete-dest {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #666;
  text-transform: lowercase;
  padding-bottom: 6px;
}
