:root {
  --ink: #151515;
  --muted: #69645f;
  --paper: #f7f4ed;
  --panel: #ffffff;
  --line: #d9d0c1;
  --gold: #a77d35;
  --copper: #ad6044;
  --green: #236e63;
  --plum: #34223a;
  --blue: #264b63;
  --danger: #b64040;
  --shadow: 0 20px 60px rgba(25, 20, 13, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(167, 125, 53, 0.12), transparent 30%),
    linear-gradient(90deg, rgba(35, 110, 99, 0.09), transparent 44%),
    linear-gradient(180deg, #fffaf0 0%, #f1ece3 52%, #f8f5ef 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(221, 212, 198, 0.78);
  background: rgba(251, 248, 240, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  background: var(--ink);
  color: #fff3d6;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.eyebrow,
.product-meta,
.stock-line,
.enquiry-meta,
.admin-table span,
.mini-row span {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #342f2a;
}

.hero,
.catalogue-head,
.browse-panels,
.product-grid,
.commerce-band,
.contact-section,
.detail-page,
.error-page {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.68fr);
  gap: clamp(30px, 6vw, 76px);
  align-items: center;
  min-height: calc(100vh - 78px);
  padding: 52px 0 34px;
}

.hero h1,
.detail-copy h1,
.login-card h1,
.admin-page-head h1 {
  margin: 8px 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.5rem, 9vw, 9rem);
  font-weight: 500;
  line-height: 0.9;
}

.hero p,
.contact-section p,
.detail-copy p,
.login-card p,
.admin-card p {
  color: #4f4943;
  line-height: 1.65;
}

.hero-actions,
.hero-metrics,
.card-actions,
.filters,
.price-line,
.stock-line,
.admin-page-head,
.row-actions,
.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-metrics {
  margin: 26px 0;
}

.hero-metrics article {
  min-width: 118px;
  border-top: 1px solid rgba(21, 21, 21, 0.35);
  padding-top: 12px;
}

.hero-metrics strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.25rem;
  font-weight: 500;
}

.hero-metrics span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.primary-btn,
.secondary-btn,
.whatsapp-btn,
.danger-btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  padding: 0 16px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.secondary-btn {
  background: transparent;
  color: var(--ink);
}

.whatsapp-btn {
  border-color: var(--green);
  background: var(--green);
}

.danger-btn {
  border-color: var(--danger);
  background: var(--danger);
}

.full-btn {
  width: 100%;
}

button:hover,
.primary-btn:hover,
.secondary-btn:hover,
.whatsapp-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(21, 21, 21, 0.12);
}

.hero-feature {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(21, 21, 21, 0.2);
  background: white;
  box-shadow: var(--shadow);
}

.hero-feature img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.hero-feature div {
  display: grid;
  gap: 4px;
  padding: 18px;
  background: linear-gradient(180deg, #fff, #f4eee3);
}

.hero-feature strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 500;
}

.catalogue-head {
  display: grid;
  grid-template-columns: 0.6fr 1fr;
  gap: 24px;
  align-items: end;
  padding: 36px 0 18px;
  border-top: 1px solid var(--line);
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(182, 138, 61, 0.16);
}

.filters input {
  flex: 1 1 220px;
}

.filters select {
  flex: 1 1 170px;
}

.browse-panels {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
  padding: 6px 0 26px;
}

.browse-panels article {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  padding: 14px;
}

.quick-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-top: 10px;
}

.quick-tabs a,
.chip-list span,
.status-pill {
  min-width: max-content;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  padding: 9px 12px;
}

.quick-tabs a.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-bottom: 54px;
}

.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(22, 17, 9, 0.06);
}

.product-image {
  position: relative;
  display: block;
  background: #e9dfcf;
}

.product-image img {
  width: 100%;
  aspect-ratio: 4 / 3.35;
  object-fit: cover;
}

.private-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  background: var(--ink);
  color: #fff;
  font-size: 0.78rem;
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 13px;
  padding: 18px;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.product-card h3 {
  min-height: 54px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.22;
}

.product-card p {
  display: -webkit-box;
  min-height: 62px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.price-line strong {
  font-size: 1.32rem;
}

.price-line.large strong {
  font-size: 2rem;
}

.price-line del {
  color: #8f867d;
}

.price-line span {
  color: var(--copper);
  font-size: 0.8rem;
  font-weight: 800;
}

.stock-line {
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.sku-line {
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-ok {
  color: var(--green);
}

.stock-low {
  color: var(--copper);
}

.stock-out {
  color: var(--danger);
}

.commerce-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 28px 0 64px;
}

.commerce-band article {
  border-top: 1px solid var(--ink);
  padding: 18px 0;
}

.commerce-band span {
  color: var(--gold);
  font-weight: 900;
}

.commerce-band strong {
  display: block;
  margin: 7px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 500;
}

.commerce-band p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.contact-section {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 36px;
  align-items: start;
  padding: 44px 0 86px;
  border-top: 1px solid var(--line);
}

.contact-form,
.editor-form {
  display: grid;
  gap: 12px;
}

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

.compact textarea,
.compact button,
.compact .whatsapp-btn {
  grid-column: span 2;
}

.detail-page {
  padding: 40px 0 80px;
}

.product-detail-page {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.detail-media img {
  width: 100%;
  min-height: 620px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.detail-copy {
  display: grid;
  gap: 18px;
  padding: 18px 0;
}

.detail-copy h1 {
  font-size: clamp(2.4rem, 5vw, 5rem);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 0;
  background: var(--line);
}

.spec-grid div {
  padding: 13px;
  background: white;
}

.spec-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.spec-grid dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.tag-row,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  padding: 8px 11px;
  background: rgba(182, 138, 61, 0.15);
  color: #5b421b;
}

.login-screen,
.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px 0;
}

.login-card {
  display: grid;
  width: min(460px, 100%);
  gap: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  padding: clamp(24px, 5vw, 44px);
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: clamp(2.4rem, 7vw, 4.4rem);
}

.alert {
  border: 1px solid rgba(182, 64, 64, 0.4);
  background: rgba(182, 64, 64, 0.09);
  color: var(--danger);
  padding: 12px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--line);
  background: #171513;
  color: white;
  padding: 20px;
}

.admin-brand small,
.admin-sidebar .brand small {
  color: #d6c8b8;
}

.admin-menu {
  display: grid;
  gap: 8px;
}

.admin-menu a {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px;
  color: #f8eedf;
}

.admin-menu a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.admin-sidebar form {
  margin-top: auto;
}

.admin-sidebar .secondary-btn {
  border-color: rgba(255, 255, 255, 0.32);
  color: white;
}

.admin-main {
  min-width: 0;
  padding: clamp(20px, 4vw, 42px);
}

.admin-page-head {
  justify-content: space-between;
  margin-bottom: 22px;
}

.admin-page-head h1 {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
}

.metric-grid,
.admin-two-col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.metric-grid article,
.admin-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  padding: 18px;
  box-shadow: 0 10px 28px rgba(22, 17, 9, 0.05);
}

.metric-grid strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.6rem;
  font-weight: 500;
}

.metric-grid span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.8rem;
}

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

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

.section-title a {
  color: var(--green);
  font-weight: 800;
}

.mini-row {
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: white;
}

.product-management-panel {
  display: grid;
}

.admin-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.94);
}

.admin-filters input[name="search"] {
  grid-column: span 2;
}

.admin-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

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

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

.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-cell img {
  width: 62px;
  height: 62px;
  object-fit: cover;
}

.image-missing,
.product-image-empty,
.detail-media-empty {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: #f5efe5;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.image-missing {
  width: 62px;
  height: 62px;
}

.product-image-empty {
  width: 100%;
  aspect-ratio: 4 / 3.35;
}

.detail-media-empty {
  min-height: 620px;
}

.row-actions {
  flex-wrap: nowrap;
}

.editor-section {
  display: grid;
  gap: 14px;
}

.editor-section h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 500;
}

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

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
}

label input,
label select,
label textarea {
  color: var(--ink);
  font-size: 1rem;
  text-transform: none;
}

.switch-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch-row input {
  width: auto;
  min-height: auto;
}

.editor-preview {
  width: 180px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  border: 1px solid var(--line);
  background: rgba(251, 248, 240, 0.92);
  padding: 14px;
  backdrop-filter: blur(14px);
}

.product-dialog {
  width: min(1120px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  border: 1px solid var(--line);
  padding: 0;
  background: white;
  box-shadow: var(--shadow);
}

.product-dialog::backdrop {
  background: rgba(21, 21, 21, 0.52);
}

.dialog-frame {
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 18px;
}

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -18px -18px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  padding: 16px 18px;
  backdrop-filter: blur(14px);
}

.dialog-head h2 {
  max-width: 760px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-check {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fffdf8;
  padding: 8px 10px;
}

.inline-check input {
  width: auto;
  min-height: auto;
}

.collection-product-list {
  display: grid;
  gap: 6px;
  min-width: 300px;
  max-height: 260px;
  overflow: auto;
  padding-top: 10px;
}

.collection-product-list span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
  color: var(--ink);
  font-size: 0.9rem;
  text-transform: none;
}

.collection-product-list small {
  color: var(--muted);
  text-transform: uppercase;
}

.enquiry-list {
  display: grid;
  gap: 12px;
}

.enquiry-card {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 18px;
  align-items: start;
  border: 1px solid var(--line);
  background: white;
  padding: 18px;
}

.enquiry-card p {
  color: var(--muted);
  line-height: 1.55;
}

.enquiry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  background: rgba(47, 118, 106, 0.11);
  color: var(--green);
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100% - 36px));
  background: var(--ink);
  color: white;
  padding: 13px 16px;
  box-shadow: var(--shadow);
}

@media (max-width: 1080px) {
  .product-grid,
  .metric-grid,
  .form-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalogue-head,
  .product-detail-page {
    grid-template-columns: 1fr;
  }

  .detail-media img {
    min-height: 420px;
  }
}

@media (max-width: 760px) {
  .topbar,
  .admin-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero,
  .contact-section,
  .admin-two-col,
  .enquiry-card,
  .browse-panels {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero h1 {
    font-size: clamp(3.3rem, 18vw, 6rem);
  }

  .product-grid,
  .commerce-band,
  .metric-grid,
  .form-grid,
  .form-grid.four,
  .compact {
    grid-template-columns: 1fr;
  }

  .compact textarea,
  .compact button,
  .compact .whatsapp-btn {
    grid-column: auto;
  }

  .product-card h3,
  .product-card p {
    min-height: 0;
  }

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

  .admin-sidebar {
    position: static;
    height: auto;
  }
}
