/* core\src\components\product\ui\calculator\style\variations.css */

.variation-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.variation-block a,
.variation-block button {
  font-family: inherit;
  font-size: var(--size-small);
  letter-spacing: normal;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  appearance: none;
  text-decoration: none;
}

.variation-section {
  margin-bottom: 0;
}

.variation-label {
  font-weight: bold;
  font-size: var(--size-small);
  margin: 0 0 8px;
  color: var(--color-muted);
}

.variation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* core\src\components\product\ui\calculator\style\quantity.css */

.quantity-block {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.quantity-label {
  font-size: var(--size-small);
  color: var(--color-muted);
}

.quantity-controls {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-middle);
  background: var(--bg-color-surface);
  overflow: hidden;
}

.quantity-btn {
  width: 40px;
  height: 40px;
  border: none;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-color-surface);
  cursor: pointer;
  font-size: 1.375rem;
  line-height: 1;
  transition: background 0.15s ease;
  user-select: none;
}

.quantity-btn:hover {
  background: var(--btn-bg-color-active);
}

.quantity-btn:active {
  filter: brightness(0.9);
}

.quantity-btn:focus-visible {
  outline: 2px solid var(--btn-bg-color-active);
  outline-offset: -2px;
}

.quantity-btn:disabled {
  color: var(--color-muted);
  cursor: not-allowed;
}

.quantity-input {
  width: 60px;
  height: 40px;
  border: none;
  text-align: center;
  font-size: var(--size);
  font-weight: 600;
  background: var(--bg-color);
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* core\src\components\product\ui\calculator\style\summary.css */

/* ============================================================================
   ORDER SUMS
   ============================================================================ */

.calculator-sums {
  display: flex;
  gap: 16px;
  margin-top: var(--calculator-gap);
}

.sum-card {
  flex: 1;
  padding: 10px 15px 0;
  border-radius: var(--border-radius-middle);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sum-label {
  color: var(--color-muted);
  font-size: var(--size-small);
  text-align: left;
}

.sum-value {
  text-align: center;
  line-height: 1.2;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 10px 0;
}

.sum-card.base {
  background: var(--bg-color-blue);
}

.sum-card.addons {
  background: var(--bg-color-yellow);
}

.sum-card.grand {
  background: var(--bg-color-green);
}

/* Мобильный */

@media (max-width: 768px) {
  .calculator-sums {
    flex-direction: row;
    gap: 5px;
  }

  .sum-card {
    padding: 10px;
  }

  .sum-value {
    font-size: 1rem;
  }
}
/* core\src\components\product\ui\calculator\style\addons.css */

.addons-section {
  padding: 20px;
  border-radius: var(--border-radius-middle);
  background-color: var(--bg-color-surface);
}

.addons-title {
  font-weight: bold;
  font-size: var(--size);
  display: block;
  margin-bottom: 10px;
}

.addons-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.addon-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 12px;
  transition: background-color 0.2s;
}

/* Недоступный аддон */
.addon-item[data-unavailable="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

.addon-item[data-unavailable="true"] .addon-name {
  text-decoration: line-through;
  color: var(--color-muted);
}

.addon-item[data-unavailable="true"] .addon-price {
  color: var(--color-error);
}

/* Колонка 1: Чекбокс */
.addon-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}

/* Скрываем нативный чекбокс */
.addon-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Кастомный чекбокс */
.addon-checkmark {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-small);
  background: var(--bg-color);
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

.addon-checkbox:checked + .addon-checkmark {
  background: var(--bg-color-accent);
  border-color: var(--border-color-accent);
}

.addon-checkbox:checked + .addon-checkmark::after {
  content: "✓";
  color: white;
  position: absolute;
  left: 4px;
  top: -1px;
  font-size: 14px;
}

/* Недоступный чекбокс */
.addon-checkbox:disabled + .addon-checkmark {
  background: var(--bg-color-surface);
  border-color: var(--border-color);
  cursor: not-allowed;
}

.addon-checkbox:disabled + .addon-checkmark::after {
  color: var(--color-muted);
}

/* Колонка 2: Картинка */
.addon-img {
  width: auto;
  height: 60px;
  object-fit: cover;
  border-radius: var(--img-border-radius-small);
  background: var(--bg-color-surface);
  flex-shrink: 0;
}

/* Колонка 3: Инфо */
.addon-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

@media (max-width: 768px) {
  .addon-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: start;
    gap: 0px;
    min-width: 0;
  }
}

.addon-name-link {
  min-width: 0;
}

.addon-name {
  line-height: 1.3;
  display: block;
}

.addon-variation {
  color: var(--color-muted);
  font-weight: 400;
}

.addon-price {
  color: var(--color-muted);
  font-weight: 600;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.addon-unavailable {
  font-size: var(--size-small);
  font-weight: 400;
  color: var(--color-error);
}
/* core\src\components\product\ui\calculator\style\stock.css */

.calculator-status {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--border-radius-small);
  font-weight: 600;
  font-size: var(--size-small);
}

.status-out-of-stock {
  background: var(--bg-color-red);
  color: var(--color-error);
}

.status-in-stock {
  background: var(--bg-color-green);
  color: var(--color-success);
}

.status-pre-order {
  background: var(--bg-color-yellow);
  color: var(--color-warning);
}
/* core\src\components\product\ui\calculator\style\stock-effects.css */

/* ============================================================================
   STATUS EFFECTS (IN STOCK / PREORDER VISUAL ACCENTS)
   Подключается отдельно. Можно безопасно удалить файл — логика останется.
   ============================================================================ */

/* ============================================================================
   IN STOCK — бегущая зелёная обводка (с паузой 10s цикл)
   ============================================================================ */

@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --arc {
  syntax: "<angle>";
  inherits: false;
  initial-value: 25deg;
}

@keyframes stock-line-cycle {
  /* старт — всё скрыто */
  0% {
    --angle: 0deg;
    --arc: 20deg;
    opacity: 0;
  }

  /* появление линии */
  6% {
    opacity: 1;
  }

  /* медленный старт движения */
  12% {
    --angle: 40deg;
    --arc: 60deg;
  }

  /* ускорение + рост длины */
  20% {
    --angle: 160deg;
    --arc: 140deg;
  }

  /* почти полный обвод */
  28% {
    --angle: 280deg;
    --arc: 220deg;
  }

  /* момент полного обвода */
  32% {
    --angle: 360deg;
    --arc: 260deg;
  }

  /* выход из сцены */
  38% {
    opacity: 0;
  }

  /* длинная пауза */
  100% {
    --angle: 360deg;
    --arc: 20deg;
    opacity: 0;
  }
}

/* ============================================================================
   БАЗОВЫЙ СТАТУС
   ============================================================================ */

.status-in-stock {
  position: relative;
  overflow: hidden;
}

/* ============================================================================
   ЛИНИЯ-ОБВОДКА
   ============================================================================ */

.status-in-stock::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  pointer-events: none;

  background: conic-gradient(
    from var(--angle),
    transparent 0deg,
    transparent calc(360deg - var(--arc)),
    #22c55e
  );

  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;

  animation: stock-line-cycle 10s linear infinite;
}

/* ============================================================================
   PREORDER — мягкий "маячок внимания" (пульсация обводки)
   ============================================================================ */

@keyframes preorder-attention {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 170, 0, 0.15);
    opacity: 0.6;
  }

  50% {
    box-shadow: 0 0 0 6px rgba(255, 170, 0, 0.35);
    opacity: 1;
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 170, 0, 0.15);
    opacity: 0.6;
  }
}

.status-pre-order {
  position: relative;
  animation: preorder-attention 3s ease-in-out infinite;
}

/* ============================================================================
   OUT OF STOCK — без анимаций (оставлено явно для читаемости)
   ============================================================================ */

.status-out-of-stock {
  font-style: normal;
}
/* core\src\components\product\ui\calculator\style\calculator.css */

.product-calculator {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-middle);
  padding: 18px 24px;
  --calculator-gap: 30px;
}

.calculator-header {
  display: flex;
  flex-direction: column;
  gap: var(--calculator-gap);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

.calculator-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.calculator-short-desc {
  font-size: var(--size-small);
  line-height: 1.6;
  color: var(--color-muted);
}

.sku-label {
  font-size: var(--size-small);
  color: var(--color-muted);
}

.calculator-body {
  display: flex;
  flex-direction: column;
  gap: var(--calculator-gap);
}

/* ============================================================================
   ACTION ROW
   ============================================================================ */

.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ============================================================================
   КНОПКА В СОСТОЯНИИ «ДОБАВЛЕНО» (data-state="added") — зелёная, ведёт в корзину
   ============================================================================ */

#add-to-cart-btn[data-state="added"] {
  background-color: var(--color-success);
}

/* Скрытый от глаз статус для скринридеров («Добавлено в корзину») */
.add-to-cart-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================================
   PULSE AURA — анимация для кнопки "Добавить в корзину"
   ============================================================================ */

@keyframes pulse-aura {
  0% {
    box-shadow: 0 0 0 0
      color-mix(in srgb, var(--border-color-accent) 55%, transparent);
  }

  70% {
    box-shadow: 0 0 0 20px
      color-mix(in srgb, var(--border-color-accent) 0%, transparent);
  }

  100% {
    box-shadow: 0 0 0 0
      color-mix(in srgb, var(--border-color-accent) 0%, transparent);
  }
}

.pulse-aura {
  animation: pulse-aura 0.75s ease-out 3;
}

/* Мобильный */

@media (max-width: 768px) {
  .product-calculator {
    padding: 10px;
  }

  .action-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  #add-to-cart-btn {
    width: 100%;
  }
}
/* core\src\components\product\ui\gallery\style\gallery.css */

.product-gallery .sticky {
  position: sticky;
  top: 20px;
}

.gallery-link {
  display: block;
  text-decoration: none;
  cursor: zoom-in;
  border: 0;
  padding: 0;
  background: none;
  width: 100%;
}

.gallery-image {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--img-border-color);
}

.product-gallery-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Скрытые ссылки-источники для fslightbox */
.gallery-lightbox-sources {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.gallery-lightbox-sources a {
  display: block;
}

/* Полоса миниатюр */
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.gallery-thumb-btn {
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--img-border-radius-small, 4px);
  background: none;
  cursor: pointer;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  transition: border-color 0.15s ease;
}

.gallery-thumb-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb-btn:hover {
  border-color: var(--border-color);
}

.gallery-thumb-btn.active {
  border-color: var(--border-color-accent);
  cursor: default;
}

.gallery-thumb-btn:focus-visible {
  outline: 2px solid var(--border-color-accent);
  outline-offset: 2px;
}
/* core\src\components\product\ui\reviews\style\reviews.css */

.product-reviews {
  margin-top: 2.5rem;
}

.product-reviews h2 {
  margin-bottom: 1.25rem;
}

.reviews-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Item */
.review-item {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-middle);
  padding: 1.25rem;
}

/* Header */
.review-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.review-author {
  font-weight: 600;
}

/* Stars */
.review-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  font-size: 1.125rem;
  line-height: 1;
}

.stars-filled {
  color: var(--color-star);
}

.stars-empty {
  color: var(--border-color);
}

/* Body */
.review-body {
  font-size: var(--size);
  line-height: 1.6;
  color: var(--color);
}

.review-body p {
  margin: 0;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* core\src\components\product\ui\specs\style\specs.css */

/* ПК: список dt/dd выглядит как таблица — две колонки, серая граница 1px.
   Границы нарисованы без обёрток: dl даёт верх и левую линию,
   каждая ячейка — правую и нижнюю, поэтому линии не удваиваются. */
.product-specs dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border-color);
  border-left: 1px solid var(--border-color);
}

.product-specs dt,
.product-specs dd {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  font-weight: normal;
  text-align: left;
  overflow-wrap: anywhere;
}

/* Мобильные: пары столбиком — подпись с двоеточием, под ней значение с отступом */
@media (max-width: 768px) {
  .product-specs dl {
    display: block;
    border: 0;
  }

  .product-specs dt,
  .product-specs dd {
    padding: 0;
    border: 0;
  }

  .product-specs dt {
    margin-top: 0.75rem;
  }

  .product-specs dt:first-child {
    margin-top: 0;
  }

  .product-specs dt::after {
    content: ":";
  }

  .product-specs dd {
    margin-left: 1rem;
  }
}

/* Значения в ячейке — flex-элементы, и сам .spec-part тоже flex-контейнер.
   Пробельные узлы между flex-элементами не выводятся, а пробелы по краям
   блока схлопываются, поэтому запятая (::after) встаёт вплотную к значению
   независимо от того, как отформатирована разметка («Фишки, Кубик»).
   Запятая — часть элемента, выделение действует только на само значение. */
.product-specs dd {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.3em;
}

.product-specs .spec-part {
  display: flex;
}

.product-specs .spec-part:not(:last-child)::after {
  content: ",";
}

/* Выделение значения. Значение data-emphasis = Emphasis из spec/types.ts;
   новый вид выделения добавляется там и здесь. */
.product-specs .spec-value[data-emphasis="strong"] {
  font-weight: 700;
}
/* core\src\components\product\style\product.css */

/* ============================================================================
   LAYOUT
   ============================================================================ */

.product-page {
  max-width: 1200px;
  --product-gap: 40px;
}

.product-page header h1 {
  margin: 2rem 0;
}

.product-grid {
  display: grid;
  grid-template-columns: 3fr 4fr;
  gap: 40px;
}

/* Критически важно: разрешаем колонкам сжиматься */
.product-grid > * {
  min-width: 0;
}

/* ============================================================================
   CONTENT
   ============================================================================ */

.product-main {
  min-width: 0;
}

.product-content {
  margin-top: 2rem;
}

.product-page .buttons {
  margin-top: 2rem;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

/* Планшет горизонтально (≤1024px): сайдбар скрыт, две колонки сохраняются */
@media (max-width: 1024px) {
  .product-grid {
    gap: 20px;
  }
}

/* Планшет вертикально / мобильный (≤768px): одна колонка */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .product-gallery .sticky {
    position: static;
  }
}
