:root {
  --ink: #20242a;
  --muted: #66717f;
  --line: #d9dde3;
  --surface: #ffffff;
  --soft: #f7f5ef;
  --accent: #0b6b5f;
  --accent-strong: #094f47;
  --maroon: #8f2d3f;
  --gold: #b8842f;
  --shadow: 0 18px 45px rgba(31, 36, 42, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fbfaf7;
}

body.drawer-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

input[type="file"] {
  min-height: auto;
  padding: 10px 12px;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 5vw, 64px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(217, 221, 227, 0.7);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 105px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  background: var(--maroon);
  border-radius: 999px;
  font-weight: 800;
  overflow: hidden;
  flex: 0 0 auto;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 0.95rem;
  line-height: 1.05;
}

.brand-copy small,
.eyebrow {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 34px);
  color: #3a424b;
  font-size: 0.95rem;
}

.main-nav a:hover {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.cart-button,
.primary-button,
.secondary-button,
.primary-link,
.secondary-link {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1.2rem;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
}

.cart-button strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  color: var(--accent);
  background: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
}

.hero {
  position: relative;
  display: grid;
  min-height: min(520px, calc(55vh - 20px));
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(21, 20, 18, 0.72), rgba(21, 20, 18, 0.28) 58%, rgba(21, 20, 18, 0.08)),
    url("https://images.unsplash.com/photo-1583391733956-6c78276477e2?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  height: 22vh;
  content: "";
  background: linear-gradient(transparent, #fbfaf7);
}

.hero-content {
  width: min(760px, 92vw);
  margin: 0 clamp(18px, 6vw, 84px) clamp(48px, 8vh, 86px);
  color: #fff;
}

.hero-content .eyebrow {
  color: #f4d59b;
}

.hero-brand-line {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 26px);
  margin: 8px 0 16px;
}

.hero-brand-line img {
  width: clamp(74px, 12vw, 132px);
  height: clamp(74px, 12vw, 132px);
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.26);
  flex: 0 0 auto;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.2rem);
  line-height: 0.95;
}

.hero p {
  max-width: 670px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2vw, 1.24rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-link,
.secondary-link,
.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 700;
}

.primary-link,
.primary-button {
  color: #fff;
  background: var(--accent);
}

.secondary-link,
.secondary-button {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.primary-link:hover,
.primary-button:hover,
.cart-button:hover {
  background: var(--accent-strong);
}

.secondary-link:hover,
.secondary-button:hover,
.icon-button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.notice {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 clamp(18px, 5vw, 64px);
  padding: 15px 18px;
  color: #62351d;
  background: #fff3df;
  border: 1px solid #edd4a8;
  border-radius: 8px;
}

.notice.enabled {
  color: #114d42;
  background: #e9f7f3;
  border-color: #b8ded3;
}

.notice a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.notice span {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.toolbar,
.collections,
.integrations,
.admin-shell,
.contact-band,
.query-section {
  padding: 72px clamp(18px, 5vw, 64px) 0;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.toolbar h2,
.section-heading h2,
.admin-sidebar h1,
.admin-sidebar h2,
.contact-band h2,
.panel h2 {
  margin: 4px 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

input,
textarea,
select {
  min-height: 42px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 107, 95, 0.12);
}

textarea {
  min-height: 132px;
  padding: 12px;
  resize: vertical;
}

.search-box {
  min-width: min(300px, 100%);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 24px clamp(18px, 5vw, 64px) 0;
}

.product-card {
  display: grid;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(31, 36, 42, 0.07);
}

.product-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--soft);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: zoom-in;
}

.product-image-button img {
  transition: transform 220ms ease;
}

.product-image-button:hover img {
  transform: scale(1.04);
}

.stock-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  color: #fff;
  background: rgba(32, 36, 42, 0.78);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.stock-badge.fast {
  background: rgba(184, 132, 47, 0.92);
}

.stock-badge.sold {
  background: rgba(143, 45, 63, 0.92);
}

.thumbs {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 6px;
}

.thumbs button {
  width: 34px;
  height: 34px;
  overflow: hidden;
  padding: 0;
  background: transparent;
  border: 2px solid #fff;
  border-radius: 8px;
  cursor: pointer;
}

.thumbs button.active {
  border-color: var(--gold);
}

.thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.product-meta {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.product-meta h3 {
  margin: 0;
  font-size: 1rem;
}

.price {
  font-weight: 800;
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags span {
  padding: 5px 8px;
  color: #4a5561;
  background: var(--soft);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.product-card .primary-button {
  width: 100%;
}

.product-card .primary-button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.collection-grid,
.integration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-panel,
.integration-grid article,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(31, 36, 42, 0.06);
}

.feature-panel {
  overflow: hidden;
}

.feature-panel img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.feature-panel div {
  padding: 18px;
}

.feature-panel h3,
.integration-grid h3,
.panel h3,
.panel h2 {
  margin: 0 0 8px;
}

.feature-panel p,
.integration-grid p,
.panel p,
.admin-sidebar p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.integration-grid article {
  padding: 20px;
}

.contact-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 72px;
}

.contact-band > div {
  max-width: 760px;
}

.contact-band p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.query-section {
  padding-bottom: 72px;
}

.query-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 980px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(31, 36, 42, 0.06);
}

.query-form .primary-button {
  width: max-content;
}

.form-status {
  align-self: center;
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  line-height: 1.5;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.integration-icon {
  display: grid;
  width: 48px;
  height: 42px;
  place-items: center;
  margin-bottom: 16px;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.78rem;
}

.admin-integrations {
  padding: 0;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 18px;
  padding-bottom: 72px;
}

.admin-page {
  background: #f4f6f8;
}

.admin-header {
  position: static;
}

.admin-only-shell {
  padding-top: 32px;
}

.admin-sidebar {
  align-self: start;
  padding: 24px;
  background: #1f242a;
  border-radius: 8px;
  color: #fff;
}

.admin-sidebar .eyebrow,
.admin-sidebar p {
  color: rgba(255, 255, 255, 0.72);
}

.admin-sidebar .primary-button {
  width: 100%;
  margin-top: 22px;
}

.admin-status {
  margin-top: 14px;
  padding: 10px 12px;
  color: #f6dcae;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-status.unlocked {
  color: #b9f5de;
}

.admin-panels {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 20px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title span {
  padding: 6px 10px;
  color: #62351d;
  background: #fff3df;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.panel-title span.enabled {
  color: #114d42;
  background: #e9f7f3;
}

.settings-grid,
.inventory-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.wide {
  grid-column: 1 / -1;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
}

.inventory-form {
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1.6fr 1fr 1fr auto;
  margin-bottom: 18px;
}

.inventory-table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td button {
  min-height: 34px;
  padding: 0 10px;
}

td select {
  min-height: 34px;
  min-width: 132px;
}

.table-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.86rem;
}

.table-toggle input {
  width: 16px;
  min-height: 16px;
}

.image-manager {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.image-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-image-strip {
  display: flex;
  max-width: 320px;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.admin-image-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 64px;
  overflow: hidden;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-image-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  width: 20px;
  min-height: 20px;
  place-items: center;
  padding: 0;
  color: #fff;
  background: rgba(143, 45, 63, 0.92);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
}

.admin-image-thumb button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.image-add-row {
  display: flex;
}

.upload-button {
  position: relative;
  min-height: 34px;
  overflow: hidden;
  padding: 0 12px;
}

.upload-button input {
  position: absolute;
  inset: 0;
  cursor: pointer;
  opacity: 0;
}

.file-field {
  color: var(--muted);
}

.file-field input {
  width: 100%;
  background: #fff;
}

.image-add-row button,
.image-add-row label {
  min-height: 34px;
  padding: 0 10px;
}

.report-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(430px, 100vw);
  height: 100vh;
  background: #fff;
  box-shadow: var(--shadow);
  transform: translateX(104%);
  transition: transform 220ms ease;
}

.cart-drawer.open {
  transform: translateX(0);
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 4vw, 40px);
  pointer-events: none;
}

.image-modal.open {
  display: flex;
  pointer-events: auto;
}

.image-modal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(980px, 100%);
  max-height: min(820px, 94vh);
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.image-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.image-modal-header h2 {
  margin: 2px 0 0;
  font-size: clamp(1.25rem, 3vw, 2rem);
}

.image-stage {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  background: #11161a;
}

.image-stage img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 44px;
  height: 54px;
  place-items: center;
  color: #fff;
  background: rgba(17, 22, 26, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 800;
  transform: translateY(-50%);
}

.gallery-nav:hover {
  background: rgba(11, 107, 95, 0.9);
}

.gallery-nav.prev {
  left: 16px;
}

.gallery-nav.next {
  right: 16px;
}

.modal-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.modal-thumbs button {
  flex: 0 0 auto;
  width: 72px;
  height: 88px;
  overflow: hidden;
  padding: 0;
  background: var(--soft);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.modal-thumbs button.active {
  border-color: var(--accent);
}

.modal-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-header,
.cart-footer {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-header h2 {
  margin: 0;
}

.cart-items {
  overflow-y: auto;
  padding: 12px 18px;
}

.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line img {
  width: 64px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-line h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.cart-line p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.full {
  width: 100%;
}

.cart-footer p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  background: rgba(31, 36, 42, 0.42);
}

.overlay.open {
  display: block;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 5vw, 64px);
  color: #fff;
  background: #1f242a;
}

.site-footer p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.7);
}

.site-footer div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-footer span {
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .catalog-grid,
  .integration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-shell,
  .report-panel {
    grid-template-columns: 1fr;
  }

  .report-panel {
    display: grid;
  }

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

@media (max-width: 780px) {
  .site-header {
    align-items: start;
    flex-wrap: wrap;
  }

  .main-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .header-actions {
    margin-left: auto;
  }

  .hero {
    min-height: 430px;
  }

  .hero-media {
    background-position: 56% center;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filters {
    justify-content: stretch;
  }

  .filters label,
  .search-box,
  .settings-grid,
  .query-form,
  .inventory-form {
    width: 100%;
  }

  .catalog-grid,
  .collection-grid,
  .integration-grid,
  .settings-grid,
  .query-form,
  .inventory-form {
    grid-template-columns: 1fr;
  }

  .notice,
  .contact-band,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .query-form .primary-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .brand {
    min-width: 0;
  }

  .brand-copy small,
  .cart-button span:not(:first-child) {
    display: none;
  }

  .hero-content {
    margin-bottom: 44px;
  }

  .hero-brand-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-meta {
    display: grid;
  }

  .hero-actions,
  .hero-actions a,
  .contact-band a {
    width: 100%;
  }

  .image-modal {
    padding: 8px;
  }
}
