html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.rich-text-surface {
  min-height: 8rem;
  overflow-y: auto;
}

.rich-text-surface p:last-child {
  margin-bottom: 0;
}

.rich-text-toolbar .btn {
  min-width: 2.25rem;
}

.dashboard-sidebar {
  --bs-offcanvas-width: 260px;
}

@media (min-width: 768px) {
  /* Bootstrap's offcanvas-md only auto-reveals itself above the breakpoint when nested inside a
     navbar-expand-md wrapper (its "offcanvas navbar" pattern) — as a bare sidebar it stays fixed,
     hidden, and translated off-screen even above the breakpoint, so force it visible here instead. */
  .dashboard-sidebar {
    width: 220px;
    min-height: 100vh;
    position: static !important;
    visibility: visible !important;
    transform: none !important;
    background-color: rgba(var(--bs-dark-rgb), 1) !important;
  }
}

/* ---- Star rating picker (review form) ----
   Inputs are in the DOM from 5 down to 1 and displayed reversed, so "checked ~ label" and
   "hover ~ label" light up the chosen star and every star to its left. */
.star-input {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: .15rem;
}

.star-input input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.star-input label {
  font-size: 2rem;
  line-height: 1;
  color: #d6d6d6;
  cursor: pointer;
}

.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label {
  color: #e0a800;
}

.star-input input:focus-visible + label {
  outline: 2px solid #0d6efd;
  border-radius: 4px;
}

/* ---- Shop Settings: theme templates and live preview (theme-editor.js) ---- */
.theme-template-card {
  display: block;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}

.theme-template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .08);
}

.theme-template-card[aria-pressed="true"] {
  border-color: #0d6efd;
  box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .25);
}

.theme-template-swatch {
  height: 88px;
  border-bottom: 1px solid var(--bs-border-color);
}

.theme-template-bar {
  height: 18px;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.theme-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .15);
}

.theme-choice {
  min-width: 9.5rem;
  line-height: 1.25;
}

.theme-preview-sticky {
  position: sticky;
  top: 1rem;
}

.theme-preview {
  background: var(--p-bg);
  color: var(--p-text);
  font-family: var(--p-body-font);
  font-size: .8rem;
  border-radius: .75rem;
  overflow: hidden;
}

.theme-preview-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .9rem;
  background: var(--p-brand);
  color: var(--p-on-brand);
}

.theme-preview[data-header="Clean"] .theme-preview-header,
.theme-preview[data-header="Centered"] .theme-preview-header {
  background: var(--p-bg);
  color: var(--p-text);
  border-bottom: 1px solid var(--p-border);
}

.theme-preview[data-header="Centered"] .theme-preview-header {
  flex-direction: column;
  gap: .15rem;
}

.theme-preview-header img {
  height: 20px;
}

.theme-preview-name {
  font-family: var(--p-heading-font);
  font-size: 1rem;
}

.theme-preview-menu {
  margin-left: auto;
  font-size: .72rem;
  opacity: .8;
}

.theme-preview[data-header="Centered"] .theme-preview-menu {
  margin-left: 0;
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.theme-preview-body {
  padding: .9rem;
}

.theme-preview-heading {
  margin: .9rem 0 .5rem;
  font-family: var(--p-heading-font);
  font-size: 1rem;
  font-weight: 700;
}

.theme-preview-banner-title {
  font-family: var(--p-heading-font);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.15;
}

.theme-preview-banner-color {
  padding: 1.25rem;
  text-align: center;
  background: var(--p-brand);
  color: var(--p-on-brand);
  border-radius: var(--p-radius);
}

.theme-preview-banner-full {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 130px;
  color: #fff;
  border-radius: var(--p-radius);
  overflow: hidden;
  background: linear-gradient(135deg, #b08968, #7f5539) center / cover;
}

.theme-preview-banner-full::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .6), rgba(0, 0, 0, .05) 65%);
}

.theme-preview-banner-content {
  position: relative;
  z-index: 1;
  padding: .8rem;
}

.theme-preview-banner-cta {
  display: inline-block;
  margin-top: .35rem;
  padding: .2rem .6rem;
  background: #fff;
  color: #1a1a1a;
  border-radius: var(--p-button-radius);
  font-size: .68rem;
  font-weight: 600;
}

.theme-preview-banner-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  align-items: center;
}

.theme-preview-banner-photo {
  aspect-ratio: 4 / 3;
  border-radius: var(--p-radius);
  background: linear-gradient(135deg, #b08968, #7f5539) center / cover;
}

.theme-preview-note {
  margin-top: .35rem;
  font-size: .68rem;
  color: var(--p-muted);
}

.theme-preview-grid {
  display: grid;
  grid-template-columns: repeat(var(--p-columns), 1fr);
  gap: .5rem;
}

.theme-preview-tile {
  overflow: hidden;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  box-shadow: 0 .15rem .45rem rgba(0, 0, 0, .06);
}

.theme-preview-photo {
  aspect-ratio: 1;
}

.theme-preview-photo[data-photo="0"] { background: linear-gradient(135deg, #d6ccc2, #a98467); }
.theme-preview-photo[data-photo="1"] { background: linear-gradient(135deg, #a3b18a, #588157); }
.theme-preview-photo[data-photo="2"] { background: linear-gradient(135deg, #e9c46a, #bc6c25); }
.theme-preview-photo[data-photo="3"] { background: linear-gradient(135deg, #90e0ef, #0077b6); }

.theme-preview-tile-body {
  padding: .4rem .5rem;
}

.theme-preview-title {
  font-size: .72rem;
  font-weight: 600;
}

.theme-preview-price {
  font-size: .7rem;
  color: var(--p-muted);
}

.theme-preview[data-cards="Minimal"] .theme-preview-tile {
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.theme-preview[data-cards="Minimal"] .theme-preview-photo {
  border-radius: var(--p-radius);
}

.theme-preview[data-cards="Minimal"] .theme-preview-tile-body {
  padding: .35rem 0 0;
}

.theme-preview[data-cards="Framed"] .theme-preview-tile {
  padding: .35rem;
  box-shadow: none;
}

.theme-preview[data-cards="Framed"] .theme-preview-photo {
  border-radius: calc(var(--p-radius) / 2);
}

.theme-preview[data-cards="Framed"] .theme-preview-tile-body {
  padding: .35rem .1rem .1rem;
  text-align: center;
}

.theme-preview-button {
  display: inline-block;
  padding: .35rem .8rem;
  background: var(--p-brand);
  color: var(--p-on-brand);
  border-radius: var(--p-button-radius);
  font-size: .72rem;
  font-weight: 600;
}

.theme-preview-link {
  color: var(--p-accent);
  text-decoration: underline;
}

/* ==== Marketplace look (main site and dashboard) ====
   A warm, gallery-like neutral (ink on paper, one terracotta accent) so the marketplace frames the
   shops rather than competing with their own colors. */
:root {
  --mk-ink: #1c1b19;
  --mk-paper: #faf8f5;
  --mk-accent: #a8492a;
  --mk-line: #e7e2da;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-bg: var(--mk-paper);
  --bs-body-color: var(--mk-ink);
  --bs-link-color: var(--mk-accent);
  --bs-link-color-rgb: 168, 73, 42;
  --bs-link-hover-color: #82361e;
  --bs-link-hover-color-rgb: 130, 54, 30;
  --bs-border-color: var(--mk-line);
  --bs-border-radius: .6rem;
  --bs-border-radius-lg: .9rem;
}

body {
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6,
.navbar-brand {
  font-family: 'Fraunces', Georgia, serif;
  letter-spacing: -0.01em;
}

.btn {
  --bs-btn-border-radius: .6rem;
  --bs-btn-font-weight: 500;
}

.btn-primary {
  --bs-btn-bg: var(--mk-ink);
  --bs-btn-border-color: var(--mk-ink);
  --bs-btn-hover-bg: #3a3834;
  --bs-btn-hover-border-color: #3a3834;
  --bs-btn-active-bg: #000;
  --bs-btn-active-border-color: #000;
  --bs-btn-disabled-bg: var(--mk-ink);
  --bs-btn-disabled-border-color: var(--mk-ink);
}

.btn-outline-primary {
  --bs-btn-color: var(--mk-ink);
  --bs-btn-border-color: var(--mk-ink);
  --bs-btn-hover-bg: var(--mk-ink);
  --bs-btn-hover-border-color: var(--mk-ink);
  --bs-btn-active-bg: var(--mk-ink);
  --bs-btn-active-border-color: var(--mk-ink);
}

.card {
  --bs-card-border-color: var(--mk-line);
  --bs-card-border-radius: .9rem;
}

/* ---- Home page ---- */
.mk-hero {
  padding: 3.5rem 0 2.5rem;
}

.mk-hero-title {
  font-size: clamp(2.4rem, 5vw, 3.9rem);
  font-weight: 600;
  line-height: 1.05;
  margin-bottom: 1rem;
}

.mk-eyebrow {
  color: var(--mk-accent);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* A staggered 2x2 of real pieces from the marketplace. */
.mk-hero-collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9rem;
}

.mk-hero-tile {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: .9rem;
  box-shadow: 0 .75rem 2rem rgba(28, 27, 25, .12);
}

.mk-hero-tile:nth-child(even) {
  transform: translateY(1.5rem);
}

.mk-hero-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.mk-hero-tile:hover img {
  transform: scale(1.04);
}

.mk-section {
  padding: 2.75rem 0;
}

.mk-feature-icon {
  color: var(--mk-accent);
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: .5rem;
}

.mk-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2.5rem;
  background: var(--mk-ink);
  color: #fff;
  border-radius: 1.25rem;
}

.mk-cta h2 {
  color: #fff;
}

/* ---- Shop and product cards on marketplace pages ---- */
.shop-card,
.product-tile {
  transition: transform .18s ease, box-shadow .18s ease;
}

.shop-card:hover,
.product-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 .75rem 1.5rem rgba(28, 27, 25, .1) !important;
}

.shop-card-banner {
  height: 160px;
  object-fit: cover;
}

.shop-card-avatar {
  width: 56px;
  height: 56px;
  left: 16px;
  bottom: -28px;
  object-fit: cover;
  border: 3px solid #fff;
}

/* ---- Shop setup wizard (Dashboard/Setup) ---- */
.setup-wizard {
  max-width: 780px;
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.setup-steps {
  display: flex;
  gap: .25rem;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: none;
}

.setup-steps li {
  flex: 1;
  min-width: 0;
}

.setup-steps a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding-top: .25rem;
  color: var(--bs-secondary-color);
  text-decoration: none;
  font-size: .78rem;
  text-align: center;
  border-top: 3px solid var(--mk-line);
}

.setup-steps li.done a {
  border-top-color: var(--mk-ink);
}

.setup-steps li.current a {
  color: var(--mk-ink);
  font-weight: 600;
  border-top-color: var(--mk-accent);
}

.setup-step-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: .5rem;
  border-radius: 50%;
  border: 1px solid var(--mk-line);
  background: #fff;
  font-size: .8rem;
}

.setup-steps li.done .setup-step-marker {
  background: var(--mk-ink);
  border-color: var(--mk-ink);
  color: #fff;
}

.setup-steps li.current .setup-step-marker {
  border: 2px solid var(--mk-accent);
}

/* On phones the titles don't fit six across; the numbered markers carry the steps. */
@media (max-width: 575.98px) {
  .setup-step-title {
    display: none;
  }
}

.setup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: 1rem 1.5rem;
  background: transparent;
}

.setup-check {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 2px solid var(--mk-line);
  font-size: .85rem;
}

.setup-check.done {
  background: #1f7a4d;
  border-color: #1f7a4d;
  color: #fff;
}

.setup-big-check {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #1f7a4d;
  color: #fff;
  font-size: 1.4rem;
}

/* Template cards used as radio buttons (setup wizard). */
.btn-check:checked + .theme-template-card {
  border-color: var(--mk-accent);
  box-shadow: 0 0 0 .2rem rgba(168, 73, 42, .25);
}

.btn-check:focus-visible + .theme-template-card {
  outline: 2px solid var(--mk-accent);
  outline-offset: 2px;
}

label.theme-template-card {
  cursor: pointer;
}

/* Selected items in lists (e.g. the My account menu) in ink, not Bootstrap's default blue. */
.list-group {
  --bs-list-group-active-bg: var(--mk-ink);
  --bs-list-group-active-border-color: var(--mk-ink);
}
