/* Объём карточек каталога и избранного в обеих темах. */
body[data-tone="ivory"] .product-grid .product {
  border: 1px solid #d8dfd5;
  background: #fafbf8;
  box-shadow: 12px 12px 18px -8px #353a4070;
}

body[data-tone="graphite"] .product-grid .product {
  border: 1px solid #405349;
  background: #1c2b23;
  box-shadow: 12px 12px 18px -8px #d4dcda70;
}

.product-grid .product {
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

body[data-tone="ivory"] .product-grid .product:hover {
  border-color: #a9bd9d;
  box-shadow: 14px 14px 22px -8px #353a4094;
}

body[data-tone="graphite"] .product-grid .product:hover {
  border-color: #79967e;
  box-shadow: 14px 14px 22px -8px #d4dcda94;
}

.product-grid .product:hover { transform: translateY(-4px); }

/* Кнопка демо остаётся ссылкой только при наличии реального адреса. */
.product-grid .card-demo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.product-grid .card-demo .icon {
  width: 25px;
  height: 25px;
  padding: 7px;
  border-radius: 50%;
  background: #d6f292;
  color: #17291b;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1;
  transition: transform .2s ease, background .2s ease;
}

.product-grid .card-demo:hover .icon { transform: scale(1.08); background: #c2ed70; }
.product-grid .card-demo:focus-visible { border-radius: 5px; }
.product-grid .card-actions { gap: 10px; }

/* Мягкая засветка отделяет сердечко от превью без чёткой границы круга. */
.product-grid .favorite,
body[data-tone] .product-grid .favorite {
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0 !important;
  border-radius: 50%;
  background: transparent !important;
  color: #1d3125 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.product-grid .favorite::before,
body[data-tone] .product-grid .favorite::before {
  content: '';
  position: absolute;
  inset: -6px;
  background: radial-gradient(ellipse, #f1f3f1 0%, #f1f3f1eb 30%, #edf0ed99 48%, #edf0ed30 65%, transparent 78%);
  filter: blur(3px);
  pointer-events: none;
}

.product-grid .favorite:hover { transform: scale(1.07); }
.product-grid .favorite:disabled { cursor: wait; opacity: .7; }
body[data-tone] .product-grid .favorite:hover {
  background: transparent !important;
  color: #1d3125 !important;
  box-shadow: none !important;
}
.product-grid .favorite .icon,
body[data-tone] .product-grid .favorite .icon {
  width: 21px;
  height: 21px;
  position: relative;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  filter: none;
}

body[data-tone] .product-grid .favorite[aria-pressed="true"] {
  color: #173d2b !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-tone] .product-grid .favorite[aria-pressed="true"] .icon {
  fill: currentColor;
  stroke: currentColor;
}

@media (max-width: 560px) {
  .product-grid .card-demo { font-size: 12px; }
  .product-grid .card-actions { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .product-grid .product,
  .product-grid .favorite,
  .product-grid .card-demo .icon { transition: none; }
}

/* Серебристые корпуса: экран обрезается внутри, боковые кнопки остаются снаружи. */
.product .showcase-phone,
.product .showcase-side {
  border: 1px solid #e5e9eb;
  padding: 0;
  overflow: visible;
  background: #c7cdd1;
  box-shadow: 1px -1px 0 #f3f5f5, 2px 2px 0 #77838b, 4px 9px 16px #0005;
}
.product .showcase-phone { border-radius: 15px; }
.product .showcase-side { border-radius: 7px; }
.product .showcase-phone::before { content: none; }
.product .device-screen {
  position: absolute;
  inset: 1px;
  overflow: hidden;
  border: 1px solid #273137;
  border-radius: 13px;
  background: #061e12;
  padding: 23px 8px 8px;
}
.product .showcase-side .device-screen {
  inset: 5px 2px 2px;
  padding: 0;
  border-radius: 4px;
}
.product .device-screen > img { display: block; }
.product .showcase-phone .device-screen > img { position: absolute; inset: 17px 0 0; width: 100%; height: calc(100% - 17px); object-fit: cover; object-position: top center; }
.product .device-camera {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: calc(50% + 12px);
  width: 5px;
  height: 5px;
  border: 1px solid #202a32;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #568095, #101923 65%);
  box-shadow: 0 0 0 1px #69747b;
}
.product .showcase-phone .device-camera { left: 50%; transform: translateX(-50%); }
.product .showcase-side .device-camera { top: 1px; left: 50%; width: 3px; height: 3px; }
.product .device-button {
  position: absolute;
  width: 2px;
  border: 1px solid #79848d;
  border-radius: 2px;
  background: linear-gradient(90deg, #f4f6f7, #8d99a2);
}
.product .device-power { right: -3px; top: 37px; height: 20px; }
.product .device-volume { left: -2px; top: 32px; height: 15px; }
.product .device-volume-down { left: -2px; top: 52px; height: 15px; }
.product .showcase-side .device-power { top: -5px; right: 20px; width: 20px; height: 3px; }
.product .showcase-side .device-volume { top: 20px; left: -2px; height: 24px; }

/* Превью без декоративной панели браузера, как в мобильной карточке. */
.product-grid .product .showcase-nav,
.product-grid .product .showcase-browser-toolbar { display: none; }
.product .product-top .product-photo-backdrop { display: none; }
.product .showcase-main { display: flex; flex-direction: column; }
.product .showcase-nav { gap: 8px; padding: 7px 9px; min-height: 27px; background: #f3f5f6; }
.product .showcase-nav b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product .showcase-window-controls { flex: 0 0 48px; display: flex; }
.product .showcase-window-controls svg { width: 48px; height: 12px; }
.product .showcase-browser-toolbar { display: flex; align-items: center; gap: 6px; height: 21px; flex-shrink: 0; padding: 3px 8px; background: #e5e9ec; color: #53616b; }
.product .showcase-browser-toolbar > svg { width: 33px; height: 12px; flex-shrink: 0; }
.product .showcase-browser-toolbar svg,
.product .showcase-window-controls svg { fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.product .showcase-address { display: flex; align-items: center; gap: 5px; flex: 1; height: 14px; border-radius: 8px; background: #fafbfc; padding: 2px 6px; }
.product .showcase-address svg { width: 9px; height: 9px; }
.product .showcase-address-text { overflow: hidden; color: #78858b; font: 5px/1.2 ui-monospace, Consolas, monospace; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; opacity: .72; filter: blur(.25px); }
.product .showcase-browser-menu { font: 12px/1 Arial, sans-serif; }
.product .showcase-main .showcase-landing { flex: 1; min-height: 0; }

/* Настоящее изображение сохраняет детализацию и собственные пропорции. */
.product .showcase-main .showcase-with-photo { padding: 0; overflow: hidden; }
.product .showcase-photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* Технические сведения и форматы привязаны к нижней границе карточки. */
.product-grid .product .product-body { display: flex; flex-direction: column; }
.product-grid .product .product-meta { margin-top: auto; padding-top: 8px; }
.product-grid .product .tags {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  height: 38px; min-height: 38px; overflow: hidden; line-height: 18px; margin: 0 0 12px;
}
.product-grid .product .tags > span { display: inline-block; margin-right: 6px; font-size: 11.5px; line-height: 18px; white-space: nowrap; }
.product-grid .product .tags .tech-separator { padding-left: 6px; }
.product-grid .product .format-chips { min-height: 27px; align-items: flex-start; align-content: flex-start; margin-bottom: 24px; }
.product-grid .product .product-bottom { min-height: 100px; }
.product-grid .product .product-bottom .price { min-height: 64px; }
.product-grid .product .format-chips > span {
  padding: 5px 8px; font-size: 10px; font-weight: 600; line-height: 1.4;
}
/* Плоские метки форматов: цвет зависит от типа предложения, а не его порядка. */
body[data-tone] .format-chips > span {
  background: var(--format-bg, #e5ece8); color: var(--format-ink, #243d36);
  border: 0; border-radius: 0;
  box-shadow: none; text-shadow: none; cursor: inherit;
}
.format-chips .offer-format-source {
  --format-bg: #dcd6ff; --format-ink: #1d1c30;
}
.format-chips .offer-format-installation {
  --format-bg: #efff82; --format-ink: #303c18;
}
/* Дневные кнопки имеют чёткую тень, ночные — мягкую светлую подложку. */
body[data-tone="ivory"] .product-grid { --card-action-shadow: 3px 4px 0 #8b9095; }
body[data-tone="graphite"] .product-grid { --card-action-shadow: 2px 3px 10px #dce4df80; }
.product-grid .product .demo-link { padding: 10.5px 12.6px; font-size: 9.45px; box-shadow: var(--card-action-shadow); }
.product-grid .card-demo { font-size: 12.6px; box-shadow: none; }
.product-grid .card-demo .icon { width: 26.25px; height: 26.25px; box-shadow: var(--card-action-shadow); }

/* На компьютере браузер заполняет фон, устройства остаются перед ним. */
@media (min-width: 601px) {
  .product-grid .product .product-top .showcase-main {
    inset: 0; width: 100%; height: 100%; z-index: 1 !important;
    border: 0; border-radius: 0; transform: none !important; transition: none !important;
  }
  .product-grid .product .showcase-main .showcase-landing { flex: 1 1 0; height: auto !important; }
  .product-grid .product .showcase-with-photo { position: relative; }
  .product-grid .product .showcase-photo { position: absolute; inset: 0; }
  .product-grid .product .showcase-phone { z-index: 3; }
  .product-grid .product .showcase-side { z-index: 2; }
}
