:root {
  --bg: #0b0d12;
  --bg-elev: #12151d;
  --border: #232837;
  --text: #e6e9f2;
  --text-muted: #8b93a7;
  --accent: #7c5cff;
  --accent-2: #00d4aa;
  --danger: #ff5c7a;
  --radius: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(700px 400px at 90% 10%, rgba(0, 212, 170, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.vitrine-header {
  border-bottom: 1px solid var(--border);
  background: rgba(18, 21, 29, 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.vitrine-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.vitrine-brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.vitrine-brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.8);
}

.vitrine-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

.vitrine-main {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 28px 24px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.carousel {
  width: 100%;
  display: flex;
}

.carousel-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.carousel-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.carousel-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge-active {
  color: var(--accent-2);
  border-color: rgba(0, 212, 170, 0.4);
}

.badge-selected {
  color: var(--accent);
  border-color: rgba(124, 92, 255, 0.5);
}

.template-name {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.template-desc {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 640px;
}

.carousel-viewport {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
  height: 62vh;
  min-height: 380px;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
}

.carousel-slide iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: auto;
}

.carousel-slide:not(.is-active) iframe {
  pointer-events: none;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(18, 21, 29, 0.85);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.carousel-nav:hover {
  background: rgba(124, 92, 255, 0.25);
  border-color: var(--accent);
}

.carousel-prev {
  left: 14px;
}

.carousel-next {
  right: 14px;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.carousel-dot.is-active {
  background: var(--accent);
  transform: scale(1.3);
}

.btn-choose {
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: #0b0d12;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn-choose:hover {
  filter: brightness(1.1);
}

.btn-choose:active {
  transform: scale(0.97);
}

.vitrine-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.vitrine-footer code {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .carousel-viewport {
    height: 50vh;
  }

  .template-name {
    font-size: 22px;
  }
}

/* ---------- Modo embed (iframe no painel admin) ---------- */

.vitrine-embed .vitrine-header,
.vitrine-embed .vitrine-footer,
.vitrine-embed .carousel-meta {
  display: none;
}

.vitrine-embed .btn-choose {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 10px 24px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

body.vitrine-embed {
  overflow: hidden;
  min-height: 0;
}

.vitrine-embed .vitrine-main {
  padding: 0;
  max-width: none;
}

.vitrine-embed .carousel {
  height: 100%;
}

.vitrine-embed .carousel-stage {
  position: relative;
  gap: 0;
  height: 100%;
}

.vitrine-embed .carousel-viewport {
  position: absolute;
  inset: 0;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.vitrine-embed .carousel-nav {
  width: 36px;
  height: 36px;
  font-size: 15px;
  background: rgba(18, 21, 29, 0.55);
}

.vitrine-embed .carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 21, 29, 0.7);
  padding: 6px 10px;
  border-radius: 999px;
  z-index: 10;
}

.vitrine-pinned .carousel-nav,
.vitrine-pinned .carousel-dots {
  display: none;
}