:root {
  --bg: #f7f6f3;
  --bg2: #ffffff;
  --ink: #1a1c1e;
  --muted: #5c636a;
  --line: rgba(26, 28, 30, 0.08);
  --accent: #0f6b5c;
  --accent-soft: #e6f3f0;
  --shadow: 0 18px 50px rgba(26, 28, 30, 0.08);
  --radius: 18px;
  --font: "Manrope", sans-serif;
  --display: "Instrument Serif", Georgia, serif;
  --gutter: clamp(1rem, 2.4vw, 2.75rem);
  --page-max: 72rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1000px 500px at 10% -10%, rgba(15, 107, 92, 0.12), transparent 60%),
    radial-gradient(800px 400px at 100% 0%, rgba(196, 154, 84, 0.14), transparent 55%),
    linear-gradient(180deg, #fbfaf7 0%, #f3f1ec 100%);
}

.wrap {
  width: 100%;
  max-width: calc(var(--page-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding-top: 1.1rem;
  padding-bottom: 0.15rem;
}

.site-logo {
  font-family: var(--display);
  font-size: 1.45rem;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.1;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-nav a {
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font: 500 0.92rem/1.2 var(--font);
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.site-nav a.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.seo-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 46rem;
}

.intro {
  display: grid;
  gap: 0.85rem;
  padding: 1.75rem 0 0.5rem;
}

.intro-body {
  max-width: 46rem;
  animation: rise 0.7s ease both;
}

.intro-body.has-heading {
  display: grid;
  gap: 0.85rem;
}

.intro-heading h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.05rem, 7vw, 3.4rem);
  line-height: 1.12;
  margin: 0;
  color: var(--ink);
}

.intro-text p {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.intro-text p:has(> br:only-child) {
  display: none;
}

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.2rem;
  padding-bottom: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(247, 246, 243, 0.96), rgba(247, 246, 243, 0.88));
  backdrop-filter: blur(8px);
}

.cat {
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font: 500 0.92rem/1.2 var(--font);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cat.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.catalog {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.9rem, 1.5vw, 1.6rem);
  padding-bottom: 3rem;
}

.catalog-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  display: grid;
  gap: 1rem;
  justify-items: start;
  padding: 0.25rem 0 1rem;
}

.catalog-empty .btn {
  min-width: 10rem;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  animation: rise 0.55s ease both;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  min-width: 0;
}

.card-media {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: var(--accent-soft);
  cursor: zoom-in;
  overflow: hidden;
}

.card-media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.card-media img,
.card-ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.card-ph {
  background:
    linear-gradient(135deg, #d9ebe6, #f0ebe1);
}

.card-body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.card-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.3;
}

.card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.price {
  font-weight: 700;
  font-size: 1.05rem;
}

.stock {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font: 600 0.95rem/1 var(--font);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  background: var(--accent);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer p {
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.15rem;
  width: 100%;
}

.footer-nav a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.site-footer-copy {
  margin-left: auto;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 22, 0.45);
  backdrop-filter: blur(4px);
  animation: fade 0.25s ease both;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(90vh, 900px);
  overflow: visible;
  background: var(--bg2);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 0;
  animation: pop 0.28s ease both;
}

.modal-body {
  overflow: auto;
  max-height: min(90vh, 900px);
  padding: 3.5rem 1.25rem 1.25rem;
  border-radius: inherit;
}

.buy-panel {
  width: min(520px, 100%);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 6;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  overflow: visible;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: var(--accent);
  color: #fff;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.detail-actions .btn {
  flex: 1 1 8rem;
}

.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: none;
}

.btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.25rem;
}

.carousel {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--accent-soft);
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}

.carousel-track img {
  min-width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 1.3rem;
}

.carousel-btn.prev { left: 0.6rem; }
.carousel-btn.next { right: 0.6rem; }

.carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.6rem;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
}

.carousel-dots button {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 0;
}

.carousel-dots button.is-active {
  background: #fff;
}

.detail-info h2 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
}

.detail-price {
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 0.25rem;
}

.detail-stock {
  color: var(--muted);
  margin: 0 0 0.9rem;
  font-weight: 700;
}

.detail-long,
.buy-text,
.rich-text {
  color: var(--muted);
  line-height: 1.55;
}

.detail-long {
  margin-bottom: 1.1rem;
}

.buy-text {
  margin-bottom: 1rem;
}

.rich-text p,
.rich-text div,
.rich-text li {
  margin: 0 0 0.25rem;
}
.intro-body p + p,
.rich-text p + p {
  margin-top: 0;
}
.rich-text p:last-child,
.rich-text div:last-child,
.rich-text li:last-child {
  margin-bottom: 0;
}
.rich-text strong, .rich-text b { font-weight: 700; color: var(--ink); }

.intro-heading,
.intro-text {
  margin: 0;
  min-width: 0;
}

.intro-text p {
  margin: 0 0 0.55rem;
}

.intro-text p:last-child {
  margin-bottom: 0;
}

.buy-images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.buy-images img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
}

.buy-contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.buy-contacts a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.buy-contacts a:hover {
  text-decoration: underline;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover,
  .cat:hover,
  .btn:hover {
    transform: translateY(-1px);
  }

  .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 55px rgba(26, 28, 30, 0.12);
  }

  .card:hover .card-media img {
    transform: scale(1.04);
  }
}

@media (min-width: 560px) {
  .catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .catalog {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  :root {
    --page-max: 80rem;
  }

  .site-header {
    padding-top: 1.45rem;
  }

  .intro {
    padding: 2.1rem 0 0.75rem;
  }

  .seo-lead {
    max-width: 52rem;
  }

  .intro-body,
  .intro-body.has-heading {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
    column-gap: clamp(1.75rem, 3.2vw, 3.25rem);
    row-gap: 0.85rem;
    align-items: start;
  }

  .intro-body:not(.has-heading) {
    grid-template-columns: minmax(0, 42rem);
  }

  .intro-heading h1 {
    font-size: clamp(2.35rem, 3.1vw, 3.55rem);
  }

  .intro-text {
    padding-top: 0.2rem;
  }

  .intro-text p {
    font-size: 1.08rem;
    line-height: 1.6;
  }
}

@media (min-width: 1280px) {
  .catalog {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .modal-panel:not(.buy-panel) {
    width: min(1080px, 100%);
  }

  .modal-body {
    padding: 3.75rem 1.7rem 1.6rem;
  }
}

@media (min-width: 1500px) {
  :root {
    --page-max: 92rem;
  }

  .catalog {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .page-bg {
    background:
      radial-gradient(1400px 700px at 8% -15%, rgba(15, 107, 92, 0.13), transparent 60%),
      radial-gradient(1100px 560px at 100% 0%, rgba(196, 154, 84, 0.16), transparent 55%),
      linear-gradient(180deg, #fbfaf7 0%, #f3f1ec 100%);
  }
}

@media (min-width: 1800px) {
  :root {
    --page-max: 108rem;
  }

  .site-logo {
    font-size: 1.7rem;
  }

  .intro-heading h1 {
    font-size: clamp(2.6rem, 2.7vw, 3.75rem);
  }
}

@media (min-width: 2200px) {
  :root {
    --page-max: 120rem;
  }
}

@media (max-width: 800px) {
  .site-header {
    padding-top: 0.95rem;
  }

  .site-nav a,
  .cat {
    min-height: 2.55rem;
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.85rem;
  }

  .intro {
    padding: 1.15rem 0 0.25rem;
    gap: 0.65rem;
  }

  .intro-text p {
    font-size: 1rem;
  }

  .cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px);
    padding-top: 0.7rem;
    padding-bottom: 0.85rem;
  }

  .cats::-webkit-scrollbar {
    display: none;
  }

  .cat {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .card-body {
    padding: 0.9rem 0.95rem 1rem;
  }

  .card-title {
    font-size: 1.02rem;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
  }

  .site-footer-copy {
    margin-left: 0;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-info h2 {
    font-size: 1.55rem;
  }

  .modal {
    padding: 0.5rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    align-items: end;
  }

  .modal-panel {
    width: 100%;
    max-height: min(92vh, 960px);
    border-radius: 18px 18px 12px 12px;
  }

  .modal-body {
    max-height: min(92vh, 960px);
    padding-top: 3.75rem;
  }

  .modal-close {
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    font-size: 1.65rem;
  }

  .detail-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, var(--bg2) 70%, transparent);
    padding: 0.85rem 0 0.15rem;
    margin-top: 0.75rem;
  }

  .detail-actions .btn {
    min-height: 2.85rem;
    font-size: 1rem;
  }
}

@media (max-width: 559px) {
  .catalog-empty .btn {
    width: 100%;
    min-width: 0;
  }

  .btn {
    min-height: 2.75rem;
  }
}
