:root {
  --page: #f5f5f5;
  --ink: #111820;
  --muted: #596273;
  --panel: #ffffff;
  --line: #dfe3e8;
  --brand: #3665f3;
  --brand-strong: #1f46c7;
  --accent: #f7b100;
  --danger: #d72f2f;
  --focus: rgba(54, 101, 243, 0.25);
  --shadow: 0 8px 24px rgba(17, 24, 32, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

.page-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% -10%, rgba(247, 177, 0, 0.18), transparent 36%),
    radial-gradient(circle at 100% 0%, rgba(54, 101, 243, 0.16), transparent 30%),
    linear-gradient(180deg, #f8f8f8 0%, #efefef 100%);
  z-index: -1;
}

.utility-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}

.utility-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.utility-inner p {
  margin: 0;
  color: var(--muted);
}

.subtle-admin-link {
  color: #6a768a;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
}

.subtle-admin-link:hover {
  color: #365cae;
  text-decoration: underline;
}

.utility-inner nav {
  display: flex;
  gap: 1rem;
}

.utility-inner a {
  color: #414b5b;
  text-decoration: none;
}

.utility-inner a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.search-strip {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.search-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: grid;
  gap: 1rem;
  align-items: center;
  grid-template-columns: 110px 1fr;
}

.wordmark {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.03em;
  font-weight: 800;
  line-height: 1;
}

.logo-o {
  color: #e53238;
}

.logo-b {
  color: #0064d2;
}

.logo-a {
  color: #f5af02;
}

.logo-y {
  color: #86b817;
}

.search-mock {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 2px solid #1f2430;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.search-input {
  border: 0;
  border-radius: 0;
  padding: 0.75rem 1rem;
  color: #1f2430;
  font-size: 0.96rem;
  min-width: 0;
}

.search-input::placeholder {
  color: #707a8b;
}

.search-mock button {
  border: 0;
  border-left: 1px solid #b3bdca;
  background: var(--brand);
  color: #fff;
  padding: 0.75rem 1.3rem;
  font: inherit;
  font-weight: 700;
}

.mobile-filter-toggle {
  display: none;
}

.site-header {
  padding: 1rem 1rem 1.2rem;
}

.header-inner {
  max-width: 1260px;
  margin: 0 auto;
  background: linear-gradient(130deg, #ffffff 0%, #f5f8ff 60%, #fff4d8 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.75rem;
  color: #37517e;
  margin: 0 0 0.35rem;
}

h1 {
  font-size: clamp(1.7rem, 2.5vw + 0.7rem, 2.65rem);
  line-height: 1.08;
  margin: 0;
  font-weight: 800;
}

h2,
h3 {
  margin: 0;
}

.tagline {
  max-width: 860px;
  margin: 0.55rem 0 1rem;
  color: #49566a;
}

.layout {
  max-width: 1260px;
  margin: 0 auto;
  padding: 1.1rem 1rem 2rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.filter-panel h2 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.filter-group {
  padding: 0.72rem 0;
  border-top: 1px solid #e6e9ef;
}

.filter-group h3 {
  margin-bottom: 0.48rem;
  font-size: 0.9rem;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
  font-size: 0.88rem;
}

.filter-option input {
  width: 1rem;
  height: 1rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

#listing-count {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.empty-state {
  border: 1px dashed #bfc7d4;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}

.listing-card {
  border: 1px solid #d8dde5;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(17, 24, 32, 0.14);
}

.listing-media,
.item-gallery {
  position: relative;
  touch-action: pan-y;
}

.listing-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #eef1f4;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(17, 24, 32, 0.62);
  color: #fff;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-nav.prev {
  left: 0.45rem;
}

.gallery-nav.next {
  right: 0.45rem;
}

.gallery-count {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  margin: 0;
  background: rgba(17, 24, 32, 0.62);
  color: #fff;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 600;
}

.listing-body {
  padding: 0.85rem;
}

.offer-form-item {
  margin-top: 0.7rem;
  border-top: 1px solid #e4e9f2;
  padding-top: 0.7rem;
}

.offer-form-item h4 {
  margin: 0;
  font-size: 0.9rem;
}

.listing-badge {
  margin: 0 0 0.4rem;
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  background: #3665f3;
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
}

.listing-badge.offer {
  background: #ff6200;
}

.view-link {
  display: inline-block;
  margin: 0.15rem 0 0.65rem;
  color: #355fb7;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.view-link:hover {
  text-decoration: underline;
}

.listing-body h3 {
  margin: 0.42rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.description {
  font-size: 0.89rem;
  color: #4d596c;
  margin: 0;
}

.listing-body .description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price {
  font-weight: 800;
  font-size: 1.05rem;
  color: #111820;
  margin: 0.62rem 0;
}

.quantity-row {
  margin: 0 0 0.45rem;
  font-size: 0.83rem;
  color: #47566c;
  font-weight: 600;
}

.meta-row,
.shipping-row {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  color: #5f6c80;
}

.shipping-row {
  color: #1f6e43;
  font-weight: 600;
}

.external-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.1rem 0 0.65rem;
}

.external-links a {
  font-size: 0.74rem;
  border: 1px solid #d8dde5;
  background: #f8fafc;
  color: #2f4b78;
  text-decoration: none;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
}

.external-links a:hover {
  background: #edf3ff;
  text-decoration: underline;
}

.chips {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.chip {
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid #d8dde5;
  color: #445266;
  padding: 0.2rem 0.42rem;
  border-radius: 999px;
  background: #f9fafb;
}

.stack {
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: #303b4a;
}

input,
select,
textarea {
  border: 1px solid #c6ceda;
  background: #fff;
  border-radius: 10px;
  padding: 0.62rem 0.68rem;
  font: inherit;
  color: inherit;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.63rem 1rem;
  font: inherit;
  font-weight: 700;
  background: var(--accent);
  color: #111820;
  cursor: pointer;
}

.btn:hover {
  background: #e4a300;
}

.btn-ghost {
  background: #fff;
  border: 1px solid #7c90b2;
  color: #325baf;
}

.btn-ghost:hover {
  background: #f0f5ff;
}

.btn-small {
  padding: 0.42rem 0.68rem;
  font-size: 0.82rem;
  border-radius: 999px;
}

.btn-danger {
  border-color: #d72f2f;
  background: #ffffff;
  color: #d72f2f;
}

.btn-danger:hover {
  background: #fff3f3;
}

.card-actions {
  display: flex;
  gap: 0.42rem;
}

.actions,
.row {
  display: grid;
  gap: 0.6rem;
}

.status {
  min-height: 1.2rem;
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.admin-panel {
  max-width: 1260px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.admin-shell {
  max-width: 760px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
  display: grid;
  gap: 1rem;
}

.admin-top-link {
  margin: 0.4rem 0 0;
}

.admin-inner {
  border: 1px solid #c9d2e0;
}

.admin-note {
  margin-top: 0.4rem;
  color: var(--muted);
}

.photo-note {
  margin: 0 0 0.45rem;
}

.editing-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.6rem;
}

.editing-photo {
  border: 1px solid #d7deeb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.editing-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #eef1f4;
}

.editing-photo button {
  width: 100%;
  border: 0;
  border-top: 1px solid #e2e8f1;
  background: #fff3f3;
  color: #b42323;
  padding: 0.38rem 0.45rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.editing-photo button:hover {
  background: #ffe9e9;
}

.editing-photos-empty {
  color: var(--muted);
  margin: 0;
  font-size: 0.84rem;
}

.external-links-admin {
  display: grid;
  gap: 0.55rem;
}

.external-link-inputs {
  margin-top: -0.2rem;
}

.external-links-list {
  display: grid;
  gap: 0.45rem;
}

.external-link-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid #d7deeb;
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  font-size: 0.84rem;
}

.external-link-item a {
  color: #2f4b78;
  text-decoration: none;
  word-break: break-all;
}

.external-link-item a:hover {
  text-decoration: underline;
}

.external-link-remove {
  border: 0;
  background: #fff3f3;
  color: #b42323;
  border-radius: 999px;
  padding: 0.26rem 0.55rem;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.external-link-remove:hover {
  background: #ffe6e6;
}

.admin-list-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e4e9f2;
}

.admin-listings {
  display: grid;
  gap: 0.55rem;
}

.admin-row {
  border: 1px solid #d7deeb;
  border-radius: 10px;
  padding: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.admin-row-title,
.admin-row-meta {
  margin: 0;
}

.admin-row-title {
  font-weight: 700;
  font-size: 0.92rem;
}

.admin-row-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 20, 31, 0.55);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  background: #fff;
  border: 1px solid #d7dfec;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 20px 46px rgba(17, 24, 32, 0.25);
}

.modal-close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.1rem;
  color: #475770;
  cursor: pointer;
}

.modal-item-name {
  margin: 0.4rem 0 0.7rem;
  color: #4e5b70;
  font-weight: 600;
}

.item-layout {
  max-width: 1260px;
  margin: 0 auto;
  padding: 1.1rem 1rem 2rem;
}

.item-panel {
  display: grid;
  gap: 1rem;
}

.item-image {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 10px;
  background: #eef1f4;
}

.item-content h1 {
  margin-bottom: 0.4rem;
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .mobile-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    border: 1px solid #7c90b2;
    border-radius: 999px;
    background: #fff;
    color: #325baf;
    font: inherit;
    font-weight: 600;
    padding: 0.38rem 0.8rem;
    margin-bottom: 0.35rem;
    cursor: pointer;
  }

  .filter-panel {
    display: none;
  }

  .filter-panel.is-open {
    display: block;
  }

  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-inner {
    grid-template-columns: 1fr;
  }

  .search-mock {
    grid-template-columns: 1fr;
    border-radius: 14px;
  }

  .search-mock button {
    border-left: 0;
    border-top: 1px solid #b3bdca;
  }

  .wordmark {
    font-size: 1.7rem;
  }

  .utility-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 980px) {
  .layout {
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
  }

  .filter-panel {
    position: sticky;
    top: 0.9rem;
  }

  .actions,
  .row {
    grid-template-columns: 1fr 1fr;
  }

  .item-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}
