/* ============================================================
   Empório Japa Gourmet — Loja
   Paleta: Âmbar Gourmet · Tipografia: Cormorant Garamond + DM Sans
   ============================================================ */

/* ── Tokens ── */
:root {
  --creme:         #F5F0E8;
  --creme-escuro:  #EDE6D6;
  --marrom:        #6B4226;
  --marrom-escuro: #4A2C18;
  --ambar:         #C8920A;
  --ambar-claro:   #EF9F27;
  --ambar-fundo:   #FAEEDA;
  --preto:         #1A1209;
  --texto:         #2C1A0E;
  --texto-suave:   #7A5C42;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-card: 0 1px 3px rgba(44,26,14,.08), 0 4px 12px rgba(44,26,14,.06);
  --shadow-float: 0 -2px 16px rgba(44,26,14,.14), 0 8px 32px rgba(44,26,14,.12);

  --header-h: 60px;
  --cats-h:   52px;
}

/* ── Reset mínimo ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--creme);
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--marrom-escuro);
  height: var(--header-h);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--ambar);
  background: var(--creme);
  flex-shrink: 0;
  overflow: hidden;
}
.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.logo-sub {
  font-size: 10px;
  color: var(--ambar-claro);
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 500;
}

.header-search {
  flex: 1;
  position: relative;
  max-width: 400px;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--texto-suave);
  pointer-events: none;
}
.header-search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border-radius: var(--radius-md);
  border: none;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 13.5px;
  outline: none;
  transition: background .2s;
}
.header-search input::placeholder { color: rgba(255,255,255,.45); }
.header-search input:focus { background: rgba(255,255,255,.2); }

.cart-btn {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.cart-btn:hover { background: rgba(255,255,255,.18); }
.cart-btn svg { width: 20px; height: 20px; }
.cart-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--ambar);
  color: var(--preto);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Hero ── */
.hero {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: #1A1209;
}
.hero-bg::before {
  content: '';
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(107,66,38,.4) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.hero-bg::after {
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 1px solid rgba(212,160,72,.1);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(26,18,9,.35) 0%, transparent 40%, rgba(26,18,9,.35) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-logo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212,160,72,.45);
  margin-bottom: 14px;
}
.hero-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ambar-claro);
  margin-bottom: 6px;
}
.hero-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(32px, 6vw, 48px);
  font-style: italic;
  font-weight: 400;
  color: #fff;
  line-height: 1.0;
  margin-bottom: 2px;
}
.hero-title em { font-style: italic; }
.hero-title-accent {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(13px, 2vw, 15px);
  font-style: normal;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ambar-claro);
  display: block;
}
.hero-divider {
  width: 36px;
  height: 1px;
  background: rgba(212,160,72,.35);
  margin: 12px auto;
}
.hero-url {
  font-size: 11px;
  letter-spacing: .06em;
  color: rgba(255,255,255,.35);
  margin-bottom: 14px;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(212,160,72,.12);
  border: 1px solid rgba(212,160,72,.28);
  color: rgba(255,255,255,.85);
  font-size: 12px;
  font-weight: 500;
}
.hero-tag svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ── Barra de frete ── */
/* ── Categorias ── */
.cats-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: var(--creme);
  border-bottom: 1px solid var(--creme-escuro);
  height: var(--cats-h);
}
.cats-track {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cats-track::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: 99px;
  border: 1.5px solid var(--creme-escuro);
  background: transparent;
  color: var(--texto-suave);
  font-size: 13px;
  font-weight: 500;
  transition: all .18s;
  white-space: nowrap;
}
.cat-pill:hover {
  border-color: var(--ambar);
  color: var(--marrom-escuro);
  background: var(--ambar-fundo);
}
.cat-pill.active {
  background: var(--marrom-escuro);
  border-color: var(--marrom-escuro);
  color: #fff;
}

/* ── Main ── */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 120px;
}

/* Loading */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 20px;
  color: var(--texto-suave);
  font-size: 14px;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--creme-escuro);
  border-top-color: var(--ambar);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-title { font-size: 17px; font-weight: 600; color: var(--texto); margin-bottom: 6px; }
.empty-sub { font-size: 14px; color: var(--texto-suave); }

/* Seção */
.section { margin-bottom: 40px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.section-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--marrom-escuro);
}
.section-line {
  flex: 1;
  height: 1px;
  background: var(--creme-escuro);
}

/* ── Grid de produtos ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 481px) { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 769px) { .products-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
@media (min-width: 1025px) { .products-grid { grid-template-columns: repeat(5, 1fr); } }

/* ── Card de produto ── */
.product-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s, box-shadow .18s;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(44,26,14,.1), 0 8px 24px rgba(44,26,14,.1);
}

.card-img-wrap { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--creme); }
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.product-card:hover .card-img { transform: scale(1.04); }

.card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: var(--creme-escuro);
  color: var(--texto-suave);
}

.card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  line-height: 1.4;
}
.badge-promo { background: var(--ambar); color: var(--preto); }
.badge-kit   { background: var(--marrom-escuro); color: #fff; }
.badge-destaque { background: rgba(255,255,255,.9); color: var(--marrom-escuro); }

.card-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--texto);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc {
  font-size: 11.5px;
  color: var(--texto-suave);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Variações */
.card-variations { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.var-btn {
  height: 26px;
  padding: 0 9px;
  border-radius: 5px;
  border: 1.5px solid var(--creme-escuro);
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  color: var(--texto-suave);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.var-btn:hover { border-color: var(--ambar); color: var(--marrom-escuro); }
.var-btn.selected {
  border-color: var(--marrom-escuro);
  background: var(--marrom-escuro);
  color: #fff;
}

.card-footer {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.card-price { display: flex; flex-direction: column; gap: 1px; }
.price-original {
  font-size: 11px;
  color: var(--texto-suave);
  text-decoration: line-through;
}
.price-promo {
  font-size: 16px;
  font-weight: 700;
  color: var(--ambar);
}
.price-normal {
  font-size: 16px;
  font-weight: 700;
  color: var(--marrom-escuro);
}

.card-add-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--marrom-escuro);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, transform .12s;
}
.card-add-btn svg { width: 18px; height: 18px; }
.card-add-btn:hover { background: var(--ambar); }
.card-add-btn:active { transform: scale(.9); }
.card-add-btn.added {
  background: #2e7d32;
  animation: pop .25s ease;
}
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ── Barra flutuante ── */
.cart-float {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 95;
  padding: 12px 16px;
  background: linear-gradient(to top, var(--creme) 70%, transparent);
}
.cart-float-btn {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 20px;
  border-radius: var(--radius-xl);
  background: var(--marrom-escuro);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-float);
  transition: background .2s;
}
.cart-float-btn:hover { background: var(--marrom); }
.cart-float-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.cart-float-total {
  margin-left: auto;
  font-size: 15px;
  font-weight: 700;
  color: var(--ambar-claro);
}

/* ── Modal backdrop ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(26,18,9,.55);
  backdrop-filter: blur(3px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Modal sheet ── */
.modal-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: var(--creme);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -4px 32px rgba(44,26,14,.18);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  animation: slideUp .28s cubic-bezier(.32,.72,0,1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@media (min-width: 640px) {
  .modal-sheet {
    max-width: 520px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-radius: var(--radius-xl);
    bottom: 32px;
    animation: scaleIn .22s cubic-bezier(.32,.72,0,1);
  }
}
@keyframes scaleIn {
  from { opacity: 0; transform: translateX(-50%) scale(.95); }
  to   { opacity: 1; transform: translateX(-50%) scale(1); }
}

.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--creme-escuro);
  margin: 10px auto 0;
  flex-shrink: 0;
}
@media (min-width: 640px) { .modal-handle { display: none; } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--creme-escuro);
}
.modal-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--marrom-escuro);
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--creme-escuro);
  color: var(--texto-suave);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s;
}
.modal-close:hover { background: var(--ambar-fundo); color: var(--marrom-escuro); }
.modal-close svg { width: 14px; height: 14px; }

.modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 0 20px 8px;
  overscroll-behavior: contain;
}

.modal-items { padding: 16px 0; }

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--creme-escuro);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--creme-escuro);
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--texto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-var {
  font-size: 12px;
  color: var(--texto-suave);
  margin-top: 1px;
}
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1.5px solid var(--creme-escuro);
  background: transparent;
  color: var(--texto);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all .15s;
}
.qty-btn:hover { border-color: var(--ambar); color: var(--marrom-escuro); }
.qty-btn.remove { border-color: transparent; color: #c0392b; }
.qty-btn.remove:hover { background: #ffeaea; }
.qty-num {
  font-size: 14px;
  font-weight: 600;
  color: var(--texto);
  min-width: 20px;
  text-align: center;
}
.cart-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--marrom-escuro);
  flex-shrink: 0;
  align-self: center;
}

.modal-divider { border: none; border-top: 1px solid var(--creme-escuro); margin: 4px 0; }

/* Entrega */
.entrega-section { padding: 16px 0; }
.entrega-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--texto-suave);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.entrega-tipo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}
.entrega-tipo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--creme-escuro);
  background: #fff;
  color: var(--texto-suave);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  line-height: 1.3;
  text-align: center;
}
.entrega-tipo-icon { font-size: 22px; line-height: 1; }
.entrega-tipo-btn:hover {
  border-color: var(--ambar);
  color: var(--marrom-escuro);
  background: var(--ambar-fundo);
}
.entrega-tipo-btn.active {
  border-color: var(--marrom-escuro);
  background: var(--ambar-fundo);
  color: var(--marrom-escuro);
  font-weight: 600;
}
.modal-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--creme-escuro);
  background: #fff;
  color: var(--texto);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%237A5C42' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.modal-select:focus { border-color: var(--ambar); }

.retirada-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--ambar-fundo);
  font-size: 12.5px;
  color: var(--texto);
  line-height: 1.55;
}
.retirada-info svg { width: 16px; height: 16px; color: var(--ambar); flex-shrink: 0; margin-top: 1px; }

/* Totais */
.totais { padding: 16px 0 8px; display: flex; flex-direction: column; gap: 8px; }
.total-linha {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--texto-suave);
}
.total-linha span:last-child { font-weight: 600; color: var(--texto); }
.total-final {
  font-size: 17px;
  font-weight: 700;
  color: var(--marrom-escuro) !important;
  padding-top: 8px;
  border-top: 1px solid var(--creme-escuro);
  margin-top: 4px;
}
.total-final span { color: var(--marrom-escuro) !important; }

.modal-footer {
  padding: 12px 20px 20px;
  flex-shrink: 0;
  border-top: 1px solid var(--creme-escuro);
}
.btn-whatsapp {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-xl);
  background: #25d366;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .2s, transform .12s;
  box-shadow: 0 4px 16px rgba(37,211,102,.3);
}
.btn-whatsapp svg { width: 22px; height: 22px; }
.btn-whatsapp:hover { background: #1ebe5d; }
.btn-whatsapp:active { transform: scale(.98); }

/* ── Utilitários ── */
[hidden] { display: none !important; }

/* ── Mobile tweaks ── */
@media (max-width: 480px) {
  .logo-text { display: none; }
  .hero { height: 340px; }
  .hero-logo { width: 70px; height: 70px; }
  .hero-title { font-size: 30px; }
  .hero-bg::before { width: 280px; height: 280px; }
  .hero-bg::after { width: 400px; height: 400px; }
}
