/* =============================================================================
   moonshop: общие стили контента (таблицы корзины/ЛК/сравнения)
   Подключается в footer.twig на всех страницах.

   Токены карточки (#e5eaf0 / #f1f5f9 / #eef1f5 / radius 14px) совпадают
   с голыми <table> внутри .content / #tab-description в start.css.
   Здесь только Bootstrap .table — таблицы текстового контента туда не входят.
   ============================================================================= */

/* --- Таблицы: «карточка» (скругление, светлый хедер, только горизонтали) --- */
#content .table-responsive {
  margin-bottom: 20px;
  border: 1px solid #e5eaf0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

#content .table {
  margin-bottom: 20px;
  width: 100%;
  background: #fff;
  border-collapse: separate;
  border-spacing: 0;
}

#content .table-responsive .table {
  margin-bottom: 0;
}

#content .table.table-bordered {
  border: 1px solid #e5eaf0;
  border-radius: 14px;
}

#content .table-responsive .table.table-bordered {
  border: 0;
  border-radius: 0;
}

/* Только первый thead: в сравнении/заказах бывает несколько thead подряд */
#content .table.table-bordered > thead:first-of-type > tr:first-child > th:first-child,
#content .table.table-bordered > thead:first-of-type > tr:first-child > td:first-child {
  border-top-left-radius: 13px;
}

#content .table.table-bordered > thead:first-of-type > tr:first-child > th:last-child,
#content .table.table-bordered > thead:first-of-type > tr:first-child > td:last-child {
  border-top-right-radius: 13px;
}

#content .table.table-bordered > tbody > tr:last-child > th:first-child,
#content .table.table-bordered > tbody > tr:last-child > td:first-child,
#content .table.table-bordered > tfoot > tr:last-child > th:first-child,
#content .table.table-bordered > tfoot > tr:last-child > td:first-child {
  border-bottom-left-radius: 13px;
}

#content .table.table-bordered > tbody > tr:last-child > th:last-child,
#content .table.table-bordered > tbody > tr:last-child > td:last-child,
#content .table.table-bordered > tfoot > tr:last-child > th:last-child,
#content .table.table-bordered > tfoot > tr:last-child > td:last-child {
  border-bottom-right-radius: 13px;
}

#content .table-responsive .table.table-bordered > thead > tr:first-child > th,
#content .table-responsive .table.table-bordered > thead > tr:first-child > td,
#content .table-responsive .table.table-bordered > tbody > tr:last-child > th,
#content .table-responsive .table.table-bordered > tbody > tr:last-child > td,
#content .table-responsive .table.table-bordered > tfoot > tr:last-child > th,
#content .table-responsive .table.table-bordered > tfoot > tr:last-child > td {
  border-radius: 0;
}

#content .table > thead > tr > th,
#content .table > thead > tr > td {
  border: 0;
  border-bottom: 1px solid #e5eaf0;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-transform: none;
  vertical-align: middle;
  padding: 14px 18px;
}

#content .table > tbody > tr > th,
#content .table > tbody > tr > td,
#content .table > tfoot > tr > th,
#content .table > tfoot > tr > td {
  border: 0;
  border-top: 1px solid #eef1f5;
  padding: 16px 18px;
  vertical-align: middle;
  font-size: 14px;
  line-height: 1.45;
  color: #334155;
  background: #fff;
}

#content .table > tbody > tr:first-child > th,
#content .table > tbody > tr:first-child > td {
  border-top: 0;
}

#content .table-bordered > thead > tr > th,
#content .table-bordered > thead > tr > td,
#content .table-bordered > tbody > tr > th,
#content .table-bordered > tbody > tr > td,
#content .table-bordered > tfoot > tr > th,
#content .table-bordered > tfoot > tr > td {
  border-left: 0;
  border-right: 0;
}

#content .table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #fff;
}

#content .table-hover > tbody > tr:hover {
  background-color: #f8fafc;
}

#content .table .price b {
  color: #0f172a;
  font-weight: 700;
}

#content .table .price s {
  color: var(--alt);
  margin-left: 6px;
  font-size: 13px;
}

#content .table img {
  display: inline-block;
  max-width: 60px;
  height: auto;
  border-radius: 8px;
}

@media (max-width: 767px) {
  #content .table-responsive {
    border-radius: 12px;
  }

  #content .table > thead > tr > th,
  #content .table > thead > tr > td,
  #content .table > tbody > tr > th,
  #content .table > tbody > tr > td {
    padding: 12px 14px;
  }
}

/* =============================================================================
   YooAI Blog: тот же текстовый UI, что .content в start.css.
   common.css грузится в footer ПОСЛЕ yooai_blog.css — иначе модуль
   перебивает отступы заголовков, а списки/таблицы остаются «голыми».
   ============================================================================= */
.yooai-post__content {
  --content-text: 17px;
  --content-lh: 1.65;
  --content-gap: 12px;
  --content-gap-lg: 20px;
  --content-accent: var(--links);
  --content-table-border: #e5eaf0;
  --content-table-head: #f1f5f9;
  --content-table-muted: #475569;
  --content-table-cell: #334155;
  --content-table-row: #eef1f5;
  color: #1f1f1f;
  font-size: var(--content-text);
  line-height: var(--content-lh);
}

.yooai-post__content p {
  margin: 0 0 var(--content-gap) 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.yooai-post__content p:last-child {
  margin-bottom: 0;
}

.yooai-post__content h2,
.yooai-post__content h3,
.yooai-post__content h4 {
  margin: 1.35em 0 0.55em 0;
  line-height: 1.3;
  color: #0f172a;
  font-family: inherit;
  letter-spacing: normal;
}

.yooai-post__content h2 {
  font-size: 22px;
  font-weight: 700;
}

.yooai-post__content h3 {
  font-size: 19px;
  font-weight: 600;
}

.yooai-post__content h4 {
  font-size: 17px;
  font-weight: 600;
}

@media screen and (min-width: 992px) {
  .yooai-post__content h2 {
    font-size: 24px;
  }
  .yooai-post__content h3 {
    font-size: 20px;
  }
}

.yooai-post__content ul,
.yooai-post__content ol {
  margin: 1em 0 1.75em 0;
  padding: 0;
  list-style: none;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.yooai-post__content ol {
  counter-reset: ms-ol;
}

.yooai-post__content li {
  position: relative;
  margin: 0 0 10px 0 !important;
  padding-left: 28px;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.yooai-post__content li:last-child {
  margin-bottom: 0 !important;
}

.yooai-post__content ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 14px;
  height: 2px;
  background: var(--content-accent, var(--links));
  transform: translateY(-50%);
}

.yooai-post__content ol > li {
  counter-increment: ms-ol;
  padding-left: 34px;
}

.yooai-post__content ol > li::before {
  content: counter(ms-ol);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--content-accent, var(--links)) 14%, #fff);
  color: var(--content-accent, var(--links));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8em;
  line-height: 1;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--content-accent, var(--links)) 10%, transparent);
}

.yooai-post__content table {
  width: 100%;
  max-width: 100%;
  margin: 1.35em 0 1.75em 0;
  border: 1px solid var(--content-table-border, #e5eaf0);
  border-radius: 14px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
}

.yooai-post__content th,
.yooai-post__content td {
  padding: 14px 18px;
  vertical-align: top;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  border: 0;
  border-bottom: 1px solid var(--content-table-row, #eef1f5);
  color: var(--content-table-cell, #334155);
  background: #fff;
}

.yooai-post__content thead th,
.yooai-post__content thead td,
.yooai-post__content tbody > tr:first-child:not(:has(td)) > th {
  background: var(--content-table-head, #f1f5f9);
  color: var(--content-table-muted, #475569);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  border-bottom-color: var(--content-table-border, #e5eaf0);
}

.yooai-post__content tbody > tr:has(td) > th {
  font-weight: 600;
  color: #0f172a;
  background: #fff;
}

.yooai-post__content tr:last-child > th,
.yooai-post__content tr:last-child > td {
  border-bottom: 0;
}

.yooai-post__content a:not(.button):not(.btn):not(.yooai-product__cart) {
  color: var(--links);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .yooai-post__content a:not(.button):not(.btn):not(.yooai-product__cart):hover {
    color: color-mix(in srgb, var(--links) 72%, #000);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

/* Товар / .content: шапка таблицы без <thead> (CKEditor) + отступы */
.content table,
#tab-description table {
  margin-top: 1.35em;
  margin-bottom: 1.75em;
}

.content thead th,
.content thead td,
#tab-description thead th,
#tab-description thead td,
.content tbody > tr:first-child:not(:has(td)) > th,
#tab-description tbody > tr:first-child:not(:has(td)) > th {
  background: #f1f5f9 !important;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

.content tbody > tr:has(td) > th,
#tab-description tbody > tr:has(td) > th {
  background: #fff !important;
  color: #0f172a;
  font-weight: 600;
}

.content ul,
.content ol,
#tab-description ul,
#tab-description ol {
  margin-top: 1em;
  margin-bottom: 1.75em;
}
