/* =========================================================
   DREAMADE — Mobile-first e-commerce
   Paleta:
     Layer Midnight  #25243B
     Creative Violet #6F5BD3
     Polymer Coral   #F07F73
     Digital Mint    #70C7B7
     Soft Resin      #F3EEE6
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --midnight:      #25243B;
  --violet:        #6F5BD3;
  --violet-hover:  #5B48BF;
  --violet-light:  rgba(111, 91, 211, 0.08);
  --coral:         #F07F73;
  --mint:          #70C7B7;
  --resin:         #F3EEE6;

  --bg:            #F3EEE6;
  --surface:       #FFFFFF;
  --surface-2:     #FAF6F0;
  --border:        rgba(37, 36, 59, 0.10);
  --border-strong: rgba(37, 36, 59, 0.20);

  --text:          #25243B;
  --text-2:        #4A4863;
  --text-dim:      #6B6982;

  --success:       #2E9E85;
  --warning:       #D97706;
  --danger:        #D95C4F;

  --font-display:  'Sora', system-ui, sans-serif;
  --font-body:     'Inter', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --radius:        12px;
  --radius-sm:     8px;
  --radius-pill:   999px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0px, transparent 3px,
    rgba(37, 36, 59, 0.03) 3px, rgba(37, 36, 59, 0.03) 4px
  );
  color: var(--text);
  font: 400 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

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

p { margin: 0 0 1em; color: var(--text-2); }

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}

/* ---- Container ---- */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container { padding: 0 24px; }
}

/* ---- Faixa de camadas Dreamade ---- */
.layer-strip {
  height: 3px;
  background: linear-gradient(90deg,
    var(--violet) 0%, var(--violet) 33.33%,
    var(--coral) 33.33%, var(--coral) 66.66%,
    var(--mint) 66.66%, var(--mint) 100%);
}

/* ============================================
   HEADER — mobile first
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(243, 238, 230, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 12px;
}

.logo img { height: 26px; width: auto; }

/* Nav — escondida no mobile, exibida no tablet+ */
.nav-links {
  display: none;
  gap: 28px;
  align-items: center;
  flex: 1;
  margin-left: 32px;
}
.nav-links a {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }

/* Menu mobile hamburger */
.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}
.mobile-menu-toggle svg { width: 22px; height: 22px; }

.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(37, 36, 59, 0.45);
}

.mobile-nav.open { display: block; }

.mobile-nav__panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 280px;
  background: var(--surface);
  padding: 24px;
  box-shadow: -8px 0 32px rgba(37, 36, 59, 0.12);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav__panel .close-btn {
  align-self: flex-end;
  background: none; border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  margin-bottom: 16px;
}

.mobile-nav__panel a {
  display: block;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Esconder botões desktop no mobile */
.header-desktop-only { display: none; }
.header-user-name {
  display: none;
  font-size: 13px;
}

.icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}
.icon-btn:hover { border-color: var(--violet); }
.icon-btn svg { width: 18px; height: 18px; }

.cart-badge {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--violet);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
}

@media (min-width: 768px) {
  .site-header .container { height: 74px; }
  .logo img { height: 32px; }
  .nav-links { display: flex; }
  .mobile-menu-toggle { display: none; }
  .header-desktop-only { display: inline-flex; }
  .header-user-name { display: inline; }
}

/* ============================================
   BOTÕES
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-hover); }

.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--violet); color: var(--violet); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }

.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(217, 92, 79, 0.06); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ============================================
   HERO — mobile first
   ============================================ */
.hero {
  padding: 40px 0 32px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--violet);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 500;
  margin-bottom: 14px;
}

.hero h1 {
  font-weight: 700;
  font-size: 32px;
  color: var(--midnight);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero .lede {
  font-size: 15px;
  color: var(--text-2);
  margin: 0 0 24px;
  max-width: 460px;
}

/* Pilha de camadas — mobile: horizontal, desktop: vertical lateral */
.hero-layers {
  display: flex;
  gap: 3px;
  margin-bottom: 20px;
}
.hero-layers span {
  display: block;
  height: 6px;
  flex: 1;
  border-radius: 2px;
}
.hero-layers span:nth-child(1) { background: var(--violet); opacity: 0.85; }
.hero-layers span:nth-child(2) { background: var(--violet); }
.hero-layers span:nth-child(3) { background: var(--coral); }
.hero-layers span:nth-child(4) { background: var(--coral); opacity: 0.9; }
.hero-layers span:nth-child(5) { background: var(--mint); }
.hero-layers span:nth-child(6) { background: var(--mint); opacity: 0.85; }

@media (min-width: 768px) {
  .hero { padding: 64px 0 36px; }
  .hero h1 { font-size: 44px; }
  .hero .lede { font-size: 16px; }

  .hero .container {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 36px;
    align-items: start;
  }

  .hero-layers {
    flex-direction: column;
    padding-top: 10px;
    margin-bottom: 0;
  }
  .hero-layers span { height: 8px; flex: none; }
}

@media (min-width: 1024px) {
  .hero h1 { font-size: 52px; }
}

/* ============================================
   FILTRO DROPDOWN
   ============================================ */
.filter-bar {
  padding: 16px 0 8px;
}

.filter-dropdown {
  position: relative;
  display: inline-block;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.filter-toggle:hover { border-color: var(--violet); }
.filter-toggle .chevron {
  transition: transform 0.2s;
  color: var(--text-dim);
}
.filter-dropdown.open .filter-toggle {
  border-color: var(--violet);
}
.filter-dropdown.open .filter-toggle .chevron {
  transform: rotate(180deg);
}

.filter-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(37, 36, 59, 0.10);
  z-index: 30;
  overflow: hidden;
}
.filter-dropdown.open .filter-menu { display: block; }

.filter-option {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-2);
  transition: background 0.1s;
  border-bottom: 1px solid var(--border);
}
.filter-option:last-child { border-bottom: none; }
.filter-option:hover { background: var(--surface-2); }
.filter-option.active {
  color: var(--violet);
  font-weight: 600;
  background: var(--violet-light);
}

/* ============================================
   GRID DE PRODUTOS
   ============================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px 0 48px;
}

@media (min-width: 640px) {
  .product-grid { gap: 16px; }
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 24px 0 64px;
  }
}

@media (min-width: 1100px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(37, 36, 59, 0.07);
}

.product-card__img {
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  overflow: hidden;
}

.product-card__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.product-card:hover .product-card__img img { transform: scale(1.04); }

.product-card__img .no-image {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
}

.product-card__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

@media (min-width: 768px) {
  .product-card__body { padding: 14px 16px 16px; gap: 6px; }
}

.product-card__cat {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 500;
}

.product-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .product-card__name { font-size: 15px; }
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
}

.price {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}

@media (min-width: 768px) {
  .price { font-size: 15px; }
}

.color-dots { display: flex; gap: 3px; }

.color-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(37, 36, 59, 0.12);
}

@media (min-width: 768px) {
  .color-dot { width: 12px; height: 12px; }
}

/* ============================================
   SELETOR DE COR (pastilhas de filamento)
   ============================================ */
.filament-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.filament-swatch {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.15),
              inset 0 2px 3px rgba(255,255,255,0.25),
              0 0 0 1px rgba(37, 36, 59, 0.08);
  -webkit-tap-highlight-color: transparent;
}
.filament-swatch:hover { transform: scale(1.08); }
.filament-swatch.selected {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(111, 91, 211, 0.18),
              inset 0 -3px 6px rgba(0,0,0,0.15);
}
.filament-swatch input {
  position: absolute;
  opacity: 0;
  width: 100%; height: 100%;
  cursor: pointer;
}

.filament-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* ============================================
   PÁGINA DE PRODUTO — mobile first
   No mobile: título/descrição → imagem → cor → preço → botão
   No desktop: info à esquerda, galeria à direita
   ============================================ */
.product-page {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 24px 0 48px;
}

.product-info {
  display: flex;
  flex-direction: column;
}

.product-info h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--midnight);
  order: 1;
}

.product-info .product-card__cat { order: 0; }
.product-info > p { order: 2; }
.product-info .product-dimensions { order: 3; margin-bottom: 16px; }

.product-gallery__main {
  order: 4;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.product-gallery__main img { width: 100%; height: 100%; object-fit: cover; }

.product-info .price {
  order: 5;
  font-size: 24px;
  display: block;
  margin: 6px 0 16px;
  color: var(--midnight);
}

.product-info .msg-error { order: 6; }
.product-info form { order: 7; }
.product-info form .form-group { order: 1; } /* Cor logo abaixo da imagem */
.product-info form .qty-control { order: 2; }
.product-info form .btn { order: 3; }

.product-dimensions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

@media (min-width: 768px) {
  .product-info h1 { font-size: 28px; }
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}
.qty-control button {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.qty-control button:hover { border-color: var(--violet); color: var(--violet); }
.qty-control input {
  width: 48px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
}

/* ============================================
   CARRINHO
   ============================================ */
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

@media (min-width: 768px) {
  .cart-item { grid-template-columns: 72px 1fr auto; gap: 14px; }
}

.cart-item__img {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.cart-item__img img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 768px) {
  .cart-item__img { width: 72px; height: 72px; }
}

.cart-item__name { font-weight: 600; margin-bottom: 4px; color: var(--text); font-size: 14px; }

.cart-item__color {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.cart-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  position: relative;
}

@media (min-width: 768px) {
  .cart-summary {
    position: sticky;
    top: 95px;
    height: fit-content;
    padding: 24px;
  }
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-2);
}

.summary-row.total {
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  font-family: var(--font-mono);
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 14px;
}

/* ============================================
   FORMULÁRIOS
   ============================================ */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group .hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

input[type=text], input[type=tel], input[type=password], input[type=number],
input[type=email], input[type=date], input[type=file], input[type=color],
textarea, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px; /* 16px evita zoom automático no iOS */
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--violet);
  outline: none;
  box-shadow: 0 0 0 3px rgba(111, 91, 211, 0.12);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 480px) {
  .radio-group { flex-direction: row; gap: 12px; }
}

.radio-option {
  display: flex; align-items: center; gap: 8px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex: 1;
  background: var(--surface);
  font-size: 14px;
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.radio-option:hover { border-color: var(--violet); }
.radio-option.selected {
  border-color: var(--violet);
  background: var(--violet-light);
  color: var(--violet);
  font-weight: 600;
}

/* ============================================
   PIX BOX
   ============================================ */
.pix-box {
  background: var(--surface);
  border: 1px dashed var(--violet);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  margin: 20px 0;
}

.pix-key {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--bg);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
  word-break: break-all;
  border: 1px solid var(--border);
  color: var(--text);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 40px;
  color: var(--text-dim);
  font-size: 12px;
}
.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.site-footer .brand-mark img { height: 20px; }

@media (min-width: 768px) {
  .site-footer .container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
  .site-footer .brand-mark img { height: 22px; }
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-state h3 { color: var(--text); margin-bottom: 8px; font-weight: 600; }

/* ============================================
   MENSAGENS
   ============================================ */
.msg-error {
  background: rgba(217, 92, 79, 0.08);
  border-left: 3px solid var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 14px;
  margin-bottom: 16px;
}
.msg-success {
  background: rgba(46, 158, 133, 0.08);
  border-left: 3px solid var(--success);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--success);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ============================================
   LINK DE DESTAQUE
   ============================================ */
a.link-accent { color: var(--violet); font-weight: 500; }
a.link-accent:hover { text-decoration: underline; }

/* ============================================
   UTILITÁRIOS
   ============================================ */
.mono { font-family: var(--font-mono); }
.text-dim { color: var(--text-dim); }
.text-2 { color: var(--text-2); }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }

/* ============================================
   SAFE AREA (notch de iPhones etc.)
   ============================================ */
@supports (padding-top: env(safe-area-inset-top)) {
  .site-header { padding-top: env(safe-area-inset-top); }
  .site-footer { padding-bottom: env(safe-area-inset-bottom); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
 @media (min-width: 768px) { .hero-eyebrow, .hero h1, .hero .lede { grid-column: 2; } }