/* ==========================================================================
   CMS9 · Тема "Default" — P2 CONTENT polish (blog chips / related posts /
   contacts form / FAQ accordion / category sort pill).
   Продовження theme.css + theme-pages.css: ті самі токени (--accent /
   --radius / --surface / --line / --pill / --font), namespace .dt-* .
   Підключається САМИМИ сторінковими шаблонами (blog / blog_page / contacts /
   page_delivery_payment / shop/category) — main.twig не чіпається.
   Специфічність: базовий ".dt a{color:inherit}" = (0,1,1), тому кольорові
   правила для посилань пишемо як ".dt .cls" (0,2,0)+.
   ========================================================================== */

/* ==========================================================================
   1. BLOG LIST — filter chips (sec-blog): обгортка .dt-blogchips навколо
      виводу widget('blog_tag_cloud') → теги стають pill-чипами.
   ========================================================================== */
.dt-blogchips { margin: -8px 0 0; }
.dt-blogchips .blog-widget__header { display: none; }
.dt-blogchips .tags-cloud__list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.dt-blogchips .tags-cloud__item { margin: 0; }
.dt .dt-blogchips .tags-cloud__link {
  display: inline-block; border: 1px solid #ddd; border-radius: var(--pill);
  padding: 8px 18px; font-size: 12px; color: var(--ink-2); white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.dt .dt-blogchips .tags-cloud__link:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ==========================================================================
   2. ARTICLE — "Читайте також" related grid (sec-article): обгортка
      .dt-related навколо widget('popular_blog_posts') (розмітка blog-widget/
      small-post) або widget('latest_news') (news-widget/small-post) —
      обидві розкладаються у 3 dt-картки; зайві елементи ховаються.
   ========================================================================== */
.dt-related { max-width: 1000px; margin: 34px auto 0; }
.dt-related__title { font-size: 20px; font-weight: 600; margin: 0 0 16px; }
.dt-related .blog-widget__header, .dt-related .news-widget__header { display: none; }
.dt-related .blog-widget__list, .dt-related .news-widget__inner {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  list-style: none; margin: 0; padding: 0;
}
.dt-related .blog-widget__item, .dt-related .news-widget__item { margin: 0; }
.dt-related .blog-widget__item:nth-child(n+4), .dt-related .news-widget__item:nth-child(n+4) { display: none; }
.dt-related .small-post {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; height: 100%; background: #fff;
}
.dt-related .small-post__image { display: block; width: 100%; height: 130px; background: var(--surface); overflow: hidden; flex: none; }
.dt-related .small-post__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dt-related .small-post__inner { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.dt-related .small-post__date { font-size: 10px; font-weight: 600; letter-spacing: .14em; color: var(--accent); text-transform: uppercase; }
.dt-related .small-post__title { font-size: 13.5px; font-weight: 600; line-height: 1.35; margin: 0; }
.dt .dt-related .small-post__title a { color: var(--ink); }
.dt-related .small-post__desc { font-size: 11.5px; font-weight: 300; color: #666; line-height: 1.6; }
.dt-related .small-post__desc .typo p { margin: 0; }

/* ==========================================================================
   3. CONTACTS — "Напишіть нам" form (sec-contacts): справжня форма модуля
      feedback (POST site_url('feedback'): name / email / theme / message).
   ========================================================================== */
.dt-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.dt-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dt-form__field { display: flex; flex-direction: column; margin: 0; font-weight: inherit; }
.dt-form__label { font-size: 11.5px; font-weight: 500; margin-bottom: 6px; color: var(--ink); }
.dt-form__label b { font-weight: 500; color: var(--accent); }
.dt-form__input {
  width: 100%; border: 1px solid #ddd; border-radius: var(--pill);
  padding: 11px 18px; font: 300 12.5px var(--font); color: var(--ink);
  background: #fff; outline: none;
}
.dt-form__input:focus { border-color: var(--accent); }
.dt-form__input::placeholder { color: #bbb; }
.dt-form__input--area { border-radius: 16px; min-height: 84px; resize: vertical; }
.dt-form .dt-btn { align-self: flex-start; }
@media (max-width: 640px) { .dt-form__grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   4. FAQ ACCORDION (sec-category / sec-delivery): очікувана розмітка —
        <div class="dt-faq">
          <div class="dt-faq__item">
            <div class="dt-faq__q">Питання</div>
            <div class="dt-faq__a">Відповідь</div>
          </div> …
        </div>
      CSS ховає відповіді, JS (verbatim у category.twig /
      page_delivery_payment.twig) вмикає toggle; перший пункт відкритий.
      Працює і для HTML-віджета dt_cat_faq, і для FAQ у тілі CMS-сторінки
      (.dt-seo) на "Доставка та оплата".
   ========================================================================== */
.dt-faq { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.dt-faq__item + .dt-faq__item { border-top: 1px solid var(--line-2); }
.dt-faq__q {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 15px 20px; font-size: 13.5px; font-weight: 500; color: var(--ink);
  line-height: 1.4; cursor: pointer; margin: 0;
}
.dt-faq__q::after { content: '+'; font-size: 16px; color: #bbb; flex: none; line-height: 1; }
.dt-faq__item.is-open .dt-faq__q::after { content: '\2212'; color: var(--accent); }
.dt-faq__a { display: none; padding: 0 20px 16px; font-size: 12.5px; font-weight: 300; color: #666; line-height: 1.7; }
.dt-faq__item.is-open .dt-faq__a { display: block; }
.dt-faq__a p { margin: 0 0 8px; }
.dt-faq__a p:last-child { margin-bottom: 0; }
/* усередині .dt-seo (тіло CMS-сторінки) — прибрати типографічні відступи */
.dt-seo .dt-faq p { margin: 0; }
.dt-seo .dt-faq { margin: 16px 0 0; }

/* контейнер FAQ на сторінці категорії */
.dt-catfaq { margin-top: 34px; }
.dt-catfaq__title { font-size: 18px; font-weight: 600; margin: 0 0 14px; }

/* ==========================================================================
   5. CATEGORY SORT — pill "Сортувати: … ▾" (sec-category): обгортка
      .dt-sortpill навколо нативного <select> (функціонал незмінний).
      Перебиває ".dt-sort select" з theme.css (0,1,1) вагою (0,2,1).
   ========================================================================== */
.dt .dt-sortpill {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid #ddd; border-radius: var(--pill); background: #fff;
  padding: 0 4px 0 18px; font-size: 12px; cursor: pointer; margin: 0; font-weight: 400;
}
.dt .dt-sortpill__lbl { white-space: nowrap; color: var(--ink); }
.dt .dt-sortpill select, .dt .dt-sortpill .form-control {
  border: 0; border-radius: var(--pill); background-color: transparent;
  padding: 9px 26px 9px 4px; font: 400 12px var(--font); color: var(--ink);
  cursor: pointer; outline: none; -webkit-appearance: none; appearance: none;
  max-width: 200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

/* ==========================================================================
   Відгуки/коментарі (легасі-форма comments) — dt-рестайл (макет: біла картка,
   заокруглені поля, чорна кнопка)
   ========================================================================== */
.dt .comments { background: #fff; }
.dt .comments .form,
.dt .comments [data-comments-form] { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.dt .comments .form__field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.dt .comments .form__label { font-size: 11.5px; font-weight: 500; color: var(--ink); width: auto; text-align: left; }
.dt .comments .form__inner { width: 100%; }
.dt .comments input[type=text],
.dt .comments input[type=email],
.dt .comments .form-input__control { width: 100%; border: 1px solid #ddd; border-radius: var(--pill); padding: 11px 18px; font-size: 12.5px; font-family: inherit; background: #fff; outline: 0; }
.dt .comments textarea { width: 100%; border: 1px solid #ddd; border-radius: 14px; padding: 12px 18px; font-size: 12.5px; font-family: inherit; min-height: 110px; background: #fff; outline: 0; }
.dt .comments input:focus, .dt .comments textarea:focus { border-color: var(--accent); }
.dt .comments .btn,
.dt .comments input[type=submit],
.dt .comments button[type=submit] { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; border: 0; border-radius: var(--pill); padding: 12px 30px; font-size: 12.5px; font-weight: 500; cursor: pointer; font-family: inherit; }
.dt .comments .btn:hover { opacity: .88; }

/* ==========================================================================
   Кабінет покупця (dt-макет): сайдбар-навігація + контент-картки
   ========================================================================== */
.dt-cabinet { padding-bottom: 40px; }
.dt-cabinet__layout { display: flex; gap: 24px; align-items: flex-start; }
.dt-cabinet__aside { width: 270px; flex: none; display: flex; flex-direction: column; gap: 16px; }
.dt-cabinet__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.dt-cabinet__user { display: flex; align-items: center; gap: 12px; padding: 16px; }
.dt-cabinet__avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; flex: none;
}
.dt-cabinet__who { min-width: 0; }
.dt-cabinet__name { font-size: 14px; font-weight: 600; line-height: 1.3; }
.dt-cabinet__mail { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }

.dt-cabinet__nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.dt-cabinet__item {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 400; color: var(--ink-2);
}
.dt-cabinet__item svg { width: 16px; height: 16px; flex: none; }
.dt-cabinet__item:hover { background: var(--surface); color: var(--ink); }
.dt-cabinet__item.is-active { background: var(--accent); color: #fff; font-weight: 500; }
.dt-cabinet__item.is-active:hover { color: #fff; }
.dt-cabinet__count { margin-left: auto; background: var(--surface); color: var(--ink); border-radius: var(--pill); padding: 2px 9px; font-size: 10.5px; font-weight: 600; }
.dt-cabinet__item.is-active .dt-cabinet__count { background: #fff; }
.dt-cabinet__item--exit { color: var(--muted); border-top: 1px solid var(--line-2); border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 13px; }

.dt-cabinet__bonus { background: var(--accent); color: #fff; border-radius: var(--radius); padding: 18px; text-align: center; }
.dt-cabinet__bonus-num { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.dt-cabinet__bonus-sub { font-size: 11px; font-weight: 300; opacity: .8; margin-top: 4px; }

.dt-cabinet__card { padding: 22px 24px; }
.dt-cabinet__card-title { font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.dt-cabinet__empty { font-size: 13px; color: var(--ink-2); margin: 0; }

/* форма особистих даних усередині картки: підпис зверху, pill-поля */
.dt-cabinet__card .form__field { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 14px; }
.dt-cabinet__card .form__label { width: auto; text-align: left; float: none; margin: 0; font-size: 11.5px; font-weight: 500; color: var(--ink); }
.dt-cabinet__card .form__inner { width: 100%; max-width: 440px; margin: 0; float: none; }
.dt-cabinet__card .form__info--help { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* таблиця замовлень: dt-рядки */
.dt-cabinet__card .info-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dt-cabinet__card .info-table__header .info-table__col {
  text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted-2); padding: 0 10px 10px 0; border-bottom: 1px solid var(--line);
}
.dt-cabinet__card .info-table__row .info-table__col { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.dt-cabinet__card .info-table__row:last-child .info-table__col { border-bottom: 0; }
.dt-cabinet__card .info-table a { font-weight: 600; color: var(--ink); }
.dt-cabinet__card .info-table a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .dt-cabinet__layout { flex-direction: column; }
  .dt-cabinet__aside { width: 100%; }
}
.dt-cabinet__card .form-control {
  width: 100%; border: 1px solid #ddd; border-radius: var(--pill); padding: 11px 18px;
  font: 400 12.5px var(--font); color: var(--ink); background: #fff;
  outline: none; box-shadow: none; height: auto;
}
.dt-cabinet__card .form-control:focus { border-color: var(--accent); }
.dt-cabinet__card .form-control[disabled], .dt-cabinet__card .form-control[readonly] { background: var(--surface); color: var(--ink-2); }
.dt-cabinet__card .btn, .dt-cabinet__card input[type=submit], .dt-cabinet__card button[type=submit] {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border: 0; border-radius: var(--pill);
  padding: 12px 28px; font: 500 12.5px var(--font); cursor: pointer;
}
.dt-cabinet__card .btn:hover { opacity: .88; color: #fff; }
.dt-cabinet__card .message--success { color: var(--ink); font-size: 12.5px; margin-bottom: 10px; }
