:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #637083;
  --line: #d8dee8;
  --soft: #f5f7fa;
  --paper: #ffffff;
  --brand: #0b6b63;
  --brand-strong: #064f4a;
  --sun: #f2b84b;
  --berry: #aa356d;
  --danger: #b3261e;
  --success: #1f7a4d;
  --shadow: 0 18px 50px rgba(23, 32, 42, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--soft);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(11, 107, 99, 0.08), rgba(245, 247, 250, 0) 420px),
    var(--soft);
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(216, 222, 232, 0.86);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-weight: 800;
  font-size: 1.14rem;
  letter-spacing: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #062e2c;
  background: linear-gradient(135deg, var(--sun), #ffe0a0 42%, #8bd2c4);
  box-shadow: 0 10px 28px rgba(11, 107, 99, 0.22);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.button {
  gap: 8px;
  padding: 0 16px;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(11, 107, 99, 0.34);
  box-shadow: 0 12px 26px rgba(23, 32, 42, 0.09);
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--brand-strong);
}

.button.danger {
  border-color: rgba(179, 38, 30, 0.34);
  color: var(--danger);
}

.button.small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.88rem;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 58px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.72fr);
  gap: 34px;
  align-items: stretch;
  margin-bottom: 34px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 370px;
  padding: 44px 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--brand);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero-panel {
  position: relative;
  min-height: 370px;
  overflow: hidden;
  border-radius: 8px;
  background: #d7e6df;
  box-shadow: var(--shadow);
}

.hero-panel img {
  width: 100%;
  height: 100%;
  min-height: 370px;
  object-fit: cover;
  display: block;
}

.hero-badge {
  position: absolute;
  right: 18px;
  bottom: 18px;
  max-width: 240px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 14px 16px;
  color: var(--ink);
  box-shadow: 0 16px 36px rgba(23, 32, 42, 0.16);
}

.hero-badge strong {
  display: block;
  margin-bottom: 4px;
}

.hero-badge span {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 16px 0 18px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0;
}

.section-head p {
  margin-bottom: 4px;
  max-width: 430px;
  color: var(--muted);
  line-height: 1.55;
}

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

.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 34px rgba(23, 32, 42, 0.06);
}

.product-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #e7ecef;
}

.product-card-body {
  padding: 18px;
}

.product-card h3 {
  margin-bottom: 8px;
  font-size: 1.18rem;
}

.product-card p {
  min-height: 54px;
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.5;
}

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

.price {
  font-weight: 900;
  font-size: 1.2rem;
}

.stock {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(31, 122, 77, 0.12);
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-pill.draft {
  background: rgba(170, 53, 109, 0.13);
  color: var(--berry);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.7fr);
  gap: 30px;
  align-items: start;
}

.detail-media {
  overflow: hidden;
  border-radius: 8px;
  background: #e7ecef;
  box-shadow: var(--shadow);
}

.detail-media img {
  width: 100%;
  aspect-ratio: 1 / 0.78;
  object-fit: cover;
  display: block;
}

.detail-info {
  padding: 8px 0;
}

.detail-info h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.98;
}

.detail-info p {
  color: var(--muted);
  line-height: 1.65;
}

.quantity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}

.quantity-control {
  display: grid;
  grid-template-columns: 42px 58px 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.quantity-control button {
  width: 42px;
  height: 42px;
  border: 0;
  background: var(--paper);
  font-weight: 900;
}

.quantity-control input {
  width: 58px;
  height: 42px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font-weight: 800;
}

.auth-wrap,
.admin-wrap,
.checkout-wrap {
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 22px;
  box-shadow: 0 12px 34px rgba(23, 32, 42, 0.05);
}

.panel h2,
.panel h3 {
  margin-bottom: 16px;
}

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

.form-grid.single {
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 7px;
}

.field.span-2 {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 107, 99, 0.14);
}

.split-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}

.auth-tabs button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tabs button.active {
  background: var(--brand);
  color: #fff;
}

.message {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 0.62fr);
  gap: 18px;
  align-items: start;
}

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

.admin-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.admin-row img {
  width: 74px;
  height: 62px;
  border-radius: 7px;
  object-fit: cover;
  background: #e7ecef;
}

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

.admin-row-main h3 {
  margin: 0;
  font-size: 1rem;
}

.admin-row-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-table {
  width: 100%;
  border-collapse: collapse;
}

.order-table th,
.order-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
}

.order-table th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.65);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 32, 42, 0.46);
}

.modal {
  width: min(720px, 100%);
  max-height: min(88vh, 780px);
  overflow: auto;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

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

.modal-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-body {
  padding: 20px;
}

.checkout-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 18px;
  background: var(--soft);
}

.checkout-summary img {
  width: 78px;
  height: 70px;
  border-radius: 7px;
  object-fit: cover;
}

.checkout-summary p {
  margin: 4px 0 0;
  color: var(--muted);
}

.confirmation {
  display: grid;
  gap: 12px;
  text-align: center;
  padding: 18px 0;
}

.confirmation-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(31, 122, 77, 0.13);
  color: var(--success);
  font-size: 2rem;
  font-weight: 900;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 24px 0 34px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .hero,
  .detail-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: auto;
    padding: 24px 0 0;
  }

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

@media (max-width: 640px) {
  .topbar-inner,
  .main,
  .footer-inner {
    width: min(100% - 22px, 1180px);
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .product-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.span-2 {
    grid-column: auto;
  }

  .hero-panel,
  .hero-panel img {
    min-height: 280px;
  }

  h1 {
    font-size: clamp(3.1rem, 16vw, 4.7rem);
  }

  .section-head,
  .split-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

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

  .admin-row img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 2.2;
  }

  .order-table {
    display: block;
    overflow-x: auto;
  }
}
