/* ==========================================================================
   X SHOP — предпросмотр витрины в рамке телефона (ui/store-preview.js)
   Цвета витрины задаются переменными темы: --sp-bg, --sp-surface, --sp-text,
   --sp-text2, --sp-line, --sp-accent (ui/themes.js).
   ========================================================================== */

.phone {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  aspect-ratio: 9 / 18.6;
  padding: 10px;
  border-radius: 44px;
  background: linear-gradient(160deg, #2A3142, #10141C 40%, #1B2130);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 30px 80px -24px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.phone__notch {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 2;
  width: 76px;
  height: 22px;
  margin-left: -38px;
  border-radius: 12px;
  background: #05060A;
}

.sp {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 34px;
  background: var(--sp-bg);
  color: var(--sp-text);
  font-size: 11px;
  transition: background-color var(--dur-3), color var(--dur-3);
}
.sp * { transition: background-color var(--dur-3), color var(--dur-3), border-color var(--dur-3); }

.sp-cover {
  height: 30%;
  background:
    radial-gradient(80% 90% at 80% 0%, color-mix(in srgb, var(--sp-accent) 70%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--sp-accent) 45%, var(--sp-bg)), var(--sp-bg));
  background-size: cover;
  background-position: center;
}
.sp-head {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: -26px;
  padding: 0 14px;
}
.sp-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 15px;
  background: var(--sp-accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 0 0 3px var(--sp-bg);
}
.sp-logo img { width: 100%; height: 100%; object-fit: cover; }
.sp-title { min-width: 0; padding-bottom: 2px; }
.sp-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sp-desc {
  color: var(--sp-text2);
  font-size: 10px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sp-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 14px 0;
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--sp-surface);
  color: var(--sp-text2);
  box-shadow: 0 0 0 1px var(--sp-line) inset;
}
.sp-chips { display: flex; gap: 6px; padding: 10px 14px 0; }
.sp-chips span {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sp-surface);
  color: var(--sp-text2);
  box-shadow: 0 0 0 1px var(--sp-line) inset;
  font-weight: 500;
}
.sp-chips .is-active { background: var(--sp-text); color: var(--sp-bg); box-shadow: none; }
.sp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 14px;
}
.sp-card {
  padding: 6px;
  border-radius: 14px;
  background: var(--sp-surface);
  box-shadow: 0 0 0 1px var(--sp-line) inset;
}
.sp-img {
  aspect-ratio: 1;
  border-radius: 10px;
  background:
    linear-gradient(calc(120deg + var(--i) * 40deg), color-mix(in srgb, var(--sp-accent) 28%, var(--sp-surface)), color-mix(in srgb, var(--sp-text) 6%, var(--sp-surface)));
}
.sp-card__title {
  margin-top: 6px;
  font-weight: 500;
  font-size: 10px;
  line-height: 1.25;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sp-card.is-placeholder .sp-card__title { color: var(--sp-text2); }
.sp-card__row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.sp-price { font-weight: 700; font-size: 11px; }
.sp-add {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: var(--sp-accent);
  color: #fff;
}
.sp-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px 16px;
  background: linear-gradient(transparent, var(--sp-bg) 40%);
}
.sp-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  border-radius: 12px;
  background: var(--sp-accent);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
}
