:root {
  --ink: #2b2a26;
  --ink-2: #3f3d38;
  --muted: #7a766e;
  --cream: #fff6ef;
  --paper: #fff6ef;
  --paper-deep: #e5e0d6;
  --peach: #f4d5c2;
  --surface: #ffffff;
  --line: #e5e0d6;
  --accent: #e26f4e;
  --accent-2: #d45f3d;
  --accent-ink: #fff;
  --ok: #1f7a4c;
  --err: #b42318;
  --shadow: 0 14px 36px rgba(43, 42, 38, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --header-h: 4.75rem;
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  background: var(--cream);
}

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

a {
  color: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 246, 239, 0.92);
  color: var(--ink);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-nav {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  height: 2.47rem;
  width: auto;
  display: block;
}

.nav-center {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1.35rem;
  flex: 1;
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.nav-icon {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
  display: block;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-2);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.15rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-item:hover {
  color: var(--accent);
}

.nav-icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-icon-btn:hover {
  background: var(--peach);
  color: var(--ink);
}

.nav-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.2rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.05rem;
  text-align: center;
}

.mobile-top {
  display: none;
}

.icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: var(--peach);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: #efc7b0;
}

.bottom-nav {
  display: none;
}

.catalog-drawer[hidden] {
  display: none !important;
}

.catalog-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.catalog-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(43, 42, 38, 0.4);
  cursor: pointer;
}

.catalog-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(88vw, 320px);
  background: var(--cream);
  color: var(--ink);
  padding: 1rem 1rem 1.5rem;
  overflow-y: auto;
  box-shadow: 8px 0 28px rgba(43, 42, 38, 0.14);
  transform: translateX(-105%);
  transition: transform 0.28s var(--ease);
}

.catalog-drawer-open .catalog-drawer-panel {
  transform: none;
}

.catalog-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.catalog-drawer-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.catalog-drawer-head .icon-btn {
  background: var(--peach);
  color: var(--ink);
}

.catalog-drawer .my-prints-link {
  display: block;
  margin: 0 0 1rem;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
}

.catalog-drawer .subcatalogs ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.catalog-drawer .subcatalogs a {
  display: block;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  text-decoration: none;
}

.catalog-drawer .subcatalogs a:hover {
  background: var(--peach);
  color: var(--ink);
}

.catalog-drawer .parent-link {
  display: inline-block;
  margin-bottom: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.catalog-drawer .current-catalog {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.catalog-drawer .empty-subcatalogs {
  color: var(--muted);
  font-size: 0.9rem;
}

.site-menu[hidden] {
  display: none !important;
}

.site-menu {
  position: fixed;
  inset: 0;
  z-index: 210;
}

.site-menu-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  margin: 0;
  padding: 0;
  background: rgba(43, 42, 38, 0.4);
  cursor: pointer;
}

.site-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(88vw, 320px);
  background: var(--cream);
  padding: 1rem 1.1rem 1.5rem;
  overflow-y: auto;
  box-shadow: -8px 0 28px rgba(43, 42, 38, 0.14);
  transform: translateX(105%);
  transition: transform 0.28s var(--ease);
}

.site-menu-open .site-menu-panel {
  transform: none;
}

.site-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.site-menu-nav {
  display: grid;
  gap: 0.35rem;
}

.site-menu-nav a {
  display: block;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  color: var(--ink);
}

.site-menu-nav a:hover {
  background: var(--peach);
}

.site-main {
  flex: 1;
  width: 100%;
}

.site-footer {
  margin-top: auto;
  background: var(--ink);
  color: rgba(255, 246, 239, 0.72);
  padding: 2.75rem 1rem 2rem;
}

.footer-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  display: grid;
  gap: 1.35rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  color: #fff;
}

.footer-grid {
  display: grid;
  gap: 1.35rem 2rem;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr 1.2fr;
  }
}

.footer-col-title {
  margin: 0 0 0.55rem;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.footer-links a {
  color: rgba(255, 246, 239, 0.78);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.35;
}

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

.footer-copy {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 246, 239, 0.42);
}

.page {
  width: min(100% - 2rem, var(--max));
  margin: 2rem auto 3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 3vw, 2.25rem);
}

.page h1,
.catalog-header h1,
.design-header h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  color: var(--ink);
}

.page p {
  color: var(--ink-2);
  margin: 0 0 1.1rem;
}

.button,
button.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s ease, box-shadow 0.2s ease;
}

.button:hover,
button.button:hover {
  background: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(226, 111, 78, 0.28);
}

.button:active,
button.button:active {
  transform: translateY(0);
}

.button-secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  box-shadow: none;
}

.button-secondary:hover {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}

.alert {
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fdeceb;
  color: var(--err);
}

.alert-success {
  background: #e8f6ee;
  color: var(--ok);
}

.alert-info {
  background: var(--peach);
  color: var(--ink-2);
}

.alert a {
  color: inherit;
  font-weight: 700;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 960px) {
  :root {
    --header-h: 3.7rem;
    /* высота самой панели без safe-area */
    --bottom-nav-h: 4.15rem;
    /* сколько места реально занимает снизу (панель + home indicator) */
    --bottom-nav-offset: calc(
      var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)
    );
  }

  .desktop-nav {
    display: none;
  }

  .mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: min(100% - 1.25rem, var(--max));
    margin: 0 auto;
    min-height: var(--header-h);
    padding: 0.4rem 0;
  }

  .mobile-top .logo-img {
    height: 2.2rem;
  }

  .mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  .site-main {
    padding-bottom: calc(var(--bottom-nav-offset) + 0.75rem);
  }

  .site-footer {
    padding-bottom: calc(var(--bottom-nav-offset) + 1.5rem);
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--vv-bottom-inset, 0px);
    z-index: 120;
    height: var(--bottom-nav-offset);
    min-height: var(--bottom-nav-offset);
    padding: 0.4rem 0.25rem env(safe-area-inset-bottom, 0px);
    background: var(--ink);
    border-top: 1px solid rgba(255, 246, 239, 0.08);
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  .bottom-nav-item {
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.25rem 0.15rem;
    border: none;
    background: none;
    color: rgba(255, 246, 239, 0.72);
    text-decoration: none;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
  }

  .bottom-nav-item .nav-icon {
    width: 1.3rem;
    height: 1.3rem;
  }

  .bottom-nav-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }

  .bottom-nav-item:hover,
  .bottom-nav-item:focus-visible {
    color: #fff;
  }

  .bottom-nav-item.is-active {
    color: var(--accent);
  }

  .create-choice-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 320;
  }

  .create-choice-sheet[hidden] {
    display: none !important;
  }

  .create-choice-sheet-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(14, 14, 14, 0.48);
    cursor: pointer;
  }

  .create-choice-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 0 0;
    background: var(--surface, #faf9f6);
    box-shadow: 0 -12px 36px rgba(14, 14, 14, 0.18);
    transform: translateY(105%);
    transition: transform 0.28s ease;
  }

  body.create-choice-open .create-choice-sheet-panel {
    transform: none;
  }

  .create-choice-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
  }

  .create-choice-sheet-head h2 {
    margin: 0;
    font-size: 1.1rem;
  }

  .create-choice-sheet-close {
    appearance: none;
    border: none;
    background: rgba(43, 42, 38, 0.08);
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: var(--ink, #2b2a26);
  }

  .create-choice-sheet-lead {
    margin: 0 0 0.85rem;
    color: var(--muted, #6f6f6f);
    font-size: 0.92rem;
  }

  .create-choice-sheet-actions {
    display: grid;
    gap: 0.65rem;
  }

  .create-choice-sheet-actions .button {
    width: 100%;
    text-align: center;
    text-decoration: none;
  }
}
