:root {
  color-scheme: light;
  --bg: #f8f5ec;
  --card: #ffffff;
  --ink: #1f211c;
  --muted: #6e7067;
  --line: #e7dfd0;
  --primary: #576345;
  --primary-dark: #39432c;
  --secondary: #c4d2bf;
  --secondary-strong: #aebfa8;
  --admin-bg: #f5f2ea;
  --admin-nav: #22291d;
  --radius: 30px;
  --shadow: 0 22px 70px rgba(31, 33, 28, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
}

body:not(.admin-page) {
  display: flex;
  flex-direction: column;
}

body:not(.admin-page) main {
  flex: 1;
}

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

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

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

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(87, 99, 69, 0.22);
  outline-offset: 2px;
}

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

h1,
h2,
.brand,
.admin-logo {
  font-family: Georgia, 'Times New Roman', serif;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
}

.shell {
  width: min(1240px, calc(100vw - 56px));
  margin-inline: auto;
}

.hidden {
  display: none !important;
}

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

.muted,
.form-message {
  color: var(--muted);
}

.form-message.is-error {
  color: #9f2f24;
}

.button,
.plain-button,
.icon-button,
.filter-chip {
  border: 0;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--radius);
  font-weight: 700;
}

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

.button--primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 12px 26px rgba(57, 67, 44, 0.18);
}

.button--soft {
  color: var(--primary-dark);
  background: var(--secondary);
}

.button--soft:hover {
  background: var(--secondary-strong);
}

.button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.plain-button {
  padding: 0;
  color: var(--primary);
  background: transparent;
  font-weight: 700;
}

.text-link {
  color: var(--primary);
  font-weight: 800;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: #f0eadf;
  border-radius: 50%;
}

.site-header {
  position: static;
  z-index: 80;
  background: rgba(248, 245, 236, 0.9);
  border-bottom: 1px solid rgba(231, 223, 208, 0.8);
  backdrop-filter: blur(18px);
}

#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 58px;
}

.brand,
.admin-logo {
  font-size: 1.55rem;
  font-style: italic;
  font-weight: 800;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-nav a.active,
.site-nav a:hover {
  color: var(--primary-dark);
}

.cart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  min-width: 66px;
  padding: 0 13px;
  color: var(--primary-dark);
  background: var(--secondary);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.cart-button__icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-button strong {
  min-width: 1ch;
  font-size: 0.9rem;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 0;
}

.menu-toggle span {
  display: block;
  width: 23px;
  height: 2px;
  background: var(--ink);
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: min(560px, calc(100vh - 58px));
  overflow: hidden;
}

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

.hero__shade {
  z-index: -1;
  background: linear-gradient(90deg, rgba(248, 245, 236, 0.98) 0%, rgba(248, 245, 236, 0.78) 44%, rgba(248, 245, 236, 0.2) 100%);
}

.hero__content {
  display: grid;
  align-content: center;
  min-height: min(560px, calc(100vh - 58px));
  padding: 48px 0 68px;
}

.hero h1 {
  max-width: 780px;
  font-size: clamp(3.4rem, 6vw, 5.4rem);
}

.hero__content p:not(.eyebrow) {
  max-width: 620px;
  color: #42473a;
  font-size: 1.18rem;
  line-height: 1.75;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.section {
  padding: 78px 0;
}

.section--muted {
  background: #f2efe5;
}

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

.intro-grid,
.author-layout,
.contacts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 56px;
  align-items: center;
}

.author-layout {
  gap: 68px;
  align-items: start;
}

.author-layout .button {
  margin-top: 10px;
}

.intro-copy p:not(.eyebrow),
.page-head p,
.rich-text,
.line-list,
.contact-list {
  color: var(--muted);
  line-height: 1.75;
}

.portrait-frame {
  margin: 0;
  overflow: hidden;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.portrait-frame img {
  width: 100%;
  height: 360px;
  object-fit: cover;
}

.portrait-frame--large img {
  height: 520px;
}

.page {
  padding-top: 56px;
  padding-bottom: 86px;
}

.page-head {
  max-width: 760px;
  margin-bottom: 34px;
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.filter-chip {
  min-height: 42px;
  padding: 0 18px;
  color: var(--primary-dark);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.filter-chip.active,
.filter-chip:hover {
  background: var(--secondary);
  border-color: var(--secondary);
}

.select-field {
  display: grid;
  gap: 8px;
  min-width: 230px;
  color: var(--muted);
  font-size: 0.86rem;
}

.catalog-controls {
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 10px;
  max-width: 560px;
}

.compact-field {
  display: grid;
  gap: 8px;
  width: 150px;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.art-card {
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(231, 223, 208, 0.9);
  border-radius: var(--radius);
  box-shadow: 0 14px 44px rgba(31, 33, 28, 0.05);
}

.art-card__image {
  display: block;
  overflow: hidden;
  background: #eee8dc;
}

.art-card__image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.22s ease;
}

.art-card:hover .art-card__image img {
  transform: scale(1.035);
}

.art-card__body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.art-card__meta,
.art-card__status {
  color: var(--muted);
  font-size: 0.92rem;
}

.art-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.art-card__price {
  font-weight: 800;
}

.art-card__body > .button {
  width: 100%;
}

.artwork-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  align-items: start;
}

.artwork-main {
  display: grid;
  gap: 22px;
}

.artwork-image-button {
  padding: 0;
  border: 0;
  cursor: zoom-in;
}

.artwork-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 680px;
  overflow: hidden;
  isolation: isolate;
  background: #f0eadf;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.artwork-frame::before,
.artwork-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.artwork-frame::before {
  z-index: -2;
  background-image: var(--artwork-bg);
  background-size: cover;
  background-position: center;
  filter: blur(12px);
  transform: scale(1.04);
  opacity: 0.36;
}

.artwork-frame::after {
  z-index: -1;
  background: rgba(248, 245, 236, 0.42);
}

.artwork-detail__image {
  width: 100%;
  height: 680px;
  object-fit: contain;
  object-position: center;
}

.artwork-panel {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.artwork-panel > * {
  min-width: 0;
}

.artwork-panel h1 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 2.55vw, 2.85rem);
  line-height: 1.08;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.artwork-panel strong {
  font-size: 1rem;
}

.artwork-panel .button {
  width: 100%;
  min-height: 42px;
  font-size: 0.95rem;
}

.artwork-info-block {
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.artwork-info-block h2 {
  margin-bottom: 14px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.2rem;
}

.artwork-info-block p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.75;
}

.spec-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.spec-list div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.spec-list dt {
  color: var(--muted);
}

.spec-list dd {
  margin: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 38px;
}

.info-card {
  padding: 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.line-list,
.rich-text {
  display: grid;
  gap: 16px;
}

.rich-text {
  max-width: 760px;
}

.line-list p,
.rich-text p {
  margin: 0;
}

.contact-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  font-size: 1.12rem;
}

.contact-item {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.site-footer {
  margin-top: auto;
  color: rgba(255, 255, 255, 0.82);
  background: #2b2d2b;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(120px, 0.55fr) minmax(150px, 0.75fr) minmax(150px, 0.6fr);
  align-items: start;
  gap: 48px;
  min-height: 250px;
  padding: 20px 0 42px;
}

.footer-brand {
  display: inline-flex;
  margin-bottom: 10px;
  color: #fff;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2rem;
  font-style: italic;
  font-weight: 800;
}

.footer-about p,
.footer-column span {
  margin: 0;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.25;
}

.footer-column {
  display: grid;
  gap: 9px;
  justify-items: start;
}

.footer-column a {
  color: rgba(255, 255, 255, 0.86);
}

.footer-column a:hover {
  color: #fff;
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.social-link {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #2aabee;
  background: transparent;
  border-radius: 50%;
}

.social-link:hover {
  color: #58c2f4;
}

.social-link svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.social-link .telegram-mark {
  fill: #fff;
}

.cart-drawer,
.image-modal,
.success-modal {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: none;
  background: rgba(31, 33, 28, 0.38);
}

.cart-drawer.open,
.image-modal.open,
.success-modal.open {
  display: grid;
}

.cart-drawer {
  justify-items: end;
}

.cart-panel {
  width: min(480px, 100%);
  height: 100%;
  overflow: auto;
  padding: 24px;
  background: var(--bg);
}

.cart-head,
.cart-item,
.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cart-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item img {
  width: 76px;
  height: 62px;
  object-fit: cover;
  border-radius: 22px;
}

.cart-item div {
  display: grid;
  flex: 1;
  gap: 4px;
}

.cart-total {
  margin: 20px 0;
  font-size: 1.15rem;
}

.checkout-form,
.admin-form {
  display: grid;
  gap: 12px;
}

.image-modal,
.success-modal {
  place-items: center;
  padding: 28px;
}

.image-modal img {
  max-width: min(1100px, 92vw);
  max-height: 86vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.success-card {
  width: min(430px, 100%);
  padding: 34px;
  text-align: center;
  background: var(--card);
  border-radius: var(--radius);
}

.success-card h2 {
  margin-bottom: 18px;
}

.success-card p {
  margin-bottom: 24px;
}

.admin-page {
  background: var(--admin-bg);
}

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

.admin-login__panel {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 30px 18px;
  color: #f7f8f3;
  background: var(--admin-nav);
}

.admin-logo {
  margin-bottom: 22px;
  color: #fff;
  font-size: 2rem;
}

.admin-nav {
  min-height: 46px;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.76);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.admin-nav.active,
.admin-nav:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.admin-exit {
  margin-top: auto;
}

.admin-content {
  min-width: 0;
  padding: 30px 34px 54px;
}

.admin-topline,
.admin-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-topline h1 {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card,
.admin-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 32px rgba(31, 33, 28, 0.04);
}

.stat-card {
  padding: 24px;
}

.stat-card span {
  color: var(--muted);
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

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

.admin-grid {
  grid-template-columns: minmax(340px, 0.8fr) minmax(0, 1.2fr);
}

.admin-card {
  padding: 20px;
}

.admin-card h2 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.25rem;
}

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

.admin-table {
  display: grid;
  gap: 10px;
}

.admin-row,
.order-row,
.table-row,
.mini-art-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fbfaf6;
  border: 1px solid var(--line);
  border-radius: 24px;
}

.admin-row {
  grid-template-columns: 74px minmax(0, 1fr) auto;
}

.admin-row img,
.mini-art-row img {
  width: 74px;
  height: 60px;
  object-fit: cover;
  border-radius: 20px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.order-row {
  grid-template-columns: minmax(0, 1fr) 180px;
}

.table-row,
.mini-art-row {
  grid-template-columns: 70px minmax(0, 1fr) 110px 110px;
  min-height: 58px;
}

.table-row > *,
.mini-art-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 12px;
  margin: 18px 0;
}

.settings-form {
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field input,
.field textarea {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
}

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

.file-field {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  color: var(--muted);
  background: #fbfaf6;
  border: 1px dashed #cfc7b8;
  border-radius: var(--radius);
}

.upload-preview {
  width: 190px;
  height: 130px;
  object-fit: cover;
  border-radius: 24px;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.check-line input {
  width: auto;
  min-height: auto;
  accent-color: var(--primary);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: var(--primary-dark);
  background: var(--secondary);
  border-radius: var(--radius);
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .shell {
    width: min(100% - 36px, 1240px);
  }

  .site-nav {
    position: fixed;
    inset: 64px 18px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  body.nav-open .site-nav {
    display: flex;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

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

  .intro-grid,
  .author-layout,
  .contacts-layout,
  .artwork-detail,
  .admin-layout,
  .dashboard-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

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

  .footer-inner {
    grid-template-columns: minmax(220px, 1fr) minmax(120px, 0.7fr);
  }

  .artwork-panel {
    position: static;
  }
}

@media (max-width: 900px) {
  .catalog-tools {
    grid-template-columns: 1fr;
  }

  .catalog-controls {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 680px) {
  h1 {
    font-size: 3rem;
  }

  .hero,
  .hero__content {
    min-height: 520px;
  }

  .hero__shade {
    background: linear-gradient(180deg, rgba(248, 245, 236, 0.98), rgba(248, 245, 236, 0.72));
  }

  .section {
    padding: 54px 0;
  }

  .section-head,
  .catalog-tools,
  .admin-topline,
  .admin-card__head {
    align-items: stretch;
    flex-direction: column;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: auto;
  }

  .art-grid,
  .info-grid,
  .stats-grid,
  .form-row,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .catalog-controls {
    justify-content: stretch;
  }

  .compact-field,
  .select-field {
    width: 100%;
    min-width: 0;
  }

  .artwork-frame {
    min-height: 360px;
  }

  .artwork-detail__image {
    height: 420px;
  }

  .admin-row,
  .order-row,
  .table-row,
  .mini-art-row {
    grid-template-columns: 1fr;
  }

  .admin-row img,
  .mini-art-row img {
    width: 100%;
    height: 150px;
  }
}
