* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; background: #f7f7f7; color: #222; }
.topbar { background: #111; color: #fff; padding: 10px 16px; display: flex; align-items: center; }
.topbar nav { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; font-size: 15px; }
.container { max-width: 1000px; margin: 24px auto; padding: 0 16px; }
h1 { margin-top: 0; }
.group h2 { border-bottom: 2px solid #ddd; padding-bottom: 6px; margin-top: 32px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); display: flex; flex-direction: column; }
.card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.noimg { height: 180px; background: #eee; display: flex; align-items: center; justify-content: center; color: #999; }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.card h3 { margin: 0; font-size: 16px; }
.price { font-weight: 700; color: #333; margin: 0; }
button { background: #111; color: #fff; border: 0; padding: 10px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; }
button:disabled { background: #bbb; cursor: not-allowed; }
.footer { text-align: center; padding: 24px; color: #666; font-size: 14px; }
.empty { color: #666; }

/* Корзина */
.cart-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.cart-table th, .cart-table td { padding: 10px; border-bottom: 1px solid #eee; text-align: left; }
.cart-table th { background: #f0f0f0; font-weight: 600; }
.cart-table .qty { display: flex; align-items: center; gap: 8px; }
.cart-table .inline { display: inline; }
button.mini { padding: 4px 10px; border-radius: 6px; font-size: 14px; }
button.danger { background: #c33; }
.cart-total { text-align: right; font-size: 20px; margin: 20px 0; }
.cart-actions { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.btn-primary, .btn-secondary { display: inline-block; padding: 12px 20px; border-radius: 8px; text-decoration: none; }
.btn-primary { background: #111; color: #fff; }
.btn-secondary { background: #e5e5e5; color: #222; }
.checkout-form { background: #fff; padding: 24px; border-radius: 10px; max-width: 560px; }
.checkout-form label { display: block; margin-bottom: 14px; font-weight: 600; }
.checkout-form input, .checkout-form textarea { display: block; width: 100%; padding: 10px; margin-top: 4px; border: 1px solid #ccc; border-radius: 6px; font-size: 15px; font-family: inherit; }
.note { color: #666; font-size: 14px; margin-top: 12px; }
.thanks { text-align: center; padding: 40px 20px; background: #fff; border-radius: 10px; }
.thanks h1 { color: #2a2; }

/* Форма оформления */
.checkout-form fieldset { border: 1px solid #ddd; border-radius: 8px; padding: 14px; margin: 0 0 16px; }
.checkout-form legend { padding: 0 8px; font-weight: 700; }
.radio { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-bottom: 8px; cursor: pointer; }
.radio input { width: auto; margin: 0; }
.info-box { background: #f5f7fa; border-left: 3px solid #4a90e2; padding: 12px 14px; border-radius: 6px; margin: 12px 0; font-size: 14px; }
.info-box ul { margin: 6px 0 0 18px; padding: 0; }
.info-box li { margin-bottom: 6px; }
.warn { background: #fff4e5; border-left: 3px solid #f5a623; padding: 10px 14px; border-radius: 6px; margin: 12px 0; font-size: 14px; }
.extra { font-size: 14px; color: #666; margin-top: 6px; font-weight: 400; }
select { display: block; width: 100%; padding: 10px; margin-top: 4px; border: 1px solid #ccc; border-radius: 6px; font-size: 15px; font-family: inherit; background: #fff; }

/* Карточка товара */
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.fav-form { margin: 0; }
.fav-btn { background: none; border: 0; padding: 0; font-size: 20px; cursor: pointer; line-height: 1; }
.qty-control { display: flex; align-items: center; gap: 10px; justify-content: center; }
.qty-val { font-weight: 700; min-width: 24px; text-align: center; }
.stock { font-size: 12px; color: #888; margin: 4px 0 0; text-align: center; }
.toast { background: #fff4e5; border: 1px solid #f5a623; color: #663c00; padding: 10px 16px; border-radius: 8px; margin-bottom: 16px; }

/* Согласие и сохранённые данные */
.consent { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 14px; margin: 16px 0; line-height: 1.4; }
.consent input { width: auto; margin: 3px 0 0; flex-shrink: 0; }
.consent a { color: #0066cc; }
.saved-banner { background: #e8f4ff; border: 1px solid #b3d9ff; border-radius: 8px; padding: 14px 16px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.muted { color: #888; font-size: 13px; }

/* Hero-блок Машки */
.hero {
  display: flex;
  gap: 20px;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.hero-photo {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid #f0f0f0;
}
.hero-text { font-size: 15px; line-height: 1.5; color: #333; }
.hero-text p { margin: 0 0 8px; }
.hero-lead { font-weight: 600; font-size: 16px; }
.hero-muted { color: #777; font-size: 14px; }
@media (max-width: 560px) {
  .hero { flex-direction: column; text-align: center; padding: 20px 16px; }
  .hero-photo { width: 110px; height: 110px; }
}

/* О нас */
.about-section { margin-bottom: 40px; }
.about-section h2 { border-bottom: 2px solid #ddd; padding-bottom: 8px; margin-bottom: 16px; }
.video-wrap { background: #000; border-radius: 10px; overflow: hidden; max-width: 420px; }
.video-wrap video { width: 100%; display: block; }
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.link-card {
  display: flex; gap: 14px; align-items: center;
  background: #fff; padding: 16px; border-radius: 10px;
  text-decoration: none; color: #222;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: transform .15s, box-shadow .15s;
}
.link-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.link-emoji { font-size: 28px; flex-shrink: 0; }
.link-card strong { display: block; margin-bottom: 2px; }
.link-card p { margin: 0; font-size: 13px; color: #666; }

/* Категории */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.category-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  text-decoration: none;
  color: #222;
  min-height: 110px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: transform .15s, box-shadow .15s;
}
.category-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.cat-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.cat-count { font-size: 13px; color: #888; }
.breadcrumbs { margin-bottom: 16px; }
.breadcrumbs a { color: #0066cc; text-decoration: none; font-size: 14px; }
.breadcrumbs a:hover { text-decoration: underline; }

/* Круглая фотка на главной */
.hero-photo-round { border-radius: 50%; }

/* Мини-блок Машки в оформлении */
.mashka-hint {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fff;
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.mashka-mini {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #f0f0f0;
}
.mashka-text { font-size: 14px; line-height: 1.45; color: #333; }
.mashka-text p { margin: 0 0 6px; }
.mashka-text p:last-child { margin-bottom: 0; }
@media (max-width: 560px) {
  .mashka-mini { width: 64px; height: 64px; }
  .mashka-text { font-size: 13px; }
}

/* Фон главной */
body.home-bg {
  background: #f7f7f7;
  position: relative;
}
body.home-bg {
  background: #f7f7f7;
}
body.home-bg .hero {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(2px);
}
body.home-bg h1 {
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
}
body.home-bg .category-card {
  background: rgba(255,255,255,.95);
}

/* Карточки категорий с фото */
.category-card {
  padding: 0;
  overflow: hidden;
  position: relative;
  min-height: 128px;
  display: flex;
  align-items: flex-end;
}
.cat-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.category-card .cat-name {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 14px 18px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

/* Реплика Машки на странице "Заказ принят" — облачко сверху, фото снизу */
.mashka-speech {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
  gap: 0;
}
.speech-photo {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  margin-top: -8px;  /* небольшой зазор под хвостиком облачка */
  position: relative;
  z-index: 1;
}
.speech-bubble {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.5;
  color: #222;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  max-width: 480px;
  text-align: center;
  margin-bottom: 18px;
}
.speech-bubble p { margin: 0; }
.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border: 9px solid transparent;
  border-top-color: #fff;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.04));
}
@media (max-width: 560px) {
  .speech-photo { width: 110px; height: 110px; }
  .speech-bubble { font-size: 14px; padding: 14px 16px; }
}

/* Фон в категориях */
body.cat-bg {
  background: #f7f7f7;
  position: relative;
}
body.cat-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--cat-bg) no-repeat center center;
  background-size: cover;
  opacity: .35;
}
body.cat-bg .grid .card {
  background: rgba(255,255,255,.97);
}
body.cat-bg h1,
body.cat-bg .breadcrumbs a {
  color: #111;
  text-shadow: 0 1px 2px rgba(255,255,255,.8);
}

/* Фон в корзине */
body.cart-bg {
  background: #f7f7f7;
  position: relative;
}
body.cart-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/static/images/Mashka.jpg') no-repeat center center;
  background-size: cover;
  opacity: .25;
}
body.cart-bg .cart-table {
  background: rgba(255,255,255,.97);
}
body.cart-bg h1 {
  color: #111;
  text-shadow: 0 1px 2px rgba(255,255,255,.9);
}

/* Фон в оформлении заказа */
body.checkout-bg {
  background: #f7f7f7;
  position: relative;
}
body.checkout-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/static/images/korzina.jpg') no-repeat center center;
  background-size: cover;
  opacity: .25;
}
body.checkout-bg .checkout-form,
body.checkout-bg .mashka-hint {
  background: rgba(255,255,255,.97);
}
body.checkout-bg h1 {
  color: #111;
  text-shadow: 0 1px 2px rgba(255,255,255,.9);
}

/* Вертикальное видео */
.video-vertical video {
  max-width: 420px;
  margin: 0 auto;
  display: block;
}
