@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=DM+Serif+Display:ital@0;1&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Manrope:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --viewer-primary-rgb: 122 46 58;
  --viewer-surface: #fcf3ea;
  --viewer-text: #2e1b1f;
  --viewer-body-font: "Manrope", sans-serif;
  --viewer-display-font: "Cormorant Garamond", serif;
}

html,
body {
  background-color: var(--viewer-surface) !important;
}

body,
button,
input,
textarea,
select {
  font-family: var(--viewer-body-font) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-display {
  font-family: var(--viewer-display-font) !important;
}

body.font-display {
  font-family: var(--viewer-body-font) !important;
}

.bg-primary {
  background-color: rgb(var(--viewer-primary-rgb)) !important;
}

.text-primary {
  color: rgb(var(--viewer-primary-rgb)) !important;
}

.border-primary {
  border-color: rgb(var(--viewer-primary-rgb)) !important;
}

.bg-background-light {
  background-color: var(--viewer-surface) !important;
}

[class~="bg-primary/5"] {
  background-color: color-mix(in srgb, rgb(var(--viewer-primary-rgb)) 5%, transparent) !important;
}

[class~="bg-primary/10"] {
  background-color: color-mix(in srgb, rgb(var(--viewer-primary-rgb)) 10%, transparent) !important;
}

[class~="bg-primary/20"] {
  background-color: color-mix(in srgb, rgb(var(--viewer-primary-rgb)) 20%, transparent) !important;
}

[class~="text-primary/40"] {
  color: color-mix(in srgb, rgb(var(--viewer-primary-rgb)) 40%, transparent) !important;
}

[class~="text-primary/60"] {
  color: color-mix(in srgb, rgb(var(--viewer-primary-rgb)) 60%, transparent) !important;
}

[class~="text-primary/80"] {
  color: color-mix(in srgb, rgb(var(--viewer-primary-rgb)) 80%, white 20%) !important;
}

[class~="border-primary/10"] {
  border-color: color-mix(in srgb, rgb(var(--viewer-primary-rgb)) 10%, transparent) !important;
}

[class~="border-primary/20"] {
  border-color: color-mix(in srgb, rgb(var(--viewer-primary-rgb)) 20%, transparent) !important;
}

[class*="shadow-primary/20"] {
  box-shadow: 0 18px 45px color-mix(in srgb, rgb(var(--viewer-primary-rgb)) 20%, transparent) !important;
}

.template-viewer-shell {
  position: fixed;
  right: 0;
  top: 50%;
  width: min(360px, calc(100vw - 20px));
  transform: translate(calc(100% - 2px), -50%);
  transition: transform 0.35s ease;
  z-index: 91;
}

.template-viewer-shell.is-open {
  transform: translate(0, -50%);
}

.template-viewer-toggle {
  position: absolute;
  left: -64px;
  top: calc(50% - 78px);
  width: 64px;
  height: 148px;
  border: 0;
  border-radius: 22px 0 0 22px;
  background: linear-gradient(180deg, rgba(255, 250, 245, 0.98), rgba(250, 240, 230, 0.94));
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.14);
  color: rgb(var(--viewer-primary-rgb));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.template-viewer-toggle .material-symbols-outlined {
  font-size: 26px;
}

.template-viewer-buy-handle {
  position: absolute;
  left: -64px;
  top: calc(50% + 78px);
  width: 64px;
  height: 200px;
  border-radius: 22px 0 0 22px;
  background: linear-gradient(180deg, rgba(255, 250, 245, 0.98), rgba(250, 240, 230, 0.94));
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.14);
  color: rgb(var(--viewer-primary-rgb));
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.template-viewer-buy-handle .material-symbols-outlined {
  font-size: 26px;
}

.template-viewer-buy-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

.template-viewer-toggle-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.template-viewer-panel {
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: rgba(255, 249, 244, 0.94);
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 28px 0 0 28px;
  backdrop-filter: blur(16px);
  box-shadow: 0 28px 65px rgba(15, 23, 42, 0.18);
}

.template-viewer-inner {
  padding: 26px;
}

.template-viewer-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(var(--viewer-primary-rgb));
  margin-bottom: 12px;
}

.template-viewer-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
  color: var(--viewer-text);
}

.template-viewer-text {
  margin: 0 0 24px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.template-viewer-section + .template-viewer-section {
  margin-top: 24px;
}

.template-viewer-label {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}

.template-viewer-swatches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.template-viewer-swatch,
.template-viewer-font {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #fff;
  color: inherit;
  cursor: pointer;
}

.template-viewer-swatch {
  border-radius: 18px;
  padding: 14px;
  text-align: left;
}

.template-viewer-swatch-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.template-viewer-chip {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.template-viewer-swatch-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.template-viewer-fonts {
  display: grid;
  gap: 10px;
}

.template-viewer-font {
  border-radius: 16px;
  padding: 14px 16px;
  text-align: left;
  font-size: 18px;
  font-weight: 700;
}

.template-viewer-swatch.is-active,
.template-viewer-font.is-active {
  border-color: rgb(var(--viewer-primary-rgb));
  box-shadow: 0 0 0 2px color-mix(in srgb, rgb(var(--viewer-primary-rgb)) 18%, transparent);
}

@media (max-width: 768px) {
  .template-viewer-shell {
    width: min(320px, calc(100vw - 12px));
    transform: translate(calc(100% - 2px), -50%);
  }

  .template-viewer-toggle {
    left: -54px;
    width: 54px;
    height: 128px;
    top: calc(50% - 68px);
  }

  .template-viewer-buy-handle {
    left: -54px;
    top: calc(50% + 68px);
    width: 54px;
    height: 128px;
  }

  .template-viewer-swatches {
    grid-template-columns: 1fr;
  }
}
