/*
  Marte Crochê - estilos principais

  Estrutura do arquivo:
  1. Variáveis visuais
  2. Reset e base
  3. Botões e componentes globais
  4. Header estilo loja premium
  5. Hero/carrossel
  6. Vitrine de produtos
  7. Cashback, conteúdo e rodapé
  8. Carrinho, checkout e busca
  9. Responsivo
*/

/* 1. Variáveis visuais */
:root {
  --brand-wine: #7d0d20;
  --brand-wine-dark: #3a0710;
  --brand-cream: #f4eadf;
  --brand-cream-soft: #fbf7f2;
  --brand-caramel: #9a4d2d;
  --brand-black: #1c1b1a;
  --brand-muted: #75675f;
  --brand-border: rgba(28, 27, 26, 0.12);
  --brand-shadow: 0 24px 70px rgba(58, 7, 16, 0.12);
  --max-width: 1360px;
  --font-display: "Times New Roman", Georgia, serif;
  --font-condensed: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  --font-body: Arial, Helvetica, sans-serif;
}

/* 2. Reset e base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--brand-black);
  background: #fff;
  font-family: var(--font-body);
}
body.is-locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 1000;
  padding: 12px 16px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand-wine);
}
.skip-link:focus { top: 12px; }

.section-shell {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-wine);
  font-family: var(--font-condensed);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* 3. Botões e componentes globais */
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-condensed);
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}
.button:hover { transform: translateY(-2px); }
.button--primary { color: #fff; background: var(--brand-wine); }
.button--primary:hover { background: var(--brand-wine-dark); }
.button--light { color: var(--brand-wine); background: var(--brand-cream); }
.button--ghost { color: var(--brand-wine); border-color: var(--brand-border); background: #fff; }
.button--full { width: 100%; }

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--brand-border);
  border-radius: 50%;
  color: var(--brand-black);
  background: #fff;
  font-size: 1.5rem;
  line-height: 1;
}

/* 4. Header estilo loja premium */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--brand-border);
  backdrop-filter: blur(12px);
}
.announcement-bar {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  color: #fff;
  background: #272727;
  text-align: center;
}
.announcement-bar p {
  margin: 0;
  max-width: 900px;
  font-family: var(--font-condensed);
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.header-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 80px;
  width: min(var(--max-width), calc(100% - 28px));
  margin: 0 auto;
}
.brand-logo {
  justify-self: center;
  width: 168px;
  padding: 6px 0;
}
.header-actions {
  display: flex;
  justify-self: end;
  gap: 16px;
  align-items: center;
}
.header-icon {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  color: var(--brand-black);
  background: transparent;
}
.header-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cart-trigger span {
  position: absolute;
  right: -6px;
  top: -5px;
  display: grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--brand-wine);
  font-size: 0.68rem;
  font-weight: 900;
}
.header-icon--menu {
  display: none;
  justify-self: start;
}
.header-icon--menu span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
}
.main-nav, .category-nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  width: min(var(--max-width), calc(100% - 28px));
  margin: 0 auto;
  font-family: var(--font-condensed);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: none;
}
.main-nav {
  padding: 0 0 18px;
  font-size: 0.92rem;
}
.main-nav a { white-space: nowrap; }
.main-nav a:hover, .category-link:hover { color: var(--brand-wine); }
.category-nav {
  gap: 24px;
  padding: 0 0 22px;
  overflow-x: auto;
  text-transform: uppercase;
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }
.category-link {
  border: 0;
  color: var(--brand-black);
  background: transparent;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.category-link.is-active { color: var(--brand-wine); }

/* 5. Hero/carrossel */
.hero-carousel {
  position: relative;
  min-height: clamp(460px, 62vw, 760px);
  overflow: hidden;
  background: var(--brand-wine) url('../assets/hero/hero-marte.svg') center / cover no-repeat;
}
.hero-slide {
  position: relative;
  display: grid;
  min-height: inherit;
  align-items: center;
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 740px;
  color: #fff;
}
.hero-kicker {
  margin: 0 0 20px;
  font-family: var(--font-condensed);
  font-size: clamp(1rem, 1.4vw, 1.3rem);
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hero-content h1 {
  margin: 0;
  font-family: var(--font-condensed);
  font-size: clamp(4rem, 13vw, 11rem);
  line-height: 0.86;
  letter-spacing: -0.08em;
  text-transform: uppercase;
}
.hero-content p:not(.hero-kicker) {
  max-width: 560px;
  margin: 22px 0 28px;
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  line-height: 1.5;
}
.hero-submark {
  position: absolute;
  right: 5%;
  bottom: 5%;
  width: min(300px, 28vw);
  opacity: 0.72;
  border-radius: 34px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18);
}
.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 2rem;
  transform: translateY(-50%);
}
.hero-arrow--left { left: 14px; }
.hero-arrow--right { right: 14px; }

/* 6. Vitrine de produtos */
.storefront { padding: 64px 0 80px; }
.section-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}
.section-title-row h2, .cashback-card h2, .about-section h2, .info-grid h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.95;
  color: var(--brand-wine-dark);
}
.section-title-row > p {
  max-width: 420px;
  margin: 0;
  color: var(--brand-muted);
  line-height: 1.6;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 46px 22px;
}
.product-card {
  position: relative;
  min-width: 0;
}
.product-card__media {
  position: relative;
  display: grid;
  min-height: 320px;
  place-items: center;
  overflow: hidden;
  background: #fff;
}
.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 220ms ease;
}
.product-card:hover .product-card__media img { transform: scale(1.035); }
.gift-badge {
  position: absolute;
  right: 22px;
  top: 16px;
  z-index: 2;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #ef5a5a;
  font-family: var(--font-condensed);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
  outline: 8px solid rgba(239, 90, 90, 0.11);
}
.add-floating {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--brand-black);
  background: #fff;
  box-shadow: 0 14px 40px rgba(0,0,0,0.12);
}
.add-floating svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.product-card__body { padding: 16px 8px 0; }
.product-card__body h3 {
  margin: 0 0 8px;
  font-family: var(--font-condensed);
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.product-card__price { font-size: 0.98rem; }
.product-card__cashback {
  margin-top: 8px;
  color: var(--brand-wine);
  font-size: 0.82rem;
  font-weight: 700;
}
.product-card__description {
  margin: 8px 0 0;
  color: var(--brand-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.empty-results {
  grid-column: 1 / -1;
  padding: 50px;
  border: 1px solid var(--brand-border);
  border-radius: 28px;
  text-align: center;
}

/* 7. Cashback, conteúdo e rodapé */
.cashback-band {
  display: grid;
  grid-template-columns: 0.8fr 1.3fr 1fr;
  gap: 20px;
  padding: 0 0 80px;
}
.cashback-card {
  min-height: 260px;
  padding: 34px;
  border: 1px solid var(--brand-border);
  border-radius: 32px;
  background: var(--brand-cream-soft);
  box-shadow: var(--brand-shadow);
}
.cashback-card--brand {
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  background: var(--brand-wine);
}
.cashback-card--brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cashback-card--text p:not(.eyebrow), .about-section p, .info-grid p {
  color: var(--brand-muted);
  line-height: 1.75;
}
.cashback-balance {
  display: inline-flex;
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand-wine);
  font-weight: 900;
}
.cashback-card--rules ul {
  margin: 18px 0 0;
  padding-left: 18px;
  color: var(--brand-muted);
  line-height: 1.8;
}
.about-section {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 34px;
  align-items: center;
  padding: 70px 0;
  border-top: 1px solid var(--brand-border);
  border-bottom: 1px solid var(--brand-border);
}
.about-stats {
  display: grid;
  gap: 14px;
}
.about-stats article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-radius: 24px;
  background: var(--brand-cream-soft);
}
.about-stats strong {
  color: var(--brand-wine);
  font-family: var(--font-display);
  font-size: 2.2rem;
}
.about-stats span { font-weight: 800; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 70px 0;
}
.info-grid article {
  padding: 26px;
  border: 1px solid var(--brand-border);
  border-radius: 26px;
}
.info-grid h2 { font-size: 1.7rem; }
details {
  padding: 16px 0;
  border-bottom: 1px solid var(--brand-border);
}
summary { cursor: pointer; font-weight: 900; }
.site-footer {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 70px 20px;
  color: var(--brand-cream);
  background: var(--brand-wine);
  text-align: center;
}
.site-footer img { width: 150px; filter: brightness(2.2) saturate(0.2); }
.site-footer p { margin: 0; opacity: 0.86; }

/* 8. Carrinho, checkout e busca */
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}
.cart-drawer.is-open { pointer-events: auto; }
.cart-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 180ms ease;
}
.cart-drawer.is-open .cart-drawer__overlay { opacity: 1; }
.cart-drawer__panel {
  position: absolute;
  right: 0;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(460px, 100%);
  height: 100%;
  padding: 24px;
  background: #fff;
  transform: translateX(102%);
  transition: transform 220ms ease;
}
.cart-drawer.is-open .cart-drawer__panel { transform: translateX(0); }
.cart-drawer__header, .checkout-form__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}
.cart-drawer__header h2, .checkout-form__header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--brand-wine-dark);
}
.cart-items {
  display: grid;
  align-content: start;
  gap: 16px;
  overflow-y: auto;
  padding: 22px 0;
}
.cart-item {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--brand-border);
  border-radius: 20px;
}
.cart-item img {
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--brand-cream-soft);
  object-fit: contain;
}
.cart-item h3 { margin: 0 0 8px; font-size: 0.95rem; }
.cart-item__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.quantity-controls {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
}
.quantity-controls button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
}
.quantity-controls span { min-width: 22px; text-align: center; font-weight: 900; }
.empty-cart {
  padding: 32px;
  border: 1px dashed var(--brand-border);
  border-radius: 22px;
  color: var(--brand-muted);
  text-align: center;
}
.cart-summary {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--brand-border);
}
.cashback-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--brand-muted);
}
.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.summary-line--total {
  padding-top: 12px;
  border-top: 1px solid var(--brand-border);
  font-size: 1.25rem;
}
.cashback-preview {
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--brand-wine);
  background: var(--brand-cream-soft);
  font-weight: 800;
}
dialog {
  width: min(720px, calc(100% - 26px));
  border: 0;
  border-radius: 28px;
  padding: 0;
  box-shadow: 0 28px 90px rgba(0,0,0,0.24);
}
dialog::backdrop { background: rgba(0,0,0,0.44); }
.checkout-form, .order-box, .search-box {
  display: grid;
  gap: 22px;
  padding: 28px;
  background: #fff;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid__wide { grid-column: 1 / -1; }
.checkout-form label, .search-box label {
  display: grid;
  gap: 8px;
  color: var(--brand-muted);
  font-weight: 800;
}
input, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  padding: 0 14px;
  background: #fff;
}
.checkout-note {
  padding: 14px 16px;
  border-radius: 18px;
  color: var(--brand-muted);
  background: var(--brand-cream-soft);
  line-height: 1.55;
}
.order-box pre {
  max-height: 340px;
  overflow: auto;
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: var(--brand-cream-soft);
  white-space: pre-wrap;
  line-height: 1.55;
}
.order-actions { display: grid; gap: 10px; }

/* 9. Responsivo */
@media (max-width: 1080px) {
  .main-nav { gap: 16px; font-size: 0.85rem; overflow-x: auto; justify-content: flex-start; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cashback-band, .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .announcement-bar p { font-size: 0.74rem; }
  .header-main { min-height: 68px; }
  .header-icon--menu { display: grid; }
  .brand-logo { width: 140px; }
  .header-actions { gap: 8px; }
  .main-nav {
    display: none;
    width: 100%;
    padding: 12px 18px 18px;
    border-top: 1px solid var(--brand-border);
    flex-direction: column;
    text-align: center;
  }
  .main-nav.is-open { display: flex; }
  .category-nav { justify-content: flex-start; padding: 0 18px 16px; }
  .hero-carousel { min-height: 560px; }
  .hero-slide { width: calc(100% - 36px); }
  .hero-submark { right: 18px; bottom: 20px; width: 170px; }
  .hero-arrow { top: auto; bottom: 16px; transform: none; }
  .hero-arrow--left { left: 20px; }
  .hero-arrow--right { right: 20px; }
  .section-title-row, .about-section { grid-template-columns: 1fr; display: grid; align-items: start; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 14px; }
  .product-card__media { min-height: 250px; }
  .cashback-band, .info-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .header-actions .header-icon:not(.cart-trigger) { display: none; }
  .brand-logo { width: 128px; }
  .hero-content h1 { font-size: 4.2rem; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card__media { min-height: 300px; }
  .gift-badge { right: 16px; }
  .cashback-card { padding: 24px; }
  .cart-drawer__panel { padding: 18px; }
}

.footer-admin-link {
  color: var(--brand-cream);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Avisos, login e histórico */
.soft-notice {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  width: min(680px, calc(100% - 28px));
  padding: 13px 16px;
  border-radius: 999px;
  background: #601523;
  color: #fffaf4;
  box-shadow: 0 18px 48px rgba(30, 9, 12, 0.22);
  text-align: center;
  font-weight: 700;
}

.checkout-login-hint {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(96, 21, 35, 0.08);
  color: var(--wine, #601523);
  font-size: 0.9rem;
  line-height: 1.45;
}

.checkout-login-hint a {
  color: inherit;
  font-weight: 800;
}

.account-body {
  background: linear-gradient(135deg, #fff8f1 0%, #f3e2d2 100%);
  min-height: 100vh;
}

.account-header {
  position: sticky;
  top: 0;
  z-index: 20;
}

.account-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 70px;
}

.account-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  align-items: center;
  gap: 26px;
  padding: clamp(24px, 4vw, 46px);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(96, 21, 35, 0.12);
  box-shadow: 0 24px 70px rgba(75, 28, 21, 0.12);
}

.account-hero h1 {
  margin: 0 0 10px;
  color: var(--wine, #601523);
  font-family: var(--display-font, Georgia, serif);
  font-size: clamp(2.2rem, 8vw, 6rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.account-hero p:not(.eyebrow) {
  max-width: 620px;
  color: rgba(48, 26, 26, 0.72);
  font-size: 1.04rem;
}

.account-hero img {
  width: 100%;
  max-height: 210px;
  object-fit: contain;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.account-card,
.account-dashboard {
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(96, 21, 35, 0.12);
  box-shadow: 0 18px 60px rgba(75, 28, 21, 0.1);
}

.account-card {
  padding: 24px;
}

.account-card h2,
.account-dashboard h2 {
  margin: 0 0 16px;
  color: var(--wine, #601523);
}

.account-dashboard {
  margin-top: 22px;
  padding: 24px;
}

.account-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.account-dashboard-header p {
  color: rgba(48, 26, 26, 0.68);
  margin: 4px 0 0;
}

.account-metrics {
  margin-bottom: 20px;
}

.account-card--wide {
  padding: 22px;
}

.account-orders {
  display: grid;
  gap: 12px;
}

.account-order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  background: #fffaf4;
  border: 1px solid rgba(96, 21, 35, 0.1);
}

.account-order-card h3 {
  margin: 0 0 5px;
  color: var(--wine, #601523);
}

.account-order-card small,
.account-order-card p,
.account-order-card span {
  color: rgba(48, 26, 26, 0.65);
}

.account-order-card p {
  margin: 8px 0 0;
}

.account-order-card strong {
  display: block;
  color: var(--wine, #601523);
  font-size: 1.1rem;
  text-align: right;
}

.database-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(96, 21, 35, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--wine, #601523);
  font-size: 0.82rem;
  font-weight: 700;
}

.database-mode::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #b56a38;
  box-shadow: 0 0 0 4px rgba(181, 106, 56, 0.13);
}

.database-mode.is-online::before {
  background: #2f7d46;
  box-shadow: 0 0 0 4px rgba(47, 125, 70, 0.13);
}

@media (max-width: 760px) {
  .account-hero,
  .account-grid,
  .account-order-card {
    grid-template-columns: 1fr;
  }

  .account-hero img {
    max-width: 160px;
  }

  .account-dashboard-header {
    flex-direction: column;
  }

  .account-order-card strong {
    text-align: left;
  }
}
