body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f5f5;
}

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

img {
  max-width: 100%;
}

/* HEADER */
.header {
  padding: 20px;
  background: white;
  border-bottom: 1px solid #eee;
}

.logo {
  height: 64px;
  width: auto;
}

/* FILTERS */
.controls {
  display: flex;
  justify-content: center; /* центр */
  padding: 30px;
  background: white;
  border-bottom: 1px solid #eee;
}

/* ПОИСК */
.controls input {
  width: 100%;
  max-width: 600px; /* увеличили */
  padding: 14px 18px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding: 20px;
  align-items: stretch;
}

/* CARD */
.card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  height: 100%;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* IMAGE */
.card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #fafafa;
  padding: 10px;
}

/* CONTENT */
.card-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* TITLE */
.card h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;

  min-height: 40px;
}

/* PRICE */
.price {
  font-size: 18px;
  font-weight: 700;
  margin-top: 5px;
  white-space: nowrap;
}

.currency-mark {
  display: inline-block;
  flex: 0 0 auto;
  color: #00856a;
  font-weight: 800;
  letter-spacing: 0;
}

/* BUTTON */
.card-content > button {
  margin-top: auto;
  padding: 10px;
  border: none;
  background: linear-gradient(90deg, #4cd964, #cddc39);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  font-weight: 500;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-content > button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* ========================= */
/* МОДАЛЬНОЕ ОКНО */
/* ========================= */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  overflow-y: auto;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 1100px;
  border-radius: 16px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  position: relative;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

/* TOP BLOCK */
.modal-top {
  display: flex;
  gap: 30px;
}

/* ГАЛЕРЕЯ */
.gallery {
  flex: 1;
}

.main-image {
  width: 100%;
  height: 420px;
  object-fit: contain;
  background: #fafafa;
  border-radius: 10px;
  cursor: zoom-in;
}

.thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.thumbs img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  cursor: pointer;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.88);
}

.image-viewer.active {
  display: flex;
}

.image-viewer img {
  max-width: 96vw;
  max-height: 94vh;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  cursor: zoom-in;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.image-viewer.zoomed {
  align-items: flex-start;
  justify-content: flex-start;
  overflow: auto;
}

.image-viewer.zoomed img {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.image-viewer-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #222;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

/* ИНФО */
.modal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-info h2 {
  font-size: 22px;
  margin: 10px 0 0 0; /* опустили заголовок */
  font-weight: 600;
}

.modal-price {
  font-size: 24px;
  font-weight: 700;
}

.modal-category {
  font-size: 13px;
  color: #888;
}

.modal-tags {
  font-size: 13px;
  color: #666;
}

.modal-desc {
  font-size: 14px;
  line-height: 1.5;
  color: #444;
  white-space: pre-line;
}

/* ПОДОБНЫЕ ТОВАРЫ */
.related {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee; /* линия-разделитель */
}

.related h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.related-item {
  background: #fafafa;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}

.related-item img {
  width: 100%;
  height: 80px;
  object-fit: contain;
}

.related-item div {
  font-size: 12px;
}

/* КРЕСТИК */
.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 20px;
  cursor: pointer;
}

/* MORE CARD */
.more-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4cd964, #cddc39);
  color: white;
  text-align: center;
}

.more-content {
  padding: 20px;
}

.more-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.more-sub {
  font-size: 14px;
  opacity: 0.9;
}

/* TRACKER (выделенный блок) */
.tracker-box {
  margin-top: 20px;
  padding: 18px;
  background: linear-gradient(135deg, #fffbe6, #fff3c4);
  border: 2px solid #ffd84d;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(255, 200, 0, 0.25);
}

.book-photo-box {
  margin-top: 20px;
  padding: 18px;
  background: linear-gradient(135deg, #fffbe6, #fff3c4);
  border: 2px solid #ffd84d;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(255, 200, 0, 0.25);
}

.tracker-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
  color: #8a6d00;
}

.tracker-text {
  font-size: 13px;
  color: #6b5a00;
  margin-bottom: 12px;
}

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

.book-photo-item {
  display: block;
  width: 100%;
  padding: 0;
  border: 2px solid #ffd84d;
  border-radius: 8px;
  background: #fff;
  cursor: zoom-in;
  overflow: hidden;
}

.book-photo-item:hover {
  border-color: #ffb300;
  box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.2);
}

.book-photo-item img {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: contain;
  padding: 4px;
  background: #fff;
}

.tracker-form {
  display: flex;
  gap: 10px;
}

.tracker-form input {
  flex: 1;
  padding: 10px;
  border: 2px solid #ffd84d;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.tracker-form input:focus {
  border-color: #ffb300;
  box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.2);
}

.tracker-form button {
  padding: 10px 16px;
  border: none;
  background: linear-gradient(90deg, #ffcc00, #ff9900);
  color: #000;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tracker-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 150, 0, 0.3);
}

.tracker-result {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
}

/* RESULT BASE */
.tracker-result {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

/* SUCCESS */
.tracker-success {
  background: #e6ffed;
  border: 2px solid #2ecc71;
  color: #0a5d2a;
}

/* ERROR */
.tracker-error {
  background: #ffe6e6;
  border: 2px solid #ff3b3b;
  color: #7a0000;
}

/* ========================= */
/* MOBILE MODAL */
/* ========================= */

@media (max-width: 768px) {
  .header {
    padding: 14px 16px;
    text-align: center;
  }

  .logo {
    height: 52px;
  }

  .controls {
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .controls input {
    max-width: none;
    padding: 12px 14px;
    font-size: 16px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
  }

  .card img {
    height: 150px;
    padding: 8px;
  }

  .card-content {
    padding: 12px;
    gap: 8px;
  }

  .card h3 {
    font-size: 13px;
    min-height: 34px;
  }

  .price {
    font-size: 16px;
  }

  .card-content > button {
    padding: 9px;
    font-size: 13px;
  }

  .modal {
    align-items: flex-start;
    padding: 10px;
  }

  .modal-content {
    width: min(100%, 560px);
    padding: 16px;
    max-height: calc(100dvh - 20px);
    border-radius: 8px;
    overflow-y: auto;
    gap: 16px;
  }

  /* ГЛАВНОЕ — меняем направление */
  .modal-top {
    flex-direction: column;
    gap: 14px;
  }

  /* ГАЛЕРЕЯ ВВЕРХУ */
  .gallery {
    order: 1;
  }

  /* ФОТО */
  .main-image {
    height: min(58vw, 270px);
  }

  /* МИНИАТЮРЫ */
  .thumbs {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .thumbs img {
    width: 56px;
    height: 56px;
  }

  /* ОПИСАНИЕ НИЖЕ */
  .modal-info {
    order: 2;
  }

  /* ТЕКСТ компактнее */
  .modal-info h2 {
    font-size: 18px;
    line-height: 1.25;
    margin-right: 32px;
  }

  .modal-price {
    font-size: 20px;
  }

  .modal-desc {
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .modal-sku,
  .modal-category,
  .modal-tags {
    font-size: 12px;
    line-height: 1.4;
  }

  .book-photo-grid {
    grid-template-columns: 1fr;
  }

  .book-photo-item img {
    height: 190px;
  }

  .close {
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    z-index: 2;
  }

  .tracker-box {
    padding: 14px;
  }

  .tracker-form {
    flex-direction: column;
  }

  .tracker-form button {
    width: 100%;
  }

  .related {
    margin-top: 10px;
    padding-top: 14px;
  }

  .related h3 {
    font-size: 16px;
  }

  /* ПОХОЖИЕ ТОВАРЫ */
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

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

  .card img {
    height: 190px;
  }

  .main-image {
    height: 230px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

/* VISUAL SHOP POLISH */
body {
  background:
    linear-gradient(180deg, #ffffff 0, #f5f7f8 190px),
    #f5f7f8;
  color: #141414;
}

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 28px;
  box-shadow: 0 8px 28px rgba(20, 20, 20, 0.05);
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand .logo {
  height: 54px;
}

.catalog-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #4cd964, #b7d92b);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(76, 217, 100, 0.22);
}

.catalog-button:hover {
  transform: translateY(-1px);
}

.top-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 44px 56px;
  align-items: center;
  height: 48px;
  border: 2px solid #4cd964;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(20, 132, 58, 0.08);
}

.top-search-scope,
.top-search-camera,
.top-search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: 0;
  cursor: pointer;
}

.top-search-scope {
  padding: 0 14px;
  background: #f5fbf6;
  color: #58615b;
  font-size: 14px;
  border-right: 1px solid #e4efe7;
}

.top-search input {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0 14px;
  font-size: 16px;
  outline: none;
}

.top-search-camera,
.top-search-clear {
  background: #fff;
  color: #68736d;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: color 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.top-search-camera.is-visible,
.top-search-clear.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.top-search-camera:hover,
.top-search-clear:hover {
  background: #f2fbf4;
  color: #111;
}

.top-search-submit {
  background: linear-gradient(90deg, #4cd964, #b7d92b);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.top-nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(58px, auto);
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.top-nav a {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: #66706a;
  text-decoration: none;
  white-space: nowrap;
}

.top-nav span {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8b9690;
  font-size: 20px;
  line-height: 1;
}

#favoritesCount {
  position: absolute;
  top: -5px;
  right: -12px;
  display: none;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3d71;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
}

#favoritesCount.is-visible {
  display: block;
}

.top-nav a.has-favorites span,
.top-nav a.has-favorites em {
  color: #14843a;
}

.top-nav em {
  font-style: normal;
}

.top-nav a:hover {
  color: #14843a;
}

.top-nav a:hover span {
  color: #14843a;
}

.controls {
  display: block;
  padding: 28px 20px 10px;
  border-bottom: none;
  background: transparent;
}

.shop-panel {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px;
  border: 1px solid #e8ecef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(18, 29, 43, 0.06);
}

.shop-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  margin-bottom: 8px;
  color: #40bf62;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.shop-head h1 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.15;
}

.shop-head p {
  max-width: 560px;
  margin: 0;
  color: #666;
  line-height: 1.5;
}

.shop-metrics {
  display: grid;
  grid-template-columns: repeat(2, 120px);
  gap: 10px;
}

.shop-metrics div {
  padding: 14px;
  border: 1px solid #ecf0f1;
  border-radius: 8px;
  background: #f9fbfa;
}

.shop-metrics strong {
  display: block;
  font-size: 20px;
}

.shop-metrics span {
  color: #777;
  font-size: 13px;
}

.search-row {
  position: relative;
}

.search-row::before {
  content: "⌕";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a8a8a;
  font-size: 20px;
}

.controls input {
  max-width: none;
  padding-left: 46px;
  border-color: #dfe5e8;
  background: #fbfcfc;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.controls input:focus {
  border-color: #4cd964;
  outline: none;
  box-shadow: 0 0 0 3px rgba(76, 217, 100, 0.16);
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.category-chips button {
  padding: 9px 14px;
  border: 1px solid #e1e7e4;
  border-radius: 8px;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-weight: 600;
}

.category-chips button:hover {
  border-color: #4cd964;
  color: #15963a;
}

.promo-banners {
  max-width: 1220px;
  margin: 22px auto 0;
  padding: 0 20px;
}

.promo-banners.is-hidden {
  display: none;
}

.promo-carousel {
  position: relative;
  overflow: hidden;
  border: 1px solid #edf0f2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(18, 29, 43, 0.08);
}

.promo-track {
  position: relative;
  min-height: 260px;
}

.promo-banner {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 28px;
  align-items: center;
  min-height: 260px;
  padding: 30px 74px 34px 34px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  cursor: pointer;
}

.promo-banner.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.promo-banner-copy {
  min-width: 0;
}

.promo-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eaffef;
  color: #13853a;
  font-size: 12px;
  font-weight: 800;
}

.promo-banner h2 {
  max-width: 620px;
  margin: 0 0 12px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

.promo-banner p {
  display: -webkit-box;
  max-width: 640px;
  margin: 0 0 18px;
  overflow: hidden;
  color: #5f6871;
  font-size: 15px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.promo-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
}

.promo-price-row strong {
  color: #ff1f5b;
  font-size: 28px;
  font-weight: 900;
}

.promo-price-row del {
  color: #8a8f96;
  font-size: 14px;
}

.promo-price-row del .currency-mark {
  color: inherit;
}

.promo-price-row > span {
  padding: 4px 8px;
  border-radius: 7px;
  background: #ff3d71;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.promo-banner-copy button {
  min-width: 164px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, #4cd964, #a7e520);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.promo-banner-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border-radius: 10px;
  background: #f7f8f8;
}

.promo-banner-media img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  padding: 14px;
}

.promo-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #dfe7e2;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #14843a;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  box-shadow: 0 8px 22px rgba(18, 29, 43, 0.12);
}

.promo-arrow-left {
  left: 16px;
}

.promo-arrow-right {
  right: 16px;
}

.promo-dots {
  position: absolute;
  left: 34px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  gap: 7px;
}

.promo-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #c8d3cd;
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.promo-dot.active {
  width: 24px;
  background: #4cd964;
}

.promo-image-carousel .promo-track {
  height: clamp(230px, 27vw, 360px);
  min-height: 0;
}

.promo-image-carousel .promo-banner {
  display: block;
  position: relative;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  padding: 0;
  background: #111;
}

.promo-banner-img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.promo-banner-bg {
  position: absolute;
  inset: -18px;
  z-index: 1;
  width: calc(100% + 36px);
  height: calc(100% + 36px);
  object-fit: cover;
  filter: blur(18px) saturate(1.18) brightness(0.9);
  transform: scale(1.06);
  opacity: 0.75;
}

.grid {
  max-width: 1220px;
  margin: 0 auto;
  padding: 22px 20px 44px;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 12px;
}

.empty-products {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 44px 20px;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  background: #fff;
  color: #66706a;
  text-align: center;
}

.empty-products strong {
  color: #111;
  font-size: 20px;
}

.empty-products span {
  max-width: 360px;
  line-height: 1.45;
}

.card {
  border: 1px solid #edf0f2;
  border-radius: 8px;
  box-shadow: none;
  overflow: hidden;
  background: #fff;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(18, 29, 43, 0.11);
}

.card-image {
  position: relative;
  background: #f7f8f8;
  border-radius: 8px 8px 0 0;
}

.card-image img,
.card > img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: contain;
  padding: 10px;
  background: #f7f8f8;
}

.stock-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 5px;
  background: linear-gradient(90deg, #4cd964, #cddc39);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.favorite-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(20, 132, 58, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #14843a;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(18, 29, 43, 0.12);
}

.favorite-button:hover {
  transform: none;
  box-shadow: 0 8px 20px rgba(18, 29, 43, 0.16);
}

.favorite-button.active {
  border-color: #4cd964;
  background: linear-gradient(90deg, #4cd964, #b7d92b);
  color: #fff;
  box-shadow: 0 8px 20px rgba(76, 217, 100, 0.28);
}

.discount-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 4px 7px;
  border-radius: 5px;
  background: #ff4f7b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.card-content {
  padding: 10px;
  gap: 6px;
}

.price-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.price {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22em;
  white-space: nowrap;
  color: #e72a50;
  font-size: 18px;
  line-height: 1.1;
  margin: 0;
}

.old-price {
  color: #9a9a9a;
  font-size: 12px;
  text-decoration: line-through;
  white-space: nowrap;
}

.old-price .currency-mark {
  color: inherit;
}

.card h3 {
  min-height: 36px;
  font-size: 13px;
  line-height: 1.28;
  font-weight: 500;
  -webkit-line-clamp: 2;
}

.card-meta {
  color: #8a8a8a;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delivery-note {
  color: #14843a;
  font-size: 11px;
  font-weight: 600;
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #777;
  font-size: 11px;
  line-height: 1.2;
}

.rating-row span:first-child {
  color: #f7a600;
  font-weight: 700;
}

.card-content > button {
  min-height: 34px;
  border-radius: 8px;
  font-weight: 700;
  margin-top: 4px;
  background: linear-gradient(90deg, #4cd964, #b7d92b);
}

.more-card {
  min-height: 360px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.55), transparent 30%),
    linear-gradient(135deg, #38d85e, #c6dd26);
}

.modal-content {
  box-shadow: 0 30px 80px rgba(0,0,0,0.22);
  max-width: 1260px;
}

.product-page {
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(300px, 0.86fr) 292px;
  gap: 26px;
  align-items: start;
}

.product-gallery {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.product-gallery .thumbs {
  display: grid;
  gap: 10px;
  margin-top: 0;
  max-height: 500px;
  overflow: auto;
}

.product-gallery .thumbs img {
  width: 64px;
  height: 64px;
  background: #fff;
}

.main-image-frame {
  background: #f7f8f8;
  border-radius: 14px;
  overflow: hidden;
}

.product-gallery .main-image {
  height: 500px;
  border-radius: 0;
}

.product-trust-strip {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: #14843a;
  font-size: 13px;
  font-weight: 700;
}

.product-trust-strip span {
  padding: 7px 10px;
  border-radius: 8px;
  background: #eaffef;
}

.product-info h2 {
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.18;
}

.product-breadcrumbs {
  color: #7b8790;
  font-size: 13px;
}

.product-rating-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #77828a;
  font-size: 13px;
}

.product-rating-line span:first-child {
  color: #f7a600;
  font-weight: 800;
}

.product-specs {
  display: grid;
  gap: 0;
  border-top: 1px solid #edf0f2;
  border-bottom: 1px solid #edf0f2;
}

.product-specs div {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) 1fr;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f2;
  font-size: 13px;
}

.product-specs div:last-child {
  border-bottom: 0;
}

.product-specs span {
  color: #7d8790;
}

.product-specs strong {
  font-weight: 500;
}

.product-buy-panel {
  display: grid;
  gap: 14px;
}

.product-book-photo-box {
  margin: 16px 0 18px;
}

.product-book-photo-box .tracker-title {
  font-size: 16px;
}

.product-book-photo-box .book-photo-grid {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.product-book-photo-box .book-photo-item img {
  height: 210px;
}

.buy-card,
.delivery-card,
.shop-card {
  padding: 16px;
  border: 1px solid #edf0f2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(18, 29, 43, 0.07);
}

.buy-price-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.buy-old-price {
  margin-top: 3px;
  color: #999;
  font-size: 14px;
  text-decoration: line-through;
}

.buy-old-price .currency-mark {
  color: inherit;
}

.buy-heart {
  width: 44px;
  height: 44px;
  min-height: 0;
  border: 1px solid #dfe7e2;
  border-radius: 12px;
  background: #f7fbf8;
  color: #14843a;
  font-size: 24px;
  cursor: pointer;
}

.buy-heart.active {
  border-color: #4cd964;
  background: linear-gradient(90deg, #4cd964, #b7d92b);
  color: #fff;
  box-shadow: 0 8px 20px rgba(76, 217, 100, 0.28);
}

.installment-note {
  margin: 14px 0 12px;
  padding: 12px;
  border-radius: 10px;
  background: #f1f8ff;
  color: #3f5570;
  font-size: 13px;
  font-weight: 700;
}

.delivery-card h3,
.shop-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.delivery-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #edf0f2;
  font-size: 13px;
}

.delivery-card span,
.delivery-card p,
.shop-mini em {
  color: #7c868d;
}

.delivery-card p {
  margin: 12px 0 0;
  font-size: 13px;
}

.shop-mini {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
}

.shop-mini > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(90deg, #4cd964, #b7d92b);
  color: #fff;
  font-weight: 900;
}

.shop-mini div {
  display: grid;
}

.shop-mini b {
  padding: 6px 8px;
  border-radius: 8px;
  background: #f2f5f3;
  font-size: 13px;
}

@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
    gap: 12px;
    grid-template-columns: auto 1fr auto;
  }

  .brand .logo {
    height: 44px;
  }

  .catalog-button {
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }

  .top-search {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 44px;
    grid-template-columns: auto minmax(0, 1fr) 38px 46px;
  }

  .top-search-scope {
    padding: 0 10px;
    font-size: 13px;
  }

  .top-search input {
    padding: 0 10px;
    font-size: 14px;
  }

  .top-nav {
    gap: 6px;
    font-size: 12px;
    overflow: visible;
    white-space: nowrap;
    grid-auto-columns: minmax(38px, auto);
  }

  #favoritesCount {
    top: -4px;
    right: -10px;
  }

  .top-nav em {
    display: none;
  }

  .top-nav span {
    font-size: 19px;
  }

  .controls {
    padding: 14px 12px 2px;
    position: static;
  }

  .shop-panel {
    padding: 16px;
  }

  .shop-head {
    display: block;
  }

  .shop-head h1 {
    font-size: 26px;
  }

  .shop-head p {
    font-size: 14px;
  }

  .shop-metrics {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 14px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
  }

  .promo-banners {
    margin-top: 14px;
    padding: 0 12px;
  }

  .promo-track {
    min-height: 390px;
  }

  .promo-banner {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 390px;
    padding: 14px 16px 44px;
  }

  .promo-banner-media {
    order: -1;
    min-height: 145px;
  }

  .promo-banner-media img {
    height: 145px;
  }

  .promo-banner h2 {
    font-size: 22px;
  }

  .promo-banner p {
    font-size: 14px;
    -webkit-line-clamp: 2;
  }

  .promo-arrow {
    top: 148px;
    width: 34px;
    height: 34px;
    font-size: 26px;
  }

  .promo-arrow-left {
    left: 10px;
  }

  .promo-arrow-right {
    right: 10px;
  }

  .promo-dots {
    left: 18px;
    bottom: 18px;
  }

  .card-image img,
  .card > img {
    height: 150px;
    padding: 10px;
  }

  .stock-badge {
    font-size: 11px;
  }

  .product-page {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .product-gallery {
    grid-template-columns: 1fr;
  }

  .product-gallery .thumbs {
    display: flex;
    order: 2;
    max-height: none;
    overflow-x: auto;
  }

  .main-image-frame {
    order: 1;
  }

  .product-gallery .main-image {
    height: 300px;
  }

  .product-trust-strip {
    grid-column: auto;
    order: 3;
  }

  .product-info h2 {
    font-size: 21px;
  }

  .product-info {
    order: 3;
  }

  .product-buy-panel {
    order: 4;
  }

  .product-book-photo-box {
    grid-column: auto;
  }

  .product-book-photo-box .book-photo-grid {
    grid-template-columns: 1fr;
  }

  .product-book-photo-box .book-photo-item img {
    height: 260px;
  }
}

@media (max-width: 420px) {
  .header {
    grid-template-columns: 1fr auto;
  }

  .brand {
    grid-column: 1;
  }

  .catalog-button {
    grid-column: 2;
  }

  .top-search,
  .top-nav {
    grid-column: 1 / -1;
  }

  .grid {
    justify-content: center;
    grid-template-columns: minmax(0, min(320px, calc(100vw - 34px)));
  }

  .card-image img,
  .card > img {
    height: 180px;
  }
}

.promo-image-carousel .promo-track {
  height: clamp(230px, 27vw, 360px);
  min-height: 0;
}

.promo-image-carousel .promo-banner {
  display: block;
  position: relative;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  padding: 0;
  background: #111;
}

.promo-image-carousel .promo-banner-img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.promo-image-carousel .promo-banner-bg {
  position: absolute;
  inset: -18px;
  z-index: 1;
  width: calc(100% + 36px);
  height: calc(100% + 36px);
  object-fit: cover;
  filter: blur(18px) saturate(1.18) brightness(0.9);
  transform: scale(1.06);
  opacity: 0.75;
}

@media (max-width: 768px) {
  .promo-image-carousel .promo-track {
    height: clamp(210px, 56vw, 320px);
  }

  .promo-image-carousel .promo-arrow {
    top: 50%;
  }
}

.promo-image-carousel {
  background: #111;
}

.promo-image-carousel .promo-track {
  position: relative;
  height: clamp(250px, 31vw, 380px);
  min-height: 0;
  background: #111;
}

.promo-image-carousel .promo-banner,
.promo-image-carousel .promo-banner.active {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: #111;
}

.promo-image-carousel .promo-banner {
  opacity: 0;
  pointer-events: none;
  transform: none;
}

.promo-image-carousel .promo-banner.active {
  opacity: 1;
  pointer-events: auto;
}

.promo-image-carousel picture {
  display: block;
  width: 100%;
  height: 100%;
}

.promo-image-carousel .promo-banner-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 768px) {
  .promo-image-carousel .promo-track {
    height: clamp(230px, 58vw, 340px);
  }

  .promo-image-carousel .promo-banner-img {
    object-fit: contain;
  }
}
