/* ══════════════════════════════════════════════
   SL Size Charts — стили для таблиц размеров
   Дизайн под тёмную тему SportsLegion.
   ══════════════════════════════════════════════ */

.slsc-chart {
  color: var(--text, #f0eeff);
  margin: 16px 0;
}
.slsc-chart__desc {
  color: var(--text-sec, #c4a8d4);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 12px;
}
.slsc-chart__wrap {
  background: var(--bg-elev, rgba(255,255,255,.04));
  border: 1px solid var(--border-soft, rgba(255,255,255,.10));
  border-radius: 14px;
  overflow: hidden;
  overflow-x: auto;
}
.slsc-chart__table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--f-body, 'Onest', system-ui, sans-serif);
}
.slsc-chart__table thead {
  background: linear-gradient(135deg, #2a1245, #1c0a37);
}
.slsc-chart__table th {
  padding: 14px 16px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 0;
}
.slsc-chart__table tbody tr {
  border-top: 1px solid var(--border-soft, rgba(255,255,255,.08));
  transition: background .15s;
}
.slsc-chart__table tbody tr:hover {
  background: rgba(124,58,237,.12);
}
.slsc-chart__table td {
  padding: 12px 16px;
  text-align: center;
  color: var(--text, #f0eeff);
  font-size: 14px;
  white-space: nowrap;
}

/* Mobile — горизонтальный скролл если таблица не помещается */
@media (max-width: 600px) {
  .slsc-chart__table th,
  .slsc-chart__table td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* ══════════════════════════════════════════════
   Ссылка «Таблица размеров» — inline в th.label
   рядом с лейблом «Выберите размер»
   ══════════════════════════════════════════════ */
.slsc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent, #c4a8d4);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, opacity .15s;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  font-family: inherit;
}
.slsc-link:hover,
.slsc-link:focus {
  color: var(--brand-pink, #d76c9d);
  text-decoration: underline;
  outline: none;
}
.slsc-link svg {
  flex-shrink: 0;
  color: currentColor;
}

/* Когда ссылка перенесена в th.label первого variation-атрибута —
   ставим её СПРАВА от лейбла. th.label получает flex layout.
   !important нужен потому что тема применяет display:block !important
   к .variations th в wc-dark.css. */
.variations th.label,
.variations td.label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.variations th.label .slsc-link--inline,
.variations td.label .slsc-link--inline {
  margin-left: auto;
}
.variations th.label label,
.variations td.label label {
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  margin: 0;
}

/* На мобиле — ссылка может прыгать на новую строку, это норм */
@media (max-width: 480px) {
  .slsc-link {
    font-size: 12px;
  }
  .slsc-link svg {
    width: 12px;
    height: 12px;
  }
}

/* ══════════════════════════════════════════════
   Модалка
   ══════════════════════════════════════════════ */
.slsc-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.slsc-modal[hidden] { display: none; }
.slsc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 2, 15, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}
.slsc-modal__panel {
  position: relative;
  background: linear-gradient(135deg, #15082b, #0c0418);
  border: 1px solid var(--border, rgba(255,255,255,.12));
  border-radius: 18px;
  padding: 28px 24px 24px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.slsc-modal__title {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  font-family: var(--f-display, 'Unbounded', system-ui, sans-serif);
}
.slsc-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  padding: 0;
}
.slsc-modal__close:hover {
  background: rgba(255,255,255,.16);
}

/* Тело страницы при открытой модалке — без скролла */
body.slsc-modal-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .slsc-modal {
    padding: 0;
    align-items: flex-end;
  }
  .slsc-modal__panel {
    max-height: 90vh;
    border-radius: 18px 18px 0 0;
    padding: 24px 16px 20px;
  }
  .slsc-modal__title {
    font-size: 18px;
    padding-right: 40px;
  }
}
