/* Стили для того, чего не было в SSR-снапшоте: корзина в шапке, выпадающие
   фильтры, пагинация-ссылки, страницы корзины/оформления и админки. */

:root {
  --brand-red: #fc2847;
  --brand-dark: #3f2650;
  --brand-border: #ebebeb;
}

/* --- шапка: действия справа ------------------------------------------------- */
.header-main__row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.header-actions__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.2;
}

.header-actions__item:hover {
  color: var(--brand-red);
}

.header-actions__label {
  display: inline-flex;
  flex-direction: column;
}

.header-actions__sum {
  font-weight: 600;
  white-space: nowrap;
}

.header-actions__count {
  position: absolute;
  top: -8px;
  left: 14px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--brand-red);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

@media (max-width: 900px) {
  .header-actions__label {
    display: none;
  }
  .header-actions {
    gap: 14px;
  }
}

/* --- выпадающие списки (сортировка, фильтры) -------------------------------- */
.custom-dropdown {
  position: relative;
}

.custom-dropdown > summary {
  list-style: none;
}

.custom-dropdown > summary::-webkit-details-marker {
  display: none;
}

.custom-dropdown__menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(63, 38, 80, 0.16);
}

.custom-dropdown__menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 14px;
}

.custom-dropdown__menu a:hover,
.custom-dropdown__menu a[aria-current='true'] {
  background: #f5f5fa;
  color: var(--brand-red);
}

.filters-panel {
  position: relative;
}

.filters-panel > summary {
  list-style: none;
}

.filters-panel > summary::-webkit-details-marker {
  display: none;
}

.filters-panel__body {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  max-height: 70vh;
  overflow: auto;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(63, 38, 80, 0.16);
}

.filters-panel__group {
  margin-bottom: 18px;
}

.filters-panel__title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-dark);
}

.filters-panel__row {
  display: flex;
  gap: 8px;
}

.filters-panel__row input[type='number'] {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  font: inherit;
}

.filters-panel__check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--brand-dark);
}

.filters-panel__actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.quick-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-filter {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 14px;
  text-decoration: none;
}

.quick-filter:hover {
  background: #f5f5fa;
}

.quick-filter--active {
  border-color: var(--brand-red);
  color: var(--brand-red);
}

/* --- пагинация-ссылки ------------------------------------------------------- */
a.ui-pagination__item {
  color: inherit;
  text-decoration: none;
}

a.ui-pagination__item:hover {
  color: var(--brand-red);
}

/* --- карточка: форма «В корзину» -------------------------------------------- */
.card-cart-form {
  display: contents;
}

/* --- поиск: заголовок ------------------------------------------------------- */
.search-page__summary {
  margin: 4px 0 24px;
  font-size: 16px;
  color: #77727f;
}

.search-page__empty {
  padding: 40px 0;
  font-size: 18px;
  color: var(--brand-dark);
}

/* --- корзина / оформление --------------------------------------------------- */
.simple-page {
  padding-top: 24px;
  padding-bottom: 60px;
}

.simple-page h1 {
  margin-bottom: 24px;
  font-size: 32px;
  font-weight: 600;
  color: var(--brand-dark);
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.cart-table th,
.cart-table td {
  padding: 16px 8px;
  border-bottom: 1px solid var(--brand-border);
  text-align: left;
  vertical-align: middle;
  font-size: 15px;
}

.cart-table th {
  font-weight: 400;
  color: #77727f;
  font-size: 13px;
}

.cart-line__title {
  color: var(--brand-dark);
  text-decoration: none;
}

.cart-line__img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  background: #f7f7f7;
}

.cart-line__qty {
  width: 72px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  font: inherit;
}

.cart-total {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 24px;
  color: var(--brand-dark);
}

.cart-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  color: #77727f;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.link-button:hover {
  color: var(--brand-red);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 760px;
}

.form-grid--full {
  grid-column: 1 / -1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--brand-dark);
}

.form-field input,
.form-field textarea,
.form-field select {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.form-field textarea {
  height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.form-note {
  font-size: 13px;
  color: #77727f;
}

.notice {
  margin: 0 0 24px;
  padding: 16px 20px;
  border-radius: 12px;
  background: #f1f6ff;
  color: var(--brand-dark);
  font-size: 15px;
}

.notice--error {
  background: #fff0f3;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .cart-table thead {
    display: none;
  }
  .cart-table,
  .cart-table tbody,
  .cart-table tr,
  .cart-table td {
    display: block;
  }
  .cart-table tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--brand-border);
  }
  .cart-table td {
    border: 0;
    padding: 4px 0;
  }
}

/* --- админка ---------------------------------------------------------------- */
.admin-body {
  background: #f6f4f8;
}

.admin-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-header h1 {
  margin: 0;
  font-size: 28px;
  color: var(--brand-dark);
}

.admin-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.admin-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 14px;
  border: 1px solid var(--brand-border);
}

.admin-nav a.active {
  background: var(--brand-dark);
  color: #fff;
  border-color: var(--brand-dark);
}

.admin-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(63, 38, 80, 0.06);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--brand-border);
  text-align: left;
}

.admin-table th {
  font-weight: 600;
  color: #77727f;
}

.admin-table td.num {
  text-align: right;
  white-space: nowrap;
}

.admin-table input[type='text'],
.admin-table input[type='number'],
.admin-table select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--brand-border);
  border-radius: 6px;
  font: inherit;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-red);
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.admin-btn--ghost {
  background: #fff;
  color: var(--brand-dark);
  border: 1px solid var(--brand-border);
}

.admin-btn--small {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.admin-muted {
  color: #77727f;
  font-size: 13px;
}

.admin-pagination {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  align-items: center;
}

.admin-empty {
  padding: 24px;
  color: #77727f;
}

/* --- верхняя демо-плашка (в оригинале — промо-баннер) ----------------------- */
.top-promo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  padding: 0 16px;
  background: linear-gradient(90deg, #fc2847, #ff7352);
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.2px;
  text-align: center;
}

.top-promo__inner {
  max-width: 1300px;
}
