:root {
  --green-950: #082c1f;
  --green-900: #0b3b2a;
  --green-800: #115740;
  --green-700: #1b6b4d;
  --green-100: #e3efe6;
  --cream: #fff8ea;
  --gold: #e6c36a;
  --red: #b3282d;
  --red-dark: #8c1d22;
  --text-color: #23302a;
  --muted-text: #5c6f65;
  --border-color: #c9d8cf;
  --accent-dark: #8c1d22;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
label:focus-within {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.modal :focus-visible,
.modal label:focus-within {
  outline-color: var(--green-700);
}

.noscript-note {
  padding: 16px;
  text-align: center;
  background: var(--cream);
  color: var(--text-color);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, #0e4a35 0%, var(--green-900) 55%, var(--green-950) 100%) fixed;
  background-color: var(--green-900);
  color: var(--cream);
  line-height: 1.5;
  padding-bottom: 80px;
}

/* Падающий снег: два слоя одной картинки, лежат позади содержимого */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("img/snow.svg"), url("img/snow.svg");
  background-size: 200px 200px, 340px 340px;
  animation: snow-fall 24s linear infinite;
}

@keyframes snow-fall {
  from { background-position: 0 0, 0 0; }
  to { background-position: 40px 200px, -60px 340px; }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }
}

.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 32px;
}

/* Шапка с гирляндой */
.header {
  background-color: var(--green-950);
  border-bottom: 2px solid var(--gold);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 16px;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12px 8px, #ff5a5f 0 4px, transparent 5px),
    radial-gradient(circle at 42px 10px, #ffd45e 0 4px, transparent 5px),
    radial-gradient(circle at 72px 8px, #5ee0a0 0 4px, transparent 5px),
    radial-gradient(circle at 102px 10px, #ff9ec4 0 4px, transparent 5px);
  background-size: 120px 16px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.45));
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 64px;
}

.nav a {
  text-decoration: none;
  border-radius: 50px;
  background-color: var(--gold);
  color: var(--green-950);
  margin-left: 16px;
  padding: 11px 22px;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.nav a:hover {
  background-color: var(--cream);
}

/* Главный баннер */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
  background: radial-gradient(ellipse at 50% 0%, rgba(230, 195, 106, 0.22), transparent 65%);
  border-bottom: 1px solid rgba(230, 195, 106, 0.35);
}

.hero h1 {
  margin-bottom: 14px;
}

.hero h1 img {
  display: block;
  margin: 0 auto;
  max-width: min(100%, 560px);
  height: auto;
}

.subtitle {
  font-size: 1.15rem;
  color: #e9e2c8;
  margin-bottom: 26px;
}

/* Кнопки */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

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

.btn-secondary {
  background: #e6ede8;
  color: var(--text-color);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
}

.btn-danger {
  background: #c94a4a;
  color: #fff;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.85rem;
}

/* Секции и категории */
.section {
  padding: 40px 32px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 16px;
  color: var(--cream);
}

.categories-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-chip {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(230, 195, 106, 0.6);
  background: rgba(255, 248, 234, 0.1);
  color: var(--cream);
  cursor: pointer;
  font-size: 0.9rem;
}

.category-chip:hover {
  background: rgba(255, 248, 234, 0.2);
}

.category-chip.active {
  background: var(--gold);
  color: var(--green-950);
  border-color: var(--gold);
  font-weight: 600;
}

.subcategories-grid {
  margin-top: 12px;
}

/* Сетка товаров */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  align-items: start;
}

.product-card {
  background: var(--cream);
  color: var(--text-color);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

.product-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.product-images img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.product-cover-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}

.product-viewer {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 520px);
  aspect-ratio: 4 / 5;
  margin: 0 auto 16px;
  overflow: hidden;
  border-radius: 8px;
  background: #10231b;
}

.product-viewer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-viewer-nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 40px;
  aspect-ratio: 1;
  padding: 0 0 4px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: rgba(8, 44, 31, 0.75);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.product-viewer-nav:first-child {
  left: 12px;
}

.product-viewer-nav:nth-of-type(2) {
  right: 12px;
}

.product-viewer-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 9px;
  border-radius: 12px;
  background: rgba(8, 44, 31, 0.75);
  color: #fff;
  font-size: 0.8rem;
}

@media (max-width: 560px) {
  .product-viewer {
    width: 100%;
  }

  .product-viewer-nav {
    width: 36px;
  }
}

.product-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green-950);
  margin-bottom: 12px;
}

.product-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.product-meta {
  font-size: 0.85rem;
  color: var(--muted-text);
  margin-bottom: 14px;
}

.product-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--red-dark);
}

.delete-prod-btn {
  margin-top: 12px;
  background: #ffe5e5;
  color: #b02a2a;
  border: none;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}

.add-product-image-btn {
  margin-top: 8px;
  width: 100%;
  background: #fff;
  color: var(--green-800);
  border: 1px solid var(--gold);
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}

/* Футер */
.footer {
  border-top: 2px solid var(--gold);
  background: var(--green-950);
  padding: 30px 0;
  margin-top: 40px;
  text-align: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 12px 0 20px;
}

.social-links a {
  color: var(--gold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.social-links a:hover {
  color: var(--cream);
}

.social-links img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Модальные окна */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 20, 14, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.hidden {
  display: none !important;
}

.modal-content {
  background: #fff;
  color: var(--text-color);
  padding: 24px;
  border-radius: 12px;
  border-top: 5px solid var(--red);
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.modal-content h3 {
  margin-bottom: 16px;
}

.product-modal-content {
  max-width: 860px;
}

.product-modal-close {
  display: block;
  margin: -8px -8px 8px auto;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--green-100);
  color: var(--text-color);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="file"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #b9ccc0;
  border-radius: 8px;
  font-size: 0.95rem;
}

.form-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted-text);
  font-size: 0.8rem;
}

.color-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.color-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.sw-ddeedd { background: #DDEEDD; }
.sw-bfe0c8 { background: #BFE0C8; }
.sw-f3e3c3 { background: #F3E3C3; }
.sw-e8b4b8 { background: #E8B4B8; }

.swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.error-text {
  color: #c94a4a;
  font-size: 0.85rem;
  min-height: 18px;
}

/* Панель админа внизу экрана */
.admin-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #04170f;
  border-top: 2px solid var(--gold);
  color: #fff;
  padding: 12px 0;
  z-index: 50;
}

.admin-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-note {
  font-size: 0.8rem;
  color: #b9ccc0;
  margin-left: 10px;
}

.admin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Телефоны */
@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  .section {
    padding: 32px 16px;
  }

  .header {
    position: relative;
    padding: 12px 0;
  }

  .header-inner {
    flex-direction: column;
    gap: 12px;
  }

  .logo img {
    max-height: 48px;
  }

  .nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .nav a {
    margin-left: 0;
    padding: 8px 14px;
    font-size: 0.9rem;
  }

  .hero {
    padding: 48px 16px 40px;
  }

  .social-links {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .admin-note {
    display: block;
    margin-left: 0;
  }
}

/* Заказ и чат */
.buy-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  text-align: center;
}

.buy-btn-modal {
  max-width: 260px;
  margin-top: 16px;
}

.order-summary {
  margin: -8px 0 14px;
  color: var(--red-dark);
  font-weight: 600;
}

.form-group input[type="datetime-local"],
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #b9ccc0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.form-group textarea {
  resize: vertical;
}

/* Скрытое поле-ловушка для ботов */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.chat-content {
  max-width: 480px;
  display: flex;
  flex-direction: column;
}

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.chat-head h3 {
  margin-bottom: 12px;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #f4faf5;
}

.chat-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-msg time {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  opacity: 0.7;
}

.chat-msg-client {
  align-self: flex-end;
  background: #1b6b4d;
  color: #fff;
}

.chat-msg-shop {
  align-self: flex-start;
  background: #e3efe6;
}

.chat-msg-system {
  align-self: center;
  max-width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted-text);
}

.chat-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #b9ccc0;
  border-radius: 8px;
  font-size: 0.95rem;
}

.chat-forget {
  align-self: center;
  margin-top: 12px;
  border: 0;
  background: none;
  color: var(--muted-text);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

.chat-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  padding: 12px 18px;
  border: 0;
  border-radius: 50px;
  background: var(--red);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.chat-unread {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 8px;
  border-radius: 50%;
  background: #ffd45e;
}

@media (max-width: 640px) {
  .chat-fab {
    right: 12px;
    bottom: 12px;
  }
}

/* MamoMi: палитра и отключение новогодней темы */
:root{--green-950:#010f06;--green-900:#012409;--green-800:#16301f;--green-700:#4f5d3a;--gold:#c9a768;--cream:#f7f4ed}
body{background:linear-gradient(180deg,#05361a 0%,#012409 60%,#010f06 100%) fixed;background-color:#012409}
body::before,.header::after{display:none}
.logo img{height:52px;width:auto}
.hero h1 img.hero-logo{width:min(240px,60vw);height:auto}
.hero-contacts{margin-top:18px;display:flex;gap:24px;justify-content:center;flex-wrap:wrap}
.hero-contacts a,.footer-note{color:var(--gold)}
.sort-select{padding:9px 14px;border-radius:99px;border:1px solid var(--border-color);background:var(--cream);color:var(--text-color);font:inherit}
.section-header{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between}

.header-inner{flex-wrap:wrap;gap:10px 24px}
.lang{display:flex;gap:4px}
.lang button{font:inherit;font-size:14px;background:none;border:1px solid transparent;color:var(--gold);padding:5px 11px;border-radius:99px;cursor:pointer}
.lang button[aria-pressed="true"]{background:var(--gold);color:#16301f}
