:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-soft: #edf7f4;
  --text: #172033;
  --muted: #5f6b7a;
  --line: #dce4ea;
  --primary: #0f766e;
  --primary-dark: #0a5b55;
  --navy: #183b56;
  --accent: #d97706;
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(17, 24, 39, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.5;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px clamp(18px, 5vw, 64px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 800;
}

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

.brand small,
.muted,
.catalog-heading p,
.admin-toolbar p {
  color: var(--muted);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--navy);
  font-weight: 700;
}

.lang-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lang-switch button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 4px 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.lang-switch button.active {
  background: var(--primary);
  color: #fff;
}

.top-nav a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.top-nav a:hover {
  border-bottom-color: var(--primary);
}

.hero {
  position: relative;
  min-height: min(520px, calc(100vh - 110px));
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: clamp(36px, 7vw, 80px) clamp(18px, 5vw, 64px);
  isolation: isolate;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(247, 249, 251, 0.98) 0%, rgba(247, 249, 251, 0.78) 42%, rgba(247, 249, 251, 0.16) 100%);
  z-index: -1;
}

.hero-content {
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-weight: 800;
}

.hero h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  max-width: 520px;
  margin: 18px 0 0;
  color: #314154;
  font-size: 18px;
}

.hero-actions,
.product-actions,
.admin-toolbar,
.catalog-heading,
.panel-heading,
.cart-row,
.quantity-controls {
  display: flex;
  align-items: center;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--surface);
  color: var(--navy);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.16);
}

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

.button.ghost {
  background: #fff;
  color: var(--primary-dark);
  border-color: #a9d6cd;
}

.button.full {
  width: 100%;
}

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

.text-button {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
  cursor: pointer;
}

.shop-shell {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: 20px;
  padding: 28px clamp(18px, 5vw, 64px) 52px;
}

.filters,
.admin-card,
.admin-login {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.05);
}

.filters {
  position: sticky;
  top: 92px;
  align-self: start;
  padding: 18px;
}

.catalog {
  min-width: 0;
}

.catalog-heading,
.panel-heading,
.admin-toolbar {
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  color: var(--navy);
}

h2 {
  margin: 0;
  font-size: 22px;
}

.catalog-heading {
  margin-bottom: 18px;
}

.search-box,
.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-weight: 800;
}

.search-box {
  margin: 18px 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

.category-list {
  display: grid;
  gap: 8px;
}

.category-selects {
  display: grid;
  gap: 12px;
}

.category-select-label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 900;
}

.category-button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.category-button.active {
  border-color: var(--primary);
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-weight: 800;
}

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

.product-card {
  display: grid;
  min-height: 390px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.06);
}

.product-photo-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.product-photo {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  object-fit: cover;
  font-weight: 900;
}

.product-card > a:first-child {
  display: block;
  margin-bottom: 12px;
}

.product-card > a:first-child:hover .product-photo {
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.16);
}

.product-thumbs,
.small-image-strip,
.image-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-thumbs img,
.small-image-strip img {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.product-card h3 {
  margin: 10px 0 8px;
  font-size: 19px;
}

.category-path {
  min-height: 28px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.product-description {
  color: var(--muted);
  min-height: 54px;
}

.price-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
}

.price {
  color: var(--accent);
  font-size: 22px;
  font-weight: 900;
}

.product-actions {
  gap: 10px;
  margin-top: auto;
}

.product-actions .button {
  flex: 1;
  min-width: 0;
}

.form-message {
  min-height: 24px;
  color: var(--primary-dark);
  font-weight: 800;
}

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

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(18px, 5vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.admin-shell {
  padding: 32px clamp(18px, 5vw, 64px) 56px;
}

.admin-login {
  max-width: 420px;
  margin: 32px auto;
  padding: 24px;
}

.admin-login h1 {
  margin-top: 0;
}

.hidden {
  display: none !important;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(320px, 1fr);
  gap: 20px;
}

.admin-toolbar,
.admin-card.wide {
  grid-column: 1 / -1;
}

.admin-card {
  padding: 20px;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  gap: 20px;
  align-items: start;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-row {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1fr;
  gap: 12px;
}

.checkbox-line {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
}

.image-manager {
  display: grid;
  gap: 10px;
}

.image-preview {
  display: grid;
  gap: 6px;
  width: 96px;
}

.image-preview img {
  width: 96px;
  height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.small-image-strip {
  margin-top: 8px;
}

.compact-input {
  max-width: 260px;
}

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

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

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

th {
  color: var(--navy);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 13px;
}

.status-pill.off {
  background: #f8e8e7;
  color: var(--danger);
}

.terms-page {
  padding-bottom: 56px;
}

.product-page {
  padding: 32px clamp(18px, 5vw, 64px) 56px;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(300px, 1fr);
  gap: 28px;
  align-items: start;
}

.detail-gallery {
  display: grid;
  gap: 12px;
}

.detail-gallery img,
.detail-gallery .product-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.detail-info {
  position: sticky;
  top: 92px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.05);
}

.detail-info h1 {
  margin: 8px 0 12px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.08;
}

.back-link {
  padding: 0;
}

.detail-price {
  margin: 20px 0;
}

.legal-section {
  padding: 0 clamp(18px, 5vw, 64px) 52px;
}

.legal-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.05);
}

.legal-inner details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.legal-inner details:first-of-type {
  margin-top: 14px;
}

.legal-inner summary {
  color: var(--navy);
  cursor: pointer;
  font-weight: 900;
}

.legal-inner details p {
  margin: 10px 0 0;
  color: var(--muted);
}

.terms-hero {
  padding: 52px clamp(18px, 5vw, 64px);
  background: var(--surface-soft);
}

.terms-hero h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 64px);
}

.terms-content {
  max-width: 900px;
  margin: 30px auto 0;
  padding: 0 clamp(18px, 4vw, 36px);
}

.terms-content h2 {
  margin-top: 30px;
}

.copyright-line {
  margin-top: 36px;
  font-weight: 900;
  color: var(--navy);
}

@media (max-width: 1120px) {
  .shop-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .site-header,
  .site-footer,
  .catalog-heading,
  .admin-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    flex-wrap: wrap;
  }

  .hero {
    min-height: 500px;
    align-items: end;
  }

  .hero::after {
    background: linear-gradient(180deg, rgba(247, 249, 251, 0.2) 0%, rgba(247, 249, 251, 0.96) 58%, rgba(247, 249, 251, 1) 100%);
  }

  .shop-shell,
  .admin-grid,
  .admin-split,
  .product-detail {
    grid-template-columns: 1fr;
    padding-left: 14px;
    padding-right: 14px;
  }

  .filters,
  .detail-info {
    position: static;
  }

  .filters {
    padding: 14px;
  }

  .catalog-heading {
    margin-bottom: 14px;
  }

  .product-card {
    min-height: auto;
    padding: 14px;
  }

  .product-photo {
    border-radius: 8px;
  }

  .legal-section,
  .product-page,
  .admin-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .legal-inner,
  .detail-info {
    padding: 16px;
  }

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

@media (max-width: 520px) {
  .product-actions,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero p:not(.eyebrow) {
    font-size: 16px;
  }

  .site-header {
    padding: 12px 14px;
  }

  .button {
    width: 100%;
  }

  th,
  td {
    padding: 10px 8px;
  }
}
