/* Atelier Design System 2026 — Dark mode end-to-end */
:root {
  --ink: #141210;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --border: rgba(210, 201, 184, 0.55);
  --muted: #7d7059;
  --radius: 1.15rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wa: #25D366;
}
html.dark {
  --ink: #f5f2eb;
  --surface: #1c1915;
  --surface-2: #28241f;
  --border: rgba(84, 76, 64, 0.65);
  --muted: #b5a890;
}
html { scroll-behavior: smooth; }
body { min-height: 100vh; background: var(--surface-2); color: var(--ink); }
::selection { background: #d2c9b8; color: #141210; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.55rem; background: #141210; color: #fff; font-weight: 500;
  font-size: 0.9rem; border-radius: 9999px; transition: all 0.22s var(--ease);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
html.dark .btn-primary { background: #f5f2eb; color: #141210; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px -8px rgba(20,18,16,.3); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.55rem; border: 1px solid var(--border); font-weight: 500;
  font-size: 0.9rem; border-radius: 9999px; transition: all 0.2s var(--ease);
  background: transparent; color: inherit;
}
.btn-secondary:hover { background: var(--surface); }

.btn-wa {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem; background: var(--wa); color: #fff; font-weight: 600;
  font-size: 0.9rem; border-radius: 9999px; transition: all 0.2s var(--ease);
  box-shadow: 0 6px 20px -4px rgba(37,211,102,.45);
}
.btn-wa:hover { filter: brightness(1.05); transform: translateY(-1px); }

.card {
  background: var(--surface); border-radius: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(40,36,31,.04);
  overflow: hidden; transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}
html.dark .card { box-shadow: 0 1px 0 rgba(255,255,255,.03); }
.card-hover:hover { box-shadow: 0 18px 48px -14px rgba(40,36,31,.14); transform: translateY(-2px); }

.input {
  width: 100%; padding: 0.8rem 1rem; border-radius: 0.9rem;
  border: 1px solid var(--border); background: var(--surface); color: inherit;
  font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  outline: none; border-color: #b5a890;
  box-shadow: 0 0 0 3px rgba(181,168,144,.28);
}

.line-clamp-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,249,247,.9);
  backdrop-filter: blur(18px) saturate(1.25);
  border-bottom: 1px solid var(--border);
}
html.dark .site-header { background: rgba(28,25,21,.92); }
.nav-link {
  font-size: 0.85rem; font-weight: 500; letter-spacing: 0.02em;
  color: var(--muted); transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--ink); }

.product-card .product-img { transition: transform 0.65s var(--ease); }
.product-card:hover .product-img { transform: scale(1.05); }

/* WhatsApp float */
.wa-float-wrap {
  position: fixed; bottom: 1.4rem; right: 1.4rem; z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem;
}
.wa-float {
  width: 3.55rem; height: 3.55rem; border-radius: 9999px;
  background: var(--wa); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 32px -4px rgba(37,211,102,.5);
  transition: transform 0.25s var(--ease);
}
.wa-float:hover { transform: scale(1.08); }
.wa-float-label {
  background: #141210; color: #fff; font-size: 0.72rem; font-weight: 600;
  padding: 0.4rem 0.8rem; border-radius: 9999px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  animation: waPulse 2.6s ease-in-out infinite; white-space: nowrap;
}
html.dark .wa-float-label { background: #f5f2eb; color: #141210; }
@keyframes waPulse {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: 0.88; transform: translateY(-3px); }
}

/* Admin shell */
.admin-layout {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem;
}
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
}
.admin-side {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 1.35rem; padding: 1.25rem; height: fit-content;
  position: sticky; top: 5.5rem;
}
.admin-side-link {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; text-align: left; padding: 0.7rem 0.85rem;
  border-radius: 0.85rem; font-size: 0.88rem; font-weight: 500;
  color: var(--muted); transition: all 0.18s;
}
.admin-side-link:hover { background: var(--surface-2); color: var(--ink); }
.admin-side-link.active {
  background: #141210; color: #fff;
}
html.dark .admin-side-link.active { background: #f5f2eb; color: #141210; }

.admin-hero {
  background: linear-gradient(135deg, #141210 0%, #2a2621 50%, #3d3630 100%);
  color: #fff; border-radius: 1.5rem; padding: 1.6rem 1.75rem;
  position: relative; overflow: hidden;
}
html.dark .admin-hero {
  background: linear-gradient(135deg, #0d0c0a 0%, #1c1915 50%, #2c2824 100%);
  border: 1px solid rgba(255,255,255,.06);
}
.admin-hero::after {
  content: ''; position: absolute; right: -15%; top: -50%;
  width: 45%; height: 200%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.07) 0%, transparent 70%);
  pointer-events: none;
}
.admin-stat {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1);
  border-radius: 1rem; padding: 0.75rem 1.1rem; text-align: center; min-width: 88px;
}
.admin-stat strong { display: block; font-size: 1.35rem; font-weight: 600; }
.admin-stat span { font-size: 0.62rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.08em; }

/* Admin product grid */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.15rem;
}
.admin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 1.25rem; overflow: hidden;
  transition: box-shadow 0.3s, border-color 0.2s, transform 0.25s;
  display: flex; flex-direction: column;
}
.admin-card:hover {
  box-shadow: 0 16px 40px -12px rgba(40,36,31,.14);
  border-color: #d2c9b8;
  transform: translateY(-2px);
}
html.dark .admin-card:hover { border-color: #665b4a; }
.admin-card-img {
  position: relative; aspect-ratio: 3/4; background: var(--surface-2); overflow: hidden;
}
.admin-card-img img { width: 100%; height: 100%; object-fit: cover; }
.admin-card-actions {
  position: absolute; inset: auto 0 0 0;
  padding: 2.5rem 0.75rem 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  display: flex; gap: 0.4rem; justify-content: center;
  opacity: 0; transform: translateY(6px); transition: all 0.25s var(--ease);
}
.admin-card:hover .admin-card-actions { opacity: 1; transform: translateY(0); }
.admin-card-btn {
  width: 2.35rem; height: 2.35rem; border-radius: 9999px;
  background: rgba(255,255,255,.95); color: #141210;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.95rem; transition: transform 0.15s;
}
.admin-card-btn:hover { transform: scale(1.08); }
.admin-card-btn.danger { background: #fef2f2; color: #dc2626; }
.admin-card-body { padding: 1rem 1.05rem 1.15rem; flex: 1; display: flex; flex-direction: column; }

.upload-zone {
  border: 2px dashed var(--border); border-radius: 1.25rem; padding: 1.75rem;
  text-align: center; cursor: pointer; transition: all 0.25s; background: var(--surface-2);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: #141210; background: var(--surface);
}
html.dark .upload-zone:hover, html.dark .upload-zone.dragover { border-color: #b5a890; }
.upload-zone img {
  max-height: 180px; border-radius: 1rem; margin: 0 auto; object-fit: cover;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
}

.field-label {
  display: block; font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 0.4rem;
}
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .admin-form-grid { grid-template-columns: 1fr; } }

.color-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.7rem; border-radius: 9999px; border: 1px solid var(--border);
  font-size: 0.8rem; background: var(--surface);
}
.color-chip button { opacity: 0.45; line-height: 1; }
.color-chip button:hover { opacity: 1; color: #dc2626; }

.badge {
  display: inline-block; font-size: 0.62rem; font-weight: 600; padding: 0.18rem 0.55rem;
  border-radius: 9999px; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-feat { background: #141210; color: #fff; }
html.dark .badge-feat { background: #f5f2eb; color: #141210; }
.badge-stock { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

.sync-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.7rem; font-weight: 600; padding: 0.3rem 0.65rem;
  border-radius: 9999px;
}
.sync-ok { background: #d1fae5; color: #065f46; }
.sync-off { background: #fee2e2; color: #991b1b; }
html.dark .sync-ok { background: rgba(6,95,70,.35); color: #6ee7b7; }
html.dark .sync-off { background: rgba(153,27,27,.35); color: #fca5a5; }

.order-card {
  border-radius: 1.25rem; border: 1px solid var(--border);
  background: var(--surface); overflow: hidden;
}
.order-status {
  font-size: 0.68rem; font-weight: 600; padding: 0.25rem 0.65rem;
  border-radius: 9999px; letter-spacing: 0.04em; text-transform: uppercase;
}
.status-enviado { background: #dbeafe; color: #1e40af; }
html.dark .status-enviado { background: rgba(30,64,175,.3); color: #93c5fd; }

.hero-overlay {
  background: linear-gradient(105deg, rgba(20,18,16,.84) 0%, rgba(20,18,16,.48) 45%, transparent 75%);
}
.eyebrow {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.5s var(--ease) both; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.35s var(--ease); }


/* Admin login — tela isolada */
.admin-login-screen {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(181,168,144,.25), transparent),
    var(--surface-2);
}
html.dark .admin-login-screen {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(181,168,144,.08), transparent),
    #12100e;
}

/* Oferta relâmpago */
.flash-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20,18,16,.55);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  animation: fadeUp 0.35s var(--ease);
}
.flash-overlay.hidden { display: none !important; }
.flash-modal {
  position: relative;
  width: 100%; max-width: 28rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
  box-shadow: 0 24px 64px -16px rgba(0,0,0,.35);
  animation: fadeUp 0.4s var(--ease);
}
.flash-close {
  position: absolute; top: 0.85rem; right: 1rem;
  font-size: 1.5rem; line-height: 1; opacity: 0.45;
  width: 2rem; height: 2rem; border-radius: 9999px;
}
.flash-close:hover { opacity: 1; background: var(--surface-2); }
.flash-badge {
  display: inline-block;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #b45309; background: #fef3c7;
  padding: 0.35rem 0.75rem; border-radius: 9999px;
}
html.dark .flash-badge { background: rgba(180,83,9,.25); color: #fcd34d; }
