.catalogue-section {
  width: min(1280px, calc(100% - 40px));
  margin: 72px auto;
}

.catalogue-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 20px;
}

.catalogue-heading > div { max-width: 780px; }
.catalogue-heading h2 {
  margin: 4px 0 10px;
  font-family: Georgia, serif;
  font-size: clamp(2.6rem, 5.7vw, 5.4rem);
  line-height: .92;
  letter-spacing: -.055em;
}
.catalogue-heading p { margin: 0; color: #66594e; font-size: 1.05rem; }

.catalogue-manage-button {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 23px;
  border: 1px solid #17130f;
  border-radius: 999px;
  color: #17130f;
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.catalogue-manage-button:hover,
.catalogue-manage-button:focus-visible { background: #17130f; color: white; }

.catalogue-demo-note {
  margin: 0 0 24px;
  padding: 11px 15px;
  border: 1px solid rgba(142,96,49,.24);
  border-radius: 10px;
  background: rgba(255,250,241,.6);
  color: #756658;
  font-size: .82rem;
}

.book-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 25px;
}
.book-filters button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(117,79,41,.28);
  border-radius: 999px;
  background: rgba(255,250,241,.75);
  color: #4f4135;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.book-filters b {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(113,73,34,.1);
  font-size: .72rem;
}
.book-filters button.active { border-color: #17130f; background: #17130f; color: #f4d28e; }
.book-filters button.active b { background: rgba(255,255,255,.12); }

.book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.shop-book-card {
  min-width: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(122,81,41,.28);
  border-radius: 16px;
  background: rgba(255,250,241,.9);
  box-shadow: 0 15px 34px rgba(63,40,21,.09);
}
.shop-book-card.recommendation {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(210px, .82fr) 1.18fr;
  border-color: rgba(185,132,54,.68);
  color: white;
  background: #17130f;
  box-shadow: 0 20px 45px rgba(31,20,12,.24);
}

.shop-cover {
  position: relative;
  aspect-ratio: 4 / 5.7;
  overflow: hidden;
  background: #241b13;
}
.recommendation .shop-cover { aspect-ratio: auto; min-height: 100%; }
.shop-cover img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .45s ease; }
.shop-book-card:hover .shop-cover img { transform: scale(1.025); }
.shop-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), inset 0 -30px 40px rgba(0,0,0,.2);
  pointer-events: none;
}
.shop-badge {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  background: rgba(18,14,10,.82);
  color: #f4d28e;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}
.shop-badge.used { background: rgba(103,51,31,.88); color: white; }
.shop-badge.recommendation { background: #e6b96d; color: #17130f; }

.shop-book-copy { flex: 1; display: flex; flex-direction: column; padding: 20px; }
.recommendation .shop-book-copy { padding: clamp(24px, 4vw, 44px); justify-content: center; }
.shop-book-copy h3 { margin: 0; font-family: Georgia, serif; font-size: 1.42rem; line-height: 1.06; }
.recommendation .shop-book-copy h3 { font-size: clamp(1.8rem, 3vw, 3rem); }
.shop-author { margin: 7px 0 0; color: #8a755f; font-size: .85rem; font-weight: 750; }
.recommendation .shop-author { color: rgba(255,255,255,.54); }
.shop-synopsis {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  margin: 17px 0 20px;
  color: #67594d;
  font-size: .9rem;
  line-height: 1.5;
}
.recommendation .shop-synopsis { color: rgba(255,255,255,.69); -webkit-line-clamp: 5; }
.shop-library-note {
  margin: 0 0 22px;
  padding: 14px 16px;
  border-left: 2px solid #e6b96d;
  background: rgba(230,185,109,.08);
  color: #f4d28e;
  font-family: Georgia, serif;
  font-size: .95rem;
  font-style: italic;
  line-height: 1.45;
}
.shop-library-note strong { display: block; margin-bottom: 4px; color: white; font: 800 .66rem/1.2 Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.shop-book-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shop-price { font-family: Georgia, serif; font-size: 1.45rem; font-weight: 800; white-space: nowrap; }
.shop-add-button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid #17130f;
  border-radius: 999px;
  background: #17130f;
  color: white;
  font: inherit;
  font-size: .78rem;
  font-weight: 850;
  cursor: pointer;
}
.recommendation .shop-add-button { border-color: #e6b96d; background: #e6b96d; color: #17130f; }
.shop-add-button:hover,
.shop-add-button:focus-visible { transform: translateY(-1px); filter: brightness(1.07); }

.library-cart-bar {
  position: fixed;
  z-index: 40;
  right: 22px;
  bottom: 22px;
  min-width: min(410px, calc(100% - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 13px 12px 16px;
  border: 1px solid rgba(230,185,109,.56);
  border-radius: 16px;
  background: rgba(23,19,15,.96);
  color: white;
  box-shadow: 0 18px 45px rgba(24,15,8,.35);
  backdrop-filter: blur(14px);
}
.library-cart-bar[hidden] { display: none; }
.library-cart-bar > div { display: flex; align-items: center; gap: 10px; }
.library-cart-bar strong,
.library-cart-bar small { display: block; }
.library-cart-bar small { margin-top: 2px; color: #e6b96d; }
.cart-icon { font-size: 1.5rem; color: #e6b96d; }
.library-cart-bar button {
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  background: #e6b96d;
  color: #17130f;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.library-dialog {
  width: min(920px, calc(100% - 28px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(230,185,109,.55);
  border-radius: 20px;
  background: #17130f;
  color: white;
  box-shadow: 0 28px 90px rgba(0,0,0,.55);
}
.library-dialog::backdrop { background: rgba(12,9,7,.76); backdrop-filter: blur(5px); }
.dialog-heading {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 30px 22px;
  border-bottom: 1px solid rgba(230,185,109,.2);
  background: rgba(23,19,15,.97);
}
.dialog-heading h2 { margin: 2px 0 0; font: 700 clamp(2rem, 4vw, 3.4rem)/.95 Georgia, serif; }
.dialog-close {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  background: transparent;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
}

.cart-items { padding: 10px 30px 0; }
.cart-empty { padding: 44px 0; color: rgba(255,255,255,.6); text-align: center; }
.cart-item { display: grid; grid-template-columns: 58px 1fr auto auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.cart-item img { width: 58px; height: 78px; object-fit: cover; border-radius: 5px; }
.cart-item h3 { margin: 0; font: 700 1rem Georgia, serif; }
.cart-item p { margin: 4px 0 0; color: rgba(255,255,255,.55); font-size: .78rem; }
.cart-qty { display: flex; align-items: center; gap: 8px; }
.cart-qty button { width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; background: transparent; color: white; cursor: pointer; }
.cart-remove { border: 0; background: transparent; color: #e6b96d; font-size: .75rem; cursor: pointer; }
.cart-summary { display: flex; justify-content: space-between; margin: 22px 30px 0; padding-top: 18px; border-top: 1px solid rgba(230,185,109,.3); font-size: 1.2rem; }
.cart-request-button { width: calc(100% - 60px); min-height: 50px; margin: 22px 30px 12px; border: 0; border-radius: 999px; background: #e6b96d; color: #17130f; font: inherit; font-weight: 900; cursor: pointer; }
.cart-notice { margin: 0 30px 28px; padding: 13px; border-radius: 10px; background: rgba(230,185,109,.1); color: #f4d28e; text-align: center; }

.admin-dialog { width: min(1050px, calc(100% - 28px)); }
.admin-form { display: grid; grid-template-columns: 1fr 290px; gap: 28px; padding: 28px 30px 34px; }
.admin-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.admin-field { display: grid; align-content: start; gap: 7px; }
.admin-field-wide { grid-column: 1 / -1; }
.admin-field > span,
.admin-panel-title { color: #e6b96d; font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.admin-field input,
.admin-field select,
.admin-field textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  outline: none;
  background: rgba(255,255,255,.055);
  color: white;
  font: inherit;
}
.admin-field select { color-scheme: dark; }
.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus { border-color: #e6b96d; box-shadow: 0 0 0 3px rgba(230,185,109,.1); }
.admin-field textarea { resize: vertical; }

.admin-cover-panel { min-width: 0; }
.admin-cover-preview { margin: 8px 0 14px; overflow: hidden; aspect-ratio: 2 / 3; border: 1px solid rgba(230,185,109,.35); border-radius: 10px; background: #0e0b09; }
.admin-cover-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.cover-upload-button,
.cover-clear-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: .78rem;
  font-weight: 850;
  cursor: pointer;
}
.cover-upload-button { background: #e6b96d; color: #17130f; }
.cover-upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cover-clear-button { margin-top: 8px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: white; }
.admin-cover-panel small { display: block; margin-top: 12px; color: rgba(255,255,255,.46); line-height: 1.45; }

.admin-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 4px; }
.admin-save-button,
.admin-reset-button { min-height: 46px; padding: 0 20px; border-radius: 999px; font: inherit; font-weight: 900; cursor: pointer; }
.admin-save-button { border: 0; background: #e6b96d; color: #17130f; }
.admin-reset-button { border: 1px solid rgba(255,255,255,.18); background: transparent; color: rgba(255,255,255,.7); }
.admin-status { color: #e6b96d; font-size: .85rem; }

@media (max-width: 1040px) {
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shop-book-card.recommendation { grid-column: span 2; }
}

@media (max-width: 760px) {
  .catalogue-section { width: calc(100% - 18px); margin: 54px auto; }
  .catalogue-heading { align-items: flex-start; flex-direction: column; gap: 20px; }
  .catalogue-manage-button { width: 100%; }
  .book-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .book-filters button { flex: 0 0 auto; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .shop-book-card.recommendation { grid-column: 1 / -1; grid-template-columns: .82fr 1.18fr; }
  .shop-book-copy { padding: 14px; }
  .shop-book-copy h3 { font-size: 1.12rem; }
  .shop-author { font-size: .75rem; }
  .shop-synopsis { margin: 12px 0 15px; font-size: .78rem; -webkit-line-clamp: 3; }
  .shop-book-footer { align-items: stretch; flex-direction: column; }
  .shop-add-button { width: 100%; }
  .recommendation .shop-book-copy { padding: 20px; }
  .recommendation .shop-book-footer { flex-direction: row; align-items: center; }
  .recommendation .shop-add-button { width: auto; }
  .library-cart-bar { right: 10px; bottom: 10px; min-width: calc(100% - 20px); }
  .admin-form { grid-template-columns: 1fr; padding: 22px 20px 28px; }
  .admin-fields { grid-template-columns: 1fr; }
  .admin-field-wide { grid-column: auto; }
  .admin-cover-panel { max-width: 300px; }
  .admin-actions { grid-column: auto; }
  .dialog-heading { padding: 22px 20px 18px; }
  .cart-items { padding: 8px 20px 0; }
  .cart-summary { margin-right: 20px; margin-left: 20px; }
  .cart-request-button { width: calc(100% - 40px); margin-right: 20px; margin-left: 20px; }
}

@media (max-width: 470px) {
  .shop-book-card.recommendation { display: flex; }
  .recommendation .shop-cover { min-height: 310px; aspect-ratio: 4 / 5.7; }
  .shop-library-note { font-size: .82rem; }
  .library-cart-bar { gap: 8px; padding-left: 12px; }
  .library-cart-bar button { padding: 0 13px; font-size: .72rem; }
  .cart-item { grid-template-columns: 48px 1fr auto; }
  .cart-item img { width: 48px; height: 65px; }
  .cart-item .cart-remove { grid-column: 2 / -1; justify-self: start; }
}
