/* ====================================================
   Transylvania — основные стили
   ==================================================== */

:root {
  --header-bg:   #2c2c2c;
  --header-text: #ede8dc;
  --accent:      #c8b87a;       /* тёплое золото из меню старого сайта */
  --accent-dim:  #a89a5c;
  --body-bg:     #edeae2;
  --card-bg:     #ffffff;
  --border:      #ccc9bc;
  --text:        #1a1a1a;
  --text-muted:  #6a6860;
  --sidebar-w:   230px;
  --container:   1200px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--body-bg);
}
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { border: none; }

/* ---- Layout ---- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

/* ====================================================
   Шапка
   ==================================================== */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0 16px;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}

/* Логотип */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo img {
  width: 18px;
  height: 56px;
  object-fit: cover;
  object-position: center;
  opacity: .9;
}
.site-logo-text {
  font-size: 17px;
  font-weight: bold;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--header-text);
}

/* Навигация */
.site-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.site-nav a {
  color: var(--accent);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 3px;
  transition: background .15s;
}
.site-nav a:hover,
.site-nav a.active {
  background: rgba(200,184,122,.15);
  text-decoration: none;
  color: #fff;
}

/* Корзина в шапке (справа) */
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.cart-link {
  color: var(--accent);
  font-size: 13px;
}
.cart-link:hover { color: #fff; text-decoration: none; }

/* ====================================================
   Основной контент
   ==================================================== */
.site-main {
  padding: 20px 0 40px;
}

/* ====================================================
   Подвал
   ==================================================== */
.site-footer {
  background: var(--header-bg);
  color: #8a8880;
  font-size: 12px;
  padding: 16px 0;
  margin-top: auto;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ====================================================
   Каталог: двухколоночный layout
   ==================================================== */
.catalog-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 24px;
  align-items: start;
}

/* ---- Боковая панель фильтров ---- */
.filter-sidebar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px;
  position: sticky;
  top: 16px;
}
.filter-group {
  margin-bottom: 18px;
}
.filter-group:last-child { margin-bottom: 0; }

.filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}
.filter-title-label { flex: 1; }
.filter-active-count { color: var(--accent); margin-left: 3px; }
.filter-active-count:empty { display: none; }
.filter-toggle-all {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--text-muted);
  padding: 0 0 0 6px;
  opacity: .6;
}
.filter-toggle-all:hover { opacity: 1; color: var(--accent); }

.filter-list {
  list-style: none;
}
.filter-list li {
  margin: 2px 0;
}
.filter-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 6px;
  border-radius: 3px;
  color: var(--text);
  font-size: 12px;
  transition: background .12s;
}
.filter-list a:hover {
  background: var(--body-bg);
  text-decoration: none;
}
.filter-list a.active {
  background: var(--header-bg);
  color: #fff;
  font-weight: bold;
}
.filter-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}
.filter-list a.active .filter-count {
  color: var(--accent);
}

/* Направления жанров */
.filter-direction {
  margin-bottom: 6px;
}
.filter-direction-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-size: 11px;
  font-weight: bold;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 3px;
  user-select: none;
}
.filter-direction-toggle:hover { background: var(--body-bg); }
.filter-direction-toggle .arrow { font-size: 9px; transition: transform .15s; }
.filter-direction.open .arrow { transform: rotate(90deg); }
.filter-direction-genres {
  display: none;
  padding-left: 10px;
}
.filter-direction.open .filter-direction-genres { display: block; }

/* Сбросить фильтры */
.filter-reset {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-top: 12px;
}
.filter-reset:hover {
  background: var(--body-bg);
  text-decoration: none;
}


/* Сворачиваемые группы фильтров */
.filter-title { cursor: pointer; user-select: none; }
.filter-title .fg-arrow { font-size: 9px; display: inline-block; transition: transform .15s; transform: rotate(90deg); }
.filter-group.collapsed .filter-title .fg-arrow { transform: rotate(0deg); }
.filter-group.collapsed > .filter-list,
.filter-group.collapsed > .filter-direction { display: none; }

/* ---- Список альбомов ---- */
.album-list {
  list-style: none;
}
.album-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 6px;
  transition: box-shadow .12s;
}
.album-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
}

.album-thumb {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
}
.album-thumb img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}
.album-thumb-placeholder {
  width: 60px;
  height: 60px;
  background: var(--body-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--border);
}

.album-info {
  flex: 1;
  min-width: 0;
}
.album-artist {
  font-weight: bold;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-artist a { color: var(--text); }
.album-artist a:hover { text-decoration: underline; }

.album-title {
  font-size: 13px;
  color: var(--text);
  margin: 1px 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11px;
  color: var(--text-muted);
}
.album-meta span { white-space: nowrap; }
.album-meta .meta-label { color: #999; margin-right: 2px; }

.album-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 110px;
}
.album-prices {
  text-align: right;
}
.album-price {
  display: block;
  font-size: 15px;
  font-weight: bold;
  color: var(--text);
}
.album-price-zero {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-cart {
  background: var(--header-bg);
  color: #fff;
  border: none;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s;
}
.btn-cart:hover { background: #444; }

/* ---- Заголовок каталога ---- */
.catalog-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.catalog-header h1 {
  font-size: 18px;
  font-weight: bold;
}
.catalog-total {
  font-size: 12px;
  color: var(--text-muted);
}

/* ====================================================
   Пагинация
   ==================================================== */
.pagination {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 12px;
  color: var(--text);
  background: var(--card-bg);
  text-decoration: none;
}
.pagination a:hover { background: var(--body-bg); text-decoration: none; }
.pagination .current {
  background: var(--header-bg);
  color: #fff;
  border-color: var(--header-bg);
  font-weight: bold;
}
.pagination .sep { border: none; background: none; color: var(--text-muted); padding: 5px 2px; }
.pagination .disabled { color: var(--border); cursor: default; }

/* ====================================================
   Страница артиста
   ==================================================== */
.artist-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.artist-header h1 {
  font-size: 22px;
}
.artist-header .artist-total {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ====================================================
   Страница альбома
   ==================================================== */
.album-page {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}
.album-cover-block img {
  width: 280px;
  height: 280px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}
.album-cover-block .cover-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

.album-detail h1 {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 4px;
}
.album-detail .artist-link {
  font-size: 15px;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 16px;
  display: block;
}
.album-detail .artist-link:hover { text-decoration: underline; }

.album-fields {
  list-style: none;
  margin-bottom: 20px;
}
.album-fields li {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--body-bg);
  font-size: 13px;
}
.album-fields li:last-child { border-bottom: none; }
.album-fields .field-name {
  color: var(--text-muted);
  min-width: 110px;
  flex-shrink: 0;
}
.album-fields .field-val { color: var(--text); }

.album-stock-block {
  background: var(--body-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
}
.stock-title {
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.stock-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.stock-item:last-child { border-bottom: none; }
.stock-price {
  font-size: 17px;
  font-weight: bold;
}
.stock-condition {
  font-size: 11px;
  color: var(--text-muted);
}
.stock-out {
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: 8px 0;
}

/* ====================================================
   Утилиты
   ==================================================== */
.page-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 16px;
}
.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 5px; }

/* ====================================================
   Формы (авторизация, оформление)
   ==================================================== */
.auth-form, .checkout-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}
.form-label .req { color: #c0392b; }
.form-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
}
.form-input:focus { outline: none; border-color: #999; }
.form-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  cursor: pointer;
}
.btn-submit {
  background: var(--header-bg);
  color: #fff;
  border: none;
  padding: 9px 20px;
  font-size: 13px;
  border-radius: 3px;
  cursor: pointer;
  margin-top: 14px;
  transition: background .12s;
  width: 100%;
}
.btn-submit:hover { background: #444; }
.form-error {
  background: #fce4ec;
  border: 1px solid #f48fb1;
  border-radius: 3px;
  padding: 8px 12px;
  font-size: 12px;
  color: #880e4f;
  margin-bottom: 8px;
}
.auth-alt {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.info-box {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 3px;
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 16px;
}

/* Корзина */
.btn-remove {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-remove:hover { border-color: #999; color: var(--text); }
.cart-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}
.cart-total { font-size: 16px; }
.btn-checkout {
  background: var(--header-bg);
  color: #fff;
  padding: 9px 22px;
  border-radius: 3px;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  transition: background .12s;
}
.btn-checkout:hover { background: #444; text-decoration: none; }

/* Оформление заказа */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 32px;
  align-items: start;
}
.section-title {
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.checkout-list { list-style: none; }
.checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--body-bg);
  font-size: 13px;
}
.checkout-item-title { flex: 1; padding-right: 12px; }
.checkout-item-price { white-space: nowrap; font-weight: bold; }
.checkout-total {
  text-align: right;
  margin-top: 12px;
  font-size: 15px;
}
.delivery-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.delivery-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--card-bg);
}
.delivery-option:hover { background: var(--body-bg); }
.delivery-option input[type="radio"] { margin: 0; }

/* ЛК — таблица заказов */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--header-bg);
  color: #ccc;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:hover td { background: var(--body-bg); }
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  background: var(--body-bg);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ЛК — детальный заказ */
.order-status-box {
  background: var(--body-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 20px;
}
.order-detail-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
}

/* ====================================================
   Счётчик корзины в шапке
   ==================================================== */
.cart-count {
  display: inline-block;
  background: var(--accent);
  color: #000;
  border-radius: 10px;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 5px;
  margin-left: 3px;
  vertical-align: middle;
}

/* ====================================================
   Адаптив
   ==================================================== */
@media (max-width: 800px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }
  .catalog-layout > section {
    order: 1;
  }
  .filter-sidebar {
    order: 2;
    position: static;
  }
  .album-page {
    grid-template-columns: 1fr;
  }
  .album-cover-block img {
    width: 100%;
    height: auto;
  }
}
@media (max-width: 520px) {
  .album-card {
    flex-wrap: wrap;
  }
  .album-info {
    width: calc(100% - 72px);
  }
  .album-right {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    min-width: unset;
  }
}

/* ── Поиск ──────────────────────────────────────────────────────────────── */
.search-page {
  max-width: 900px;
  margin: 0 auto;
}
.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.search-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text);
}
.search-input:focus {
  outline: 2px solid var(--accent);
}
.search-btn {
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}
.search-btn:hover {
  opacity: 0.9;
}
.search-meta {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.search-source {
  margin-left: 6px;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ── Поиск в шапке ──────────────────────────────────────────────────────── */
.header-search {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  max-width: 320px;
  margin: 0 16px;
}
.header-search-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 4px 0 0 4px;
  background: #fff;
  color: #1a1a1a;
  min-width: 0;
}
.header-search-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.header-search-btn {
  padding: 6px 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}
.header-search-btn:hover {
  opacity: 0.85;
}
@media (max-width: 640px) {
  .header-search {
    max-width: 140px;
    margin: 0 8px;
  }
}
