:root {
  --bg: #0f1117;
  --surface: #171b26;
  --surface-2: #1f2533;
  --text: #f4f6fb;
  --muted: #9aa3b5;
  --accent: #c9a227;
  --accent-hover: #e0b83a;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #1a2238 0%, transparent 55%),
    radial-gradient(900px 500px at 90% 0%, #2a1f10 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.brand-serif { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; }

.site-header {
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(15, 17, 23, 0.85);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand.brand-mark {
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-link { color: var(--muted) !important; }
.nav-link:hover { color: var(--text) !important; }

.search-form .form-control {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
}

.search-form .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(201, 162, 39, 0.15);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #9a7b18);
  border: none;
  color: #111;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
}

.btn-accent:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  color: #111;
}

.site-main { padding: 2rem 0 4rem; }

.hero {
  padding: 3rem 0 2rem;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 992px) {
  .hero { grid-template-columns: 1.2fr 1fr; align-items: center; }
}

.hero h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}

.hero p.lead { color: var(--muted); font-size: 1.05rem; max-width: 36rem; }

.hero-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.category-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0; }

.category-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
}

.category-pill:hover { border-color: var(--accent); color: var(--accent); }

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.listing-card-image {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--surface-2);
  overflow: hidden;
  isolation: isolate;
}

.listing-card-image-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.listing-card-image-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.listing-card-body {
  padding: 1rem;
  position: relative;
  z-index: 1;
  background: var(--surface);
}

.listing-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.35rem;
}

.listing-card-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  line-height: 1.3;
}

.listing-card-title {
  font-size: 1rem;
  margin: 0 0 0.35rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-card-title a { color: var(--text); text-decoration: none; }
.listing-card-title a:hover { color: var(--accent); }

.listing-card-meta { color: var(--muted); font-size: 0.85rem; margin: 0; }

.listing-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

.listing-card-price { color: var(--accent); font-size: 1.1rem; }

.badge-offer {
  background: rgba(201, 162, 39, 0.15);
  color: var(--accent);
  font-weight: 500;
}

.section-title {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.75rem;
  margin: 2.5rem 0 1rem;
}

.detail-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 992px) {
  .detail-layout { grid-template-columns: 1fr 1fr; }
}

.detail-gallery {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-gallery img { width: 100%; display: block; }

.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.price-xl {
  font-size: 2rem;
  color: var(--accent);
  font-weight: 700;
}

.panel-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}

.form-control, .form-select {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.form-control:focus, .form-select:focus {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 0.2rem rgba(201, 162, 39, 0.12);
}

label { color: var(--muted); }

.table { color: var(--text); }
.table > :not(caption) > * > * {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: auto;
}

.text-muted-small { color: var(--muted); font-size: 0.875rem; }

.alert { border-radius: var(--radius); }

.navbar-toggler { border-color: var(--border); }
.navbar-toggler-icon { filter: invert(1); }

.dropdown-menu {
  background: var(--surface);
  border: 1px solid var(--border);
}
.dropdown-item { color: var(--text); }
.dropdown-item:hover { background: var(--surface-2); color: var(--accent); }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.stat-card h3 { font-size: 2rem; color: var(--accent); margin: 0; }

.hero-search-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
  max-width: 42rem;
}

.hero-search-input {
  flex: 1 1 14rem;
  min-width: 0;
}

.hero-search-select {
  flex: 0 1 11.5rem;
  min-width: 9.5rem;
}

.hero-search-submit {
  flex: 0 0 auto;
  white-space: nowrap;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  min-height: calc(1.5em + 1rem + 2px);
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-premium .hero-search .form-control,
.hero-premium .hero-search .form-select {
  border-radius: 12px;
}

@media (max-width: 575.98px) {
  .hero-search-fields {
    flex-direction: column;
    max-width: none;
  }

  .hero-search-input,
  .hero-search-select,
  .hero-search-submit {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }
}

.hero-banner-card {
  background: linear-gradient(135deg, var(--surface-2), #2a2210);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.browse-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 992px) {
  .browse-layout { grid-template-columns: 260px 1fr; }
}

.browse-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.listing-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.listing-card-list {
  display: grid;
  grid-template-columns: 200px 1fr;
}

.listing-card-list .listing-card-image { aspect-ratio: 1; }

.listing-card-actions { display: flex; gap: 0.35rem; align-items: center; }

.listing-badge-soldout {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(80, 80, 90, 0.95);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  max-width: calc(100% - 3.5rem);
  line-height: 1.2;
}

.listing-card-soldout .listing-card-image img { opacity: 0.55; }

.cart-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }

.purchase-box .btn-accent { font-weight: 700; }

.listing-badge-featured--inline {
  position: static;
  display: inline-block;
  background: var(--accent);
  color: #111;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
  flex-shrink: 0;
}

.listing-favorite-form {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  margin: 0;
}

.listing-favorite-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 17, 23, 0.75);
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: color 0.15s, background 0.15s;
}

.listing-favorite-btn:hover,
.listing-favorite-btn.is-active {
  color: var(--accent);
  background: rgba(15, 17, 23, 0.92);
}

.seller-rating { color: var(--accent); font-size: 0.85rem; }

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.gallery-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  background: none;
  width: 72px;
  height: 72px;
  overflow: hidden;
}

.gallery-thumb.active,
.gallery-thumb:hover { border-color: var(--accent); }

.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

.detail-gallery-zoom img { cursor: zoom-in; }

.seller-box { }

.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.wizard-step {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.wizard-step.active { color: var(--accent); border-color: var(--accent); }

.receipt-preview { max-width: 100%; max-height: 320px; border-radius: var(--radius); }

.text-accent { color: var(--accent); }

.nav-tabs .nav-link { color: var(--muted); }
.nav-tabs .nav-link.active { color: var(--accent); background: var(--surface-2); border-color: var(--border); }

.content-page { max-width: 720px; }
.content-page .lead { color: var(--muted); }
.content-list li { margin-bottom: 0.5rem; }

.step-badge {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #111;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.site-footer { border-top: 1px solid var(--border); padding: 2.5rem 0 1.5rem; margin-top: 2rem; }
.footer-heading { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.admin-shell {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 992px) {
  .admin-shell { grid-template-columns: 220px 1fr; align-items: start; }
}

.admin-sidebar { position: sticky; top: 5.5rem; }
.admin-nav { display: flex; flex-direction: column; gap: 0.35rem; }
.admin-nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
}
.admin-nav-link:hover,
.admin-nav-link.active { color: var(--text); background: rgba(201, 162, 39, 0.12); }

.site-header-logo { height: 40px; width: auto; max-width: 200px; object-fit: contain; }
.site-header-text { font-size: 1.65rem; line-height: 1; color: var(--text); }
.site-footer-logo { height: 48px; width: auto; max-width: 220px; object-fit: contain; opacity: 0.95; }
.site-footer-text { font-size: 1.25rem; }
.brand-text-settings .form-label { font-size: 0.9rem; }

.brand-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.brand-asset-card { display: flex; flex-direction: column; overflow: hidden; }
.brand-asset-preview {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.brand-asset-preview img {
  max-height: 100px;
  max-width: 100%;
  object-fit: contain;
}
.brand-asset-badge { position: absolute; top: 0.5rem; right: 0.5rem; }
.brand-asset-body { padding: 1rem; flex: 1; }
.brand-asset-specs {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
}
.brand-asset-specs dt { color: var(--muted); margin: 0; font-weight: 500; }
.brand-asset-specs dd { margin: 0; }
.brand-asset-hint { font-size: 0.8rem; line-height: 1.4; }

.seller-analytics-table th,
.seller-analytics-table td { white-space: nowrap; font-size: 0.85rem; }
.seller-analytics-table .rank-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rank-color) 25%, transparent);
  border: 1px solid var(--rank-color);
  font-size: 0.8rem;
}

.shop-header h1 { margin-bottom: 0.25rem; }

.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox-modal[hidden] { display: none !important; }

.lightbox-modal img {
  max-width: min(96vw, 1100px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3000;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}

.cookie-consent-inner { max-width: 720px; margin: 0 auto; }

.rank-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--rank-color, #888) 25%, transparent);
  border: 1px solid var(--rank-color, #888);
  color: var(--text);
}

.rank-perks { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.rank-perks li { color: var(--muted); }
.rank-perks li.on { color: var(--accent); }
.rank-perks li.off { text-decoration: line-through; opacity: 0.5; }

.rank-panel { border-left: 3px solid var(--accent); }

.ranks-guide-page { max-width: 880px; }
.ranks-guide-hero .lead { font-size: 1.1rem; line-height: 1.65; }

.ranks-guide-points {
  padding-left: 1.25rem;
  color: var(--muted);
}
.ranks-guide-points li { margin-bottom: 0.5rem; }
.ranks-guide-points li:last-child { margin-bottom: 0; }

.rank-badge-lg {
  font-size: 0.95rem;
  padding: 0.35rem 0.85rem;
}

.rank-ladder {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rank-ladder-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  border-left: 4px solid var(--rank-color, var(--accent));
}

.rank-ladder-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.65rem;
}

.rank-ladder-level {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.rank-ladder-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
}

.rank-ladder-desc {
  color: var(--muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.rank-ladder-perks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem 1.25rem;
  margin: 0;
  font-size: 0.85rem;
}

.rank-ladder-perks dt {
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.rank-ladder-perks dd {
  margin: 0;
  color: var(--text);
}

.rank-compare-table { font-size: 0.9rem; }
.rank-compare-table th { white-space: nowrap; }

.ranks-faq { display: flex; flex-direction: column; gap: 0.5rem; }

.ranks-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.15);
}

.ranks-faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.ranks-faq-item summary::-webkit-details-marker { display: none; }

.ranks-faq-item summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-weight: 700;
}

.ranks-faq-item[open] summary::after { content: "−"; }

.ranks-faq-item p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.ranks-guide-cta { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
}

/* —— UX polish —— */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #111;
  font-weight: 600;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.card-glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.breadcrumb-nav .breadcrumb {
  background: transparent;
  padding: 0;
  font-size: 0.85rem;
}
.breadcrumb-nav .breadcrumb-item a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumb-nav .breadcrumb-item a:hover {
  color: var(--accent);
}
.breadcrumb-nav .breadcrumb-item.active {
  color: var(--text);
}

.nav-link-main.active {
  color: var(--accent) !important;
}

.nav-link-badge-wrap {
  position: relative;
  padding-right: 0.25rem !important;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  margin-left: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--accent);
  color: #111;
  vertical-align: super;
}
.nav-badge-warn {
  background: #e0b83a;
}

.empty-state-icon {
  font-size: 2.5rem;
  opacity: 0.6;
  line-height: 1;
}

.message-unread {
  border-left: 3px solid var(--accent);
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1040;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  cursor: pointer;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  min-height: 180px;
}
.hero-banner-image-link {
  display: block;
  height: 100%;
}

.pagination .page-link {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
}
.pagination .page-item.active .page-link {
  background: var(--accent);
  border-color: var(--accent);
  color: #111;
}

.listing-card-list {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}
.listing-card-list .listing-card-image {
  flex: 0 0 200px;
  max-width: 200px;
}
.listing-card-list .listing-card-body {
  flex: 1;
}
@media (max-width: 576px) {
  .listing-card-list {
    flex-direction: column;
  }
  .listing-card-list .listing-card-image {
    flex: none;
    max-width: 100%;
  }
}

.notification-unread {
  border-left: 3px solid var(--accent);
}

.notification-item.notification-unread {
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
}
