/**
 * Vitrine headless v2 — core/base.css
 * Base neutra dos shells de tema (docs/api-gateway-headless-v2.md §10.2).
 * O tema (assets/css/theme.css) sobrescreve as custom properties para
 * definir a identidade visual; o core só garante estrutura, componentes e
 * convenções de movimento (reveals, skeletons, reduced-motion).
 */

:root {
  --v-bg: #ffffff;
  --v-bg-soft: #f6f4f0;
  --v-ink: #1c1c1c;
  --v-ink-soft: #5c5c5c;
  --v-accent: #7b1e2b;
  --v-accent-ink: #ffffff;
  --v-accent-soft: rgba(123, 30, 43, 0.07);
  --v-gold: #c39a5b;
  --v-card: #ffffff;
  --v-line: rgba(0, 0, 0, 0.1);
  --v-radius: 10px;
  --v-radius-lg: 18px;
  --v-font-display: Georgia, 'Times New Roman', serif;
  --v-font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --v-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.06);
  --v-shadow-2: 0 6px 18px rgba(0, 0, 0, 0.09);
  --v-shadow-3: 0 18px 44px rgba(0, 0, 0, 0.16);
  --v-header-h: 76px;
  --v-container: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--v-bg);
  color: var(--v-ink);
  font-family: var(--v-font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.v-lock {
  overflow: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--v-font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

/* ------------------------------------------------------------- layout */
.v-container {
  width: 100%;
  max-width: var(--v-container);
  margin: 0 auto;
  padding: 0 24px;
}

.v-section {
  padding: 72px 0;
}

.v-section-head {
  text-align: center;
  margin-bottom: 44px;
}

.v-section-kicker {
  display: inline-block;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--v-accent);
  margin-bottom: 12px;
}

.v-section-title {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  margin-bottom: 0;
}

.v-section-sub {
  color: var(--v-ink-soft);
  max-width: 640px;
  margin: 14px auto 0;
}

/* ------------------------------------------------------------- botões */
.v-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 28px;
  background: var(--v-accent);
  color: var(--v-accent-ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

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

.v-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.v-btn-ghost {
  background: transparent;
  color: var(--v-accent);
  border-color: var(--v-accent);
}

.v-btn-sm {
  padding: 8px 18px;
  font-size: 0.9rem;
}

/* -------------------------------------------------------------- chips */
.v-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}

.v-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--v-line);
  background: var(--v-card);
  color: var(--v-ink);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  transition: background 0.25s ease, color 0.25s ease,
    border-color 0.25s ease, transform 0.25s ease;
}

.v-chip:hover {
  transform: translateY(-1px);
  border-color: var(--v-accent);
}

.v-chip.is-active {
  background: var(--v-accent);
  border-color: var(--v-accent);
  color: var(--v-accent-ink);
}

.v-chip-count {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* --------------------------------------------------------------- busca */
.v-search {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.v-search input {
  width: min(480px, 100%);
  border: 1px solid var(--v-line);
  background: var(--v-card);
  border-radius: 999px;
  padding: 12px 22px;
  font: inherit;
  color: inherit;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.v-search input:focus {
  border-color: var(--v-accent);
  box-shadow: 0 0 0 3px var(--v-accent-soft);
}

/* -------------------------------------------------------------- grade */
.v-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 26px;
}

/* ------------------------------------------------------------- cartão */
.v-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--v-card);
  border: 1px solid var(--v-line);
  border-radius: var(--v-radius);
  overflow: hidden;
  box-shadow: var(--v-shadow-1);
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.35s ease, border-color 0.35s ease;
}

.v-card:hover,
.v-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--v-shadow-2);
  border-color: var(--v-accent);
  outline: none;
}

.v-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--v-bg-soft);
}

.v-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.v-card:hover .v-card-img {
  transform: scale(1.06);
}

.v-card-noimg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 40%, var(--v-accent-soft), transparent 70%);
}

.v-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px 18px;
  flex: 1;
}

.v-card-cat {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--v-ink-soft);
}

.v-card-name {
  font-size: 1.15rem;
  margin: 0;
  min-height: 2.4em;
}

.v-card-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.v-price {
  font-family: var(--v-font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.v-price-old {
  font-size: 0.95rem;
  font-weight: 400;
  text-decoration: line-through;
  color: var(--v-ink-soft);
}

.v-price-promo {
  color: var(--v-accent);
}

.v-stock {
  font-size: 0.78rem;
  font-weight: 600;
}

.v-stock-out {
  color: #a33;
}

.v-stock-low {
  color: #9a6b1f;
}

.v-card-cta {
  margin-top: auto;
  align-self: flex-start;
}

/* --------------------------------------------------------- skeletons */
.v-skeleton {
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.05) 25%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: v-shimmer 1.4s ease-in-out infinite;
}

.v-skeleton-media {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.v-skeleton-line {
  height: 0.9em;
}

@keyframes v-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ----------------------------------------------------------- stepper */
.v-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--v-line);
  border-radius: 999px;
  overflow: hidden;
}

.v-stepper button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--v-accent);
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.2s ease;
}

.v-stepper button:hover {
  background: var(--v-accent-soft);
}

.v-stepper span {
  min-width: 34px;
  text-align: center;
  font-weight: 600;
}

.v-stepper-sm button {
  width: 28px;
  height: 28px;
  font-size: 1rem;
}

.v-stepper-sm span {
  min-width: 28px;
  font-size: 0.9rem;
}

/* ---------------------------------------------------------- paginação */
.v-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 44px;
}

.v-pager-label {
  font-size: 0.92rem;
  color: var(--v-ink-soft);
}

/* --------------------------------------------------- empty / notice */
.v-empty {
  text-align: center;
  color: var(--v-ink-soft);
  padding: 64px 0;
}

.v-empty h3 {
  font-size: 1.4rem;
}

/* ------------------------------------------------------------- header */
.v-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: var(--v-header-h);
  display: flex;
  align-items: center;
  transition: height 0.35s ease, background 0.35s ease,
    box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}

.v-header.scrolled {
  height: 60px;
  background: color-mix(in srgb, var(--v-bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--v-shadow-2);
}

.v-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: var(--v-container);
  margin: 0 auto;
  padding: 0 24px;
}

.v-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.v-header-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--v-gold);
}

.v-header-name {
  font-family: var(--v-font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.v-header-nav {
  display: flex;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.v-header-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.v-header-nav a:hover {
  opacity: 1;
}

.v-cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--v-line);
  background: var(--v-card);
  border-radius: 999px;
  padding: 9px 18px;
  color: var(--v-ink);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.v-cart-btn:hover {
  border-color: var(--v-accent);
  transform: translateY(-1px);
}

.v-cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--v-accent);
  color: var(--v-accent-ink);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.v-cart-badge.is-empty {
  display: none;
}

@keyframes v-badge-pop {
  0% { transform: scale(0.4); }
  60% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.v-cart-badge.is-pop {
  animation: v-badge-pop 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ------------------------------------------------------------- drawer */
.v-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(440px, 100vw);
  background: var(--v-card);
  z-index: 90;
  transform: translateX(105%);
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--v-shadow-3);
}

.v-drawer.is-open {
  transform: none;
}

.v-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 12, 10, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 80;
}

.v-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

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

.v-drawer-title {
  font-size: 1.3rem;
  margin: 0;
}

.v-drawer-close {
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--v-ink-soft);
  transition: color 0.2s ease;
}

.v-drawer-close:hover {
  color: var(--v-accent);
}

.v-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px;
}

.v-drawer-item {
  display: grid;
  grid-template-columns: 64px 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--v-line);
}

.v-drawer-item-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--v-line);
}

.v-drawer-item-noimg {
  background: var(--v-bg-soft);
}

.v-drawer-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.v-drawer-item-name {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v-drawer-item-price {
  font-size: 0.82rem;
  color: var(--v-ink-soft);
}

.v-drawer-item-line {
  font-weight: 700;
  font-size: 0.92rem;
}

.v-drawer-item-remove {
  border: 0;
  background: transparent;
  color: var(--v-ink-soft);
  font-size: 1.3rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.v-drawer-item-remove:hover {
  color: #a33;
}

/* frete / cupom / totais */
.v-drawer-form {
  padding: 16px 24px;
  border-top: 1px solid var(--v-line);
}

.v-drawer-field {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.v-drawer-field input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--v-line);
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  outline: none;
  transition: border-color 0.25s ease;
}

.v-drawer-field input:focus {
  border-color: var(--v-accent);
}

.v-drawer-notice {
  font-size: 0.88rem;
  color: var(--v-ink-soft);
  margin: 8px 0;
}

.v-drawer-notice-error {
  color: #a33;
}

.v-drawer-quote-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.v-drawer-quote-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  padding: 7px 0;
  border-bottom: 1px dashed var(--v-line);
}

.v-drawer-quote-price {
  font-weight: 700;
  white-space: nowrap;
}

.v-drawer-coupon-state {
  font-size: 0.86rem;
  margin: 8px 0 0;
}

.v-drawer-coupon-success { color: #1d6b45; }
.v-drawer-coupon-error { color: #a33; }
.v-drawer-coupon-info { color: var(--v-ink-soft); }

.v-drawer-totals {
  padding: 14px 24px;
  border-top: 1px solid var(--v-line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v-drawer-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.v-drawer-total-row strong {
  font-size: 1.05rem;
}

.v-drawer-total-row.is-grand {
  border-top: 1px solid var(--v-line);
  padding-top: 10px;
  margin-top: 4px;
}

.v-drawer-checkout {
  margin: 0 24px 22px;
  width: calc(100% - 48px);
}

/* -------------------------------------------------------------- modal */
.v-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 12, 10, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 95;
}

.v-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 96;
  width: min(880px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 48px));
  background: var(--v-card);
  border-radius: var(--v-radius-lg);
  box-shadow: var(--v-shadow-3);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 24px)) scale(0.98);
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-module="product-modal"].is-open .v-modal-backdrop {
  opacity: 1;
  pointer-events: auto;
}

[data-module="product-modal"].is-open .v-modal {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.v-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid var(--v-line);
  border-radius: 50%;
  background: var(--v-card);
  color: var(--v-ink);
  font-size: 1.4rem;
  line-height: 1;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.v-modal-close:hover {
  border-color: var(--v-accent);
  color: var(--v-accent);
  transform: rotate(90deg);
}

.v-modal-media {
  position: relative;
  background: var(--v-bg-soft);
  min-height: 320px;
}

.v-modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v-modal-thumbs {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.v-modal-thumb {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  overflow: hidden;
  background: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.v-modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v-modal-thumb:hover {
  transform: scale(1.08);
  border-color: var(--v-gold);
}

.v-modal-body {
  padding: 34px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.v-modal-name {
  font-size: 1.7rem;
  margin: 0;
}

.v-modal-desc {
  color: var(--v-ink-soft);
  white-space: pre-wrap;
  margin: 0;
}

.v-modal-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------- toasts */
.v-toast-stack {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.v-toast {
  background: #2a2a2a;
  color: #fff;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 0.92rem;
  box-shadow: var(--v-shadow-2);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: min(480px, calc(100vw - 32px));
  text-align: center;
}

.v-toast.is-visible {
  opacity: 1;
  transform: none;
}

.v-toast-success {
  background: #1d6b45;
}

.v-toast-error {
  background: #9c2f2f;
}

/* --------------------------------------------- progresso / back-to-top */
.v-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--v-gold);
  z-index: 110;
}

.v-backtop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--v-gold);
  background: var(--v-card);
  color: var(--v-accent);
  font-size: 1.2rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: var(--v-shadow-2);
}

.v-backtop.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

/* -------------------------------------------------- scroll reveals */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--v-stagger, 0ms);
  will-change: opacity, transform;
}

html.js [data-reveal].v-in {
  opacity: 1;
  transform: none;
}

/* -------------------------------------------------------- responsivo */
@media (max-width: 760px) {
  .v-header-nav {
    display: none;
  }

  .v-section {
    padding: 52px 0;
  }

  .v-modal {
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 24px);
  }

  .v-modal-media {
    min-height: 220px;
    max-height: 300px;
  }
}

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

  html.js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}