:root {
  --bg: #ffffff;
  --ink: #1b1a17;
  --muted: #6e6a62;
  --line: #e8e3da;
  --soft: #f7f5f0;
  --accent: #6f7d56;
  --accent-dark: #455034;
  --danger: #a23a35;
  --radius: 6px;
  --shadow: 0 18px 45px rgba(27, 26, 23, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

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

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

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

.skip-link {
  position: absolute;
  top: -40px;
  left: 12px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  align-items: center;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 78px;
}

.brand {
  display: inline-grid;
  gap: 1px;
  text-align: center;
  letter-spacing: 0;
}

.brand-word,
.footer-brand,
.admin-logo {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 22px;
  font-size: 14px;
  color: #2d2a26;
}

.main-nav a {
  padding: 29px 0;
}

.nav-group {
  position: relative;
}

.nav-menu {
  position: absolute;
  top: calc(100% - 8px);
  left: -18px;
  min-width: 220px;
  padding: 12px 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-group:hover .nav-menu,
.nav-group:focus-within .nav-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-menu a {
  display: block;
  padding: 8px 0;
  color: var(--ink);
}

.icon-button,
.cart-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
}

.menu-button {
  display: none;
  gap: 4px;
}

.menu-button span {
  width: 18px;
  height: 1px;
  background: var(--ink);
}

.cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
}

.cart-pill strong {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
}

.announcement {
  padding: 10px 16px;
  text-align: center;
  color: #fff;
  background: var(--accent);
  font-size: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: center;
  min-height: 660px;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  gap: 48px;
  padding: 52px 0;
}

.hero-media {
  display: grid;
  grid-template-columns: 1fr 0.74fr;
  grid-template-rows: 300px 250px;
  gap: 16px;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--soft);
}

.hero-photo-1 {
  grid-row: span 2;
}

.hero-photo-3 {
  display: none;
}

.hero-copy {
  max-width: 520px;
}

.hero h1 {
  margin: 0 0 24px;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 0.98;
  font-weight: 500;
}

.hero p,
.story-section p,
.static-page,
.rich-text,
.intro-copy {
  color: #3b3832;
  line-height: 1.7;
}

.primary-button,
.secondary-button,
.inline-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

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

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.secondary-button,
.inline-form button {
  background: #fff;
  color: var(--ink);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.primary-button.full {
  width: 100%;
}

.story-section,
.category-section,
.page-intro,
.catalog-toolbar,
.product-grid,
.static-page {
  width: min(1180px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.story-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  padding: 36px 0 70px;
  border-top: 1px solid var(--line);
}

.section-title,
.catalog-toolbar,
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.section-title h2,
.page-intro h1,
.static-page h1,
.product-info h1 {
  margin: 0;
  font-weight: 500;
}

.section-title h2,
.page-intro h1,
.static-page h1 {
  font-size: clamp(34px, 4vw, 54px);
}

.category-section {
  padding: 18px 0 88px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 26px;
}

.category-tile {
  position: relative;
  display: block;
  min-height: 300px;
  overflow: hidden;
  background: var(--soft);
}

.category-tile img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.category-tile:hover img {
  transform: scale(1.035);
}

.category-tile strong,
.tile-letter {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.9);
}

.tile-letter {
  right: 18px;
  top: 18px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.page-intro {
  padding: 72px 0 28px;
}

.page-intro .intro-copy {
  max-width: 720px;
  margin-top: 16px;
}

.catalog-toolbar {
  padding: 0 0 24px;
}

.catalog-toolbar input {
  width: min(300px, 56vw);
  margin-left: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 18px;
  padding-bottom: 88px;
}

.product-card {
  position: relative;
}

.product-image {
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--soft);
  color: var(--muted);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.025);
}

.product-card h2 {
  min-height: 46px;
  margin: 12px 0 6px;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 400;
}

.product-card p,
.product-price {
  margin: 0 0 12px;
  font-weight: 700;
}

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

.product-card button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #e6e2dc;
  color: var(--muted);
}

.product-mark {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 7px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 48px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 92px;
}

.product-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.product-gallery img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--soft);
}

.product-info {
  position: sticky;
  top: 118px;
  align-self: start;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
}

.product-info h1 {
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.08;
}

.product-price {
  margin-top: 20px;
  font-size: 22px;
}

.product-description {
  margin: 24px 0;
  line-height: 1.7;
}

.variant-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 24px;
}

.variant-picker span {
  width: 100%;
  color: var(--muted);
}

.variant-picker button {
  min-width: 48px;
  height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.variant-picker button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.product-tabs {
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.product-tabs details {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.static-page {
  max-width: 840px;
  padding: 74px 0 96px;
}

.site-footer {
  background: var(--soft);
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr;
  gap: 34px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0;
}

.footer-grid h2 {
  margin: 0 0 14px;
  font-size: 15px;
}

.footer-grid p,
.footer-grid a {
  color: #4b4740;
  line-height: 1.55;
}

.inline-form {
  display: flex;
  gap: 8px;
}

.inline-form input {
  min-width: 0;
  flex: 1;
  padding: 0 12px;
  border: 1px solid var(--line);
}

.social-row,
.messenger-row {
  display: grid;
  gap: 8px;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(27, 26, 23, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.cart-drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-panel {
  width: min(440px, 100%);
  height: 100%;
  margin-left: auto;
  overflow: auto;
  background: #fff;
  padding: 24px;
  box-shadow: var(--shadow);
}

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

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

.cart-line img,
.cart-line .mini-placeholder {
  width: 72px;
  height: 96px;
  object-fit: cover;
  background: var(--soft);
}

.cart-line h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.quantity-stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.quantity-stepper button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: #fff;
}

.remove-line {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
}

.checkout-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.checkout-form label,
.edit-form label,
.login-panel label {
  display: grid;
  gap: 6px;
  color: #4b4740;
}

.checkout-form input,
.checkout-form textarea,
.checkout-form select,
.edit-form input,
.edit-form textarea,
.edit-form select,
.login-panel input,
.stock-input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

fieldset {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.radio-line {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.radio-line input {
  width: auto;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
}

.form-status.error,
.error-text {
  color: var(--danger);
}

.admin-body {
  background: #f4f1eb;
}

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

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px;
  background: #1f1d19;
  color: #fff;
}

.admin-sidebar nav {
  display: grid;
  gap: 4px;
  margin-top: 28px;
}

.admin-sidebar a {
  padding: 11px 12px;
  border-radius: var(--radius);
}

.admin-sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

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

.admin-card,
.metric-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(27, 26, 23, 0.05);
}

.admin-card {
  padding: 22px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 20px 0;
}

.metric-card {
  padding: 20px;
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

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

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

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

th {
  color: var(--muted);
  font-weight: 400;
}

.table-thumb {
  width: 54px;
  height: 72px;
  object-fit: cover;
  background: var(--soft);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.edit-form {
  display: grid;
  gap: 16px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 14px;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-grid input {
  width: auto;
}

.form-actions,
.status-form {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.narrow {
  width: min(420px, 100%);
}

.order-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.admin-total {
  text-align: right;
  font-size: 20px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
  }

  .menu-button {
    display: inline-grid;
    grid-column: 1;
    grid-row: 1;
  }

  .brand {
    grid-column: 2;
  }

  .main-nav {
    position: fixed;
    top: 78px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 18px 24px 28px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 10px 0;
  }

  .nav-menu {
    position: static;
    min-width: 0;
    padding: 0 0 0 14px;
    border: 0;
    box-shadow: none;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .hero,
  .product-detail,
  .story-section,
  .footer-grid,
  .order-columns {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
    gap: 28px;
  }

  .hero-media {
    grid-template-rows: 360px;
  }

  .category-grid,
  .product-grid,
  .metric-grid,
  .form-grid,
  .checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-info {
    position: static;
  }

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

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

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

@media (max-width: 640px) {
  .header-inner {
    width: calc(100% - 20px);
    gap: 10px;
  }

  .brand-word {
    font-size: 28px;
  }

  .cart-pill span {
    display: none;
  }

  .hero-media {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .hero-photo {
    aspect-ratio: 3 / 4;
  }

  .hero-photo-2 {
    display: none;
  }

  .category-grid,
  .product-grid,
  .metric-grid,
  .form-grid,
  .checkbox-grid,
  .product-gallery {
    grid-template-columns: 1fr;
  }

  .catalog-toolbar,
  .section-title,
  .admin-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .cart-line {
    grid-template-columns: 60px 1fr;
  }

  .remove-line {
    grid-column: 2;
    justify-self: start;
  }

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