:root {
  --bg-night: #11111d;
  --bg-deep: #1a1633;
  --panel-dark: rgba(22, 17, 38, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.06);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text-main: #ffffff;
  --text-dark: #140f26;
  --text-muted: rgba(255, 255, 255, 0.7);
  --text-soft-dark: rgba(20, 15, 38, 0.58);
  --purple: #9d31d9;
  --purple-strong: #8f27d2;
  --pink: #ee64d6;
  --blue: #4632ff;
  --white-panel: #fbf6ff;
  --white: #ffffff;
  --line-soft: rgba(255, 255, 255, 0.22);
  --footer-bg: #ffffff;
  --footer-text: #2d2140;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 14% 22%, rgba(238, 100, 214, 0.95), rgba(238, 100, 214, 0) 20%),
    radial-gradient(circle at 49% 28%, rgba(70, 50, 255, 0.98), rgba(70, 50, 255, 0) 18%),
    radial-gradient(circle at 26% 78%, rgba(87, 48, 255, 0.92), rgba(87, 48, 255, 0) 19%),
    radial-gradient(circle at 77% 88%, rgba(239, 110, 218, 0.88), rgba(239, 110, 218, 0) 18%),
    linear-gradient(180deg, #101019 0%, #1c1736 44%, #3b2861 74%, #8c47c2 100%);
  min-height: 100vh;
  background-attachment: fixed;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  min-height: 100vh;
}

.auth-shell-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.site-main {
  padding: 0 28px 80px;
}

.auth-main {
  width: 100%;
}

.content-shell {
  max-width: 1160px;
  margin: 0 auto;
}

.site-header {
  padding: 20px 28px 0;
}

.header-inner,
.hero-card,
.value-strip,
.newsletter-section,
.site-footer,
.account-password-actions,
.admin-form-heading,
.inventory-actions,
.header-actions,
.main-nav,
.footer-logo-row,
.social-row,
.books-toolbar,
.auth-utility-nav,
.auth-bottom-copy,
.checkout-qty-cell,
.book-admin-actions {
  display: flex;
  align-items: center;
}

.promo-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(3px);
}

.promo-admin-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1210;
  width: min(1000px, 90vw);
  max-width: calc(100vw - 32px);
  max-height: 88vh;
  margin: 0;
  padding: 28px;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text-main);
  border: 1px solid rgba(238, 100, 214, 0.32);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 4%, rgba(157, 49, 217, 0.2), transparent 32%),
    linear-gradient(155deg, #211936 0%, #171329 58%, #110f20 100%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: translate(-50%, -50%);
}

.promo-admin-heading, .promo-toolbar, .promo-book-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.promo-admin-heading { padding-right: 42px; }
.promo-admin-heading h2 { margin: 0 0 6px; }
.promo-admin-heading p { margin: 0; color: var(--text-muted); }
.promo-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.promo-modal-close:hover { border-color: rgba(238, 100, 214, 0.7); background: rgba(238, 100, 214, 0.18); }
.promo-book-meta { margin: 20px 0; padding: 14px 16px; border: 1px solid var(--panel-border); border-radius: 12px; background: rgba(255, 255, 255, 0.055); }
.promo-book-meta span { color: var(--text-muted); overflow-wrap: anywhere; }
.promo-book-meta strong { color: #fff; }
.promo-import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.promo-import-box { display: grid; gap: 10px; min-width: 0; padding: 16px; color: #fff; border: 1px solid var(--panel-border); border-radius: 12px; background: rgba(255, 255, 255, 0.055); }
.promo-import-box input[type="file"] { width: 100%; max-width: 100%; color: var(--text-muted); }
.promo-import-box input[type="file"]::file-selector-button { margin-right: 10px; padding: 9px 12px; color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: rgba(157, 49, 217, 0.32); cursor: pointer; }
.promo-import-box textarea { width: 100%; min-width: 0; resize: vertical; color: #fff; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 10px; background: rgba(5, 4, 13, 0.48); }
.promo-import-box textarea::placeholder { color: rgba(255, 255, 255, 0.42); }
.promo-admin-message { padding: 12px; color: #f5eaff; border: 1px solid rgba(157, 49, 217, 0.32); border-radius: 10px; background: rgba(157, 49, 217, 0.15); }
.promo-toolbar { margin: 18px 0 10px; }
.promo-toolbar select { margin-left: 6px; padding: 8px 30px 8px 10px; color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: #211936; }
.promo-table-wrap { width: 100%; max-width: 100%; overflow-x: hidden; border: 1px solid var(--panel-border); border-radius: 12px; }
.promo-table { width: 100%; table-layout: fixed; border-collapse: collapse; background: rgba(4, 3, 11, 0.3); }
.promo-table th, .promo-table td { padding: 11px 10px; color: rgba(255, 255, 255, 0.86); border-bottom: 1px solid rgba(255, 255, 255, 0.1); text-align: left; overflow-wrap: anywhere; }
.promo-table th { color: #fff; background: rgba(157, 49, 217, 0.14); }
.promo-table tr:last-child td { border-bottom: 0; }

@media (max-width: 760px) {
  .promo-admin-panel { width: calc(100vw - 20px); max-width: none; max-height: 90vh; padding: 20px 14px; border-radius: 16px; }
  .promo-import-grid { grid-template-columns: 1fr; }
  .promo-book-meta { align-items: flex-start; flex-direction: column; }
  .promo-table { table-layout: auto; }
  .promo-table th:nth-child(3), .promo-table td:nth-child(3), .promo-table th:nth-child(5), .promo-table td:nth-child(5) { display: none; }
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 0 28px;
  background: rgba(12, 12, 20, 0.96);
}

.brand-btn,
.nav-link,
.utility-text-link {
  border: 0;
  background: transparent;
}

.brand {
  gap: 12px;
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(159, 73, 231, 0.92));
  color: #ffeefe;
  font-size: 12px;
}

.main-nav {
  gap: 18px;
}

.mobile-menu-trigger,
.mobile-menu-sheet {
  display: none;
}

.mobile-menu-trigger {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.mobile-menu-trigger span {
  display: block;
  width: 4px;
  height: 4px;
  margin: 3px auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.mobile-menu-sheet {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(12, 12, 20, 0.98);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
}

.mobile-menu-links,
.mobile-menu-actions {
  display: grid;
  gap: 10px;
}

.mobile-menu-actions {
  margin-top: 12px;
}

.mobile-menu-link {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.mobile-menu-link.active {
  color: var(--white);
  background: rgba(170, 66, 233, 0.18);
  border-color: rgba(170, 66, 233, 0.38);
}

.mobile-session-chip {
  width: 100%;
}

.nav-link,
.ghost-header-btn,
.header-primary-btn,
.utility-text-link,
.session-chip,
.auth-tab,
.books-search-input,
.cart-summary-btn,
.book-buy-btn,
.checkout-primary-btn,
.checkout-secondary-btn,
.newsletter-form input,
.newsletter-form button,
.footer-subscribe input,
.footer-subscribe button,
.auth-form input,
.admin-form input,
.admin-form textarea,
.account-password-form input {
  border-radius: 4px;
}

.nav-link {
  padding: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
}

.nav-link.active {
  color: var(--white);
}

.header-actions {
  gap: 12px;
}

.ghost-header-btn,
.header-primary-btn,
.session-chip,
.auth-tab {
  min-height: 42px;
  padding: 0 16px;
}

.ghost-header-btn,
.session-chip {
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.06);
}

.header-primary-btn,
.auth-submit-btn,
.admin-primary-btn,
.checkout-primary-btn,
.newsletter-form button,
.footer-subscribe button {
  border: 1px solid transparent;
  color: var(--white);
  background: linear-gradient(90deg, var(--purple-strong), #bb3ce4);
  box-shadow: 0 12px 30px rgba(139, 32, 209, 0.24);
}

.session-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 48px;
  text-align: left;
}

.session-chip span {
  font-size: 13px;
  font-weight: 700;
}

.session-chip small {
  color: rgba(255, 255, 255, 0.68);
}

.error-banner,
.notice-banner,
.empty-state {
  max-width: 1280px;
  margin: 0 auto 18px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.1);
}

.error-banner {
  color: #ffd9d9;
  background: rgba(164, 48, 48, 0.32);
}

.notice-banner {
  color: #ebffe9;
  background: rgba(42, 121, 78, 0.28);
}

.overlay-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 9, 20, 0.56);
  backdrop-filter: blur(12px);
}

.overlay-panel {
  width: min(592px, 100%);
  min-height: 468px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 44px 36px;
  color: var(--text-dark);
  text-align: center;
  background: #d9d9d9;
  border-radius: 82px;
}

.overlay-panel h2 {
  margin: 0 0 8px;
  font-size: clamp(36px, 3vw, 54px);
  line-height: 1.06;
}

.overlay-primary-btn,
.overlay-secondary-btn {
  width: min(338px, 100%);
  min-height: 72px;
  border-radius: 999px;
  font-size: 22px;
  font-weight: 700;
}

.overlay-primary-btn {
  margin: 0;
}

.overlay-secondary-btn {
  border: 0;
  color: #11111d;
  background: #ffffff;
}

.hero-card {
  justify-content: space-between;
  gap: 32px;
  min-height: 340px;
  padding: 0 0 0 42px;
  margin: 10px 0 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(52, 21, 75, 0.98), rgba(33, 22, 67, 0.92)),
    radial-gradient(circle at 15% 90%, rgba(238, 100, 214, 0.8), rgba(238, 100, 214, 0) 32%);
  box-shadow: 0 26px 72px rgba(14, 10, 30, 0.28);
}

.hero-copy {
  width: 40%;
  padding-top: 62px;
}

.hero-copy h1,
.section-heading h2,
.books-sidebar h2,
.auth-branding h1 {
  margin: 0;
}

.hero-copy h1 {
  max-width: 420px;
  font-size: clamp(34px, 3.5vw, 58px);
  line-height: 1.02;
}

.hero-copy p {
  max-width: 360px;
  margin: 16px 0 22px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.hero-cta-btn {
  min-width: 164px;
  min-height: 42px;
  padding: 0 18px;
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(139, 32, 209, 0.32);
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-self: stretch;
}

.hero-stage {
  position: relative;
  width: min(100%, 560px);
  min-height: 340px;
  margin-left: auto;
  border-radius: 0 32px 32px 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(37, 22, 71, 0.52), rgba(37, 22, 71, 0.16)),
    radial-gradient(circle at 62% 22%, rgba(203, 106, 255, 0.22), rgba(203, 106, 255, 0) 36%),
    radial-gradient(circle at 78% 68%, rgba(86, 63, 255, 0.28), rgba(86, 63, 255, 0) 34%);
}

.hero-scene {
  position: absolute;
  inset: 0;
  animation: heroSceneSwap 720ms ease;
}

.hero-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
}

.hero-glow-left {
  left: 24px;
  bottom: 48px;
  width: 150px;
  height: 150px;
  background: rgba(231, 105, 230, 0.42);
}

.hero-glow-right {
  top: 18px;
  right: 56px;
  width: 210px;
  height: 210px;
  background: rgba(76, 58, 255, 0.3);
}

.hero-shelf {
  position: absolute;
  left: 38px;
  right: 42px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(249, 124, 241, 0.24), rgba(136, 93, 255, 0.42), rgba(249, 124, 241, 0.18));
  box-shadow: 0 12px 32px rgba(8, 6, 19, 0.35);
}

.hero-shelf-top {
  top: 82px;
}

.hero-shelf-bottom {
  bottom: 74px;
}

.hero-book-stack {
  position: absolute;
  display: flex;
  gap: 18px;
}

.hero-book-stack-back {
  top: 36px;
  right: 154px;
}

.hero-book-stack-front {
  right: 76px;
  bottom: 96px;
}

.hero-book-tile {
  width: 112px;
  height: 168px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 38px rgba(12, 9, 26, 0.38);
}

.hero-book-tile.small {
  width: 92px;
  height: 138px;
}

.hero-book-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.hero-highlight-card {
  position: absolute;
  left: 38px;
  bottom: 42px;
  display: grid;
  gap: 7px;
  width: 178px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: rgba(19, 12, 35, 0.76);
  box-shadow: 0 16px 32px rgba(11, 8, 22, 0.3);
}

.hero-highlight-kicker {
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-highlight-card strong {
  font-size: 20px;
  line-height: 1.15;
}

.hero-highlight-card small,
.hero-highlight-card span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
}

.hero-slide-indicators {
  position: absolute;
  right: 28px;
  bottom: 26px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.hero-slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  transition: transform 180ms ease, background 180ms ease;
}

.hero-slide-dot.active {
  background: rgba(255, 255, 255, 0.88);
  transform: scale(1.25);
}

@keyframes heroSceneSwap {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.home-section,
.books-page,
.checkout-page,
.account-panel,
.admin-section {
  padding-top: 56px;
}

.section-heading {
  margin-bottom: 28px;
}

.section-heading.centered {
  text-align: center;
}

.section-heading.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2,
.books-sidebar h2 {
  font-size: clamp(34px, 4.1vw, 54px);
  line-height: 1.02;
}

.books-sidebar h2 {
  font-size: 18px;
  line-height: 1.2;
}

.section-heading p,
.books-heading p,
.account-panel p {
  margin: 10px 0 0;
  color: var(--text-muted);
}

.home-section .section-heading h2 {
  font-size: 22px;
}

.home-section .section-heading p {
  font-size: 10px;
}

.trending-grid,
.top-rated-grid,
.books-grid {
  display: grid;
  gap: 18px 16px;
}

.trending-grid,
.top-rated-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.books-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.book-cover-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.book-cover-card.compact .book-cover-frame {
  width: min(100%, 145px);
}

.book-cover-frame {
  position: relative;
  width: min(100%, 192px);
}

.book-cover-image {
  width: 100%;
  height: 270px;
  object-fit: cover;
  object-position: center top;
  border-radius: 16px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.26);
}

.book-image-slider {
  position: relative;
  display: grid;
  width: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.book-slide {
  grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 560ms ease, transform 220ms ease, filter 220ms ease;
}

.book-slide.active {
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
}

.book-slide-dots {
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: auto;
}

.book-slide-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: rgba(15, 11, 27, 0.48);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.34);
}

.book-slide-dots button.active { background: #fff; transform: scale(1.18); }

.book-cover-card.compact .book-cover-image {
  height: 174px;
}

.book-rating-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  font-size: 11px;
}

.book-rating-star {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff3db;
  background: #ff881d;
}

.book-meta {
  width: 100%;
  padding-top: 12px;
}

.book-category-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.76);
}

.book-meta h3 {
  margin: 6px 0 4px;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.1;
}

.book-cover-card.compact .book-meta h3 {
  font-size: 12px;
}

.book-meta p {
  margin: 0 0 12px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
}

.book-buy-btn,
.cart-summary-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 92px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: var(--white);
  background: transparent;
}

.book-buy-btn strong,
.cart-summary-btn {
  font-size: 14px;
  font-weight: 800;
}

.book-cover-card.compact .book-buy-btn strong {
  font-size: 10px;
}

.book-buy-btn small {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.64);
  text-decoration: line-through;
}

.book-buy-btn.active {
  border-color: transparent;
  background: linear-gradient(90deg, rgba(157, 49, 217, 0.98), rgba(229, 89, 211, 0.92));
}

.value-strip {
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  margin-top: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
}

.value-item {
  flex: 1;
  text-align: center;
}

.value-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  border-radius: 999px;
  color: #f7d7ff;
  background: rgba(157, 49, 217, 0.25);
  font-weight: 800;
}

.value-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.value-item p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.text-arrow-link {
  padding: 0;
  border: 0;
  color: rgba(255, 255, 255, 0.84);
  background: transparent;
}

.best-seller-row,
.book-row-grid,
.category-card-row {
  display: grid;
  gap: 18px;
}

.book-row-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
}

.best-seller-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: start;
}

.best-seller-item .book-cover-frame {
  width: 100%;
}

.best-seller-item .book-cover-image {
  height: 88px;
  border-radius: 8px;
}

.best-seller-item .book-meta h3 {
  font-size: 10px;
}

.best-seller-item .book-category-label,
.best-seller-item .book-meta p,
.best-seller-item .book-buy-btn small {
  font-size: 8px;
}

.best-seller-item .book-buy-btn {
  min-width: 70px;
  min-height: 24px;
}

.best-seller-item .book-buy-btn strong {
  font-size: 9px;
}

.category-card-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.category-promo-card {
  min-height: 138px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--white);
  text-align: left;
  background:
    linear-gradient(180deg, rgba(233, 143, 255, 0.82), rgba(175, 84, 237, 0.34) 52%, rgba(40, 32, 74, 0.9) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.category-promo-card.biography,
.category-promo-card.self-help,
.category-promo-card.adventure,
.category-promo-card.mystery-thriller,
.category-promo-card.cook-book,
.category-promo-card.novel {
  background:
    linear-gradient(180deg, rgba(233, 143, 255, 0.82), rgba(175, 84, 237, 0.34) 52%, rgba(40, 32, 74, 0.9) 100%);
}

.category-promo-card small {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}

.category-promo-card strong {
  display: block;
  font-size: 17px;
  line-height: 1.15;
}

.category-promo-card span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.84);
}

.page-breadcrumb {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 26px;
  margin-bottom: 26px;
  color: rgba(255, 255, 255, 0.86);
  background: linear-gradient(90deg, rgba(244, 182, 255, 0.7), rgba(102, 75, 132, 0.3));
}

.books-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 34px;
}

.books-sidebar {
  padding-right: 26px;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.books-sidebar h3 {
  margin: 12px 0 18px;
  font-size: 24px;
}

.category-filter-list {
  display: grid;
  gap: 14px;
}

.category-filter-link,
.featured-toggle {
  color: rgba(255, 255, 255, 0.68);
}

.category-filter-link {
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 14px;
  line-height: 1.3;
}

.category-filter-link.active {
  color: var(--white);
}

.filter-radio {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
}

.category-filter-link.active .filter-radio {
  background: rgba(236, 102, 223, 0.92);
  border-color: rgba(236, 102, 223, 0.92);
}

.featured-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-size: 14px;
  font-weight: 600;
}

.featured-toggle input,
.toggle-row input {
  width: 16px;
  height: 16px;
}

.books-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.books-heading h2 {
  font-size: 32px;
}

.books-heading p {
  max-width: 420px;
  font-size: 14px;
}

.books-search-input {
  width: min(320px, 100%);
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.books-search-input::placeholder,
.newsletter-form input::placeholder,
.footer-subscribe input::placeholder,
.auth-form input::placeholder,
.admin-form input::placeholder,
.admin-form textarea::placeholder,
.account-password-form input::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.cart-summary-btn {
  min-width: 154px;
  border-color: rgba(255, 255, 255, 0.18);
  font-size: 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
}

.books-grid-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.books-grid-item .book-cover-card {
  height: 100%;
}

.books-grid-item .book-cover-frame {
  width: min(100%, 210px);
  margin: 0 auto;
}

.books-grid-item .book-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.books-grid-item .book-meta h3 {
  max-width: 230px;
}

.books-grid-item .book-buy-btn {
  margin-top: auto;
}

.book-admin-actions {
  gap: 12px;
  margin-top: 14px;
}

.delete-icon-btn,
.inventory-delete-btn,
.checkout-remove-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.delete-icon-btn,
.inventory-delete-btn {
  min-height: 42px;
  padding: 0 14px;
}

.checkout-page {
  min-height: 1040px;
}

.checkout-table-header,
.checkout-row,
.checkout-summary-card,
.account-card,
.admin-card,
.auth-card,
.empty-state,
.error-banner,
.notice-banner {
  border-radius: 8px;
}

.checkout-table-header {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr 0.5fr 0.7fr;
  gap: 18px;
  padding: 20px 24px;
  margin-bottom: 24px;
  font-weight: 700;
  background: rgba(104, 0, 133, 0.62);
}

.checkout-list {
  display: grid;
  gap: 20px;
}

.checkout-row {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr 0.5fr 0.7fr;
  gap: 18px;
  align-items: center;
  padding: 18px 24px;
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.94);
}

.checkout-item-cell {
  display: flex;
  align-items: center;
  gap: 20px;
}

.checkout-item-cell img {
  width: 108px;
  height: 142px;
  object-fit: cover;
  border-radius: 14px;
}

.checkout-item-cell small,
.checkout-item-cell span {
  display: block;
  color: var(--text-soft-dark);
}

.checkout-item-cell strong {
  display: block;
  margin: 8px 0 10px;
  font-size: 28px;
  line-height: 1.12;
  color: var(--text-dark);
}

.checkout-qty-cell {
  justify-content: center;
  gap: 12px;
}

.checkout-qty-cell button {
  width: 40px;
  height: 40px;
  border: 0;
  color: var(--purple-strong);
  font-size: 24px;
  background: rgba(91, 40, 147, 0.12);
}

.checkout-qty-cell span,
.checkout-price-cell,
.checkout-total-cell strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
}

.checkout-total-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.checkout-remove-btn {
  min-height: 36px;
  padding: 0 12px;
  color: #532d6d;
  background: rgba(83, 45, 109, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.checkout-summary-card {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 34px;
  align-items: start;
  padding: 42px 52px;
  margin-top: 54px;
  color: var(--text-dark);
  background: rgba(250, 240, 255, 0.92);
  position: relative;
  overflow: hidden;
}

.checkout-summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 46%;
  background:
    radial-gradient(circle at 18% 12%, rgba(124, 87, 153, 0.08) 0 22px, transparent 23px),
    linear-gradient(160deg, rgba(124, 87, 153, 0.08), rgba(124, 87, 153, 0.02));
  clip-path: polygon(0 0, 62% 0, 88% 36%, 65% 36%, 84% 72%, 47% 72%, 34% 100%, 0 100%);
}

.checkout-summary-copy h2,
.account-password-form h3,
.admin-card h3 {
  margin: 0;
  color: var(--text-dark);
}

.checkout-summary-copy h2 {
  font-size: 46px;
}

.checkout-summary-copy p {
  margin: 16px 0 0;
  color: var(--text-soft-dark);
}

.checkout-summary-copy,
.checkout-summary-values {
  position: relative;
  z-index: 1;
}

.checkout-summary-values {
  display: grid;
  gap: 16px;
}

.checkout-summary-values div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.checkout-summary-values span,
.checkout-summary-values small,
.account-card span {
  color: var(--text-soft-dark);
}

.checkout-summary-values strong,
.account-card strong {
  color: var(--text-dark);
}

.total-row {
  padding-top: 16px;
  border-top: 1px solid rgba(111, 75, 145, 0.22);
}

.checkout-primary-btn,
.checkout-secondary-btn {
  min-height: 52px;
  border: 1px solid transparent;
}

.checkout-secondary-btn {
  color: var(--purple-strong);
  background: transparent;
  box-shadow: none;
}

.newsletter-section {
  justify-content: space-between;
  gap: 28px;
  padding: 120px 0 86px;
  position: relative;
}

.newsletter-section::before,
.newsletter-section::after {
  content: "";
  position: absolute;
  width: 56px;
  height: 56px;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.9) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  opacity: 0.8;
}

.newsletter-section::before {
  left: 0;
  bottom: 96px;
}

.newsletter-section::after {
  right: 0;
  bottom: 20px;
}

.newsletter-copy {
  max-width: 480px;
}

.newsletter-copy h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.08;
}

.newsletter-form {
  flex: 1;
  justify-content: flex-end;
  gap: 18px;
}

.newsletter-signup-block {
  flex: 1;
}

.footer-newsletter-form {
  gap: 12px;
}

.newsletter-form input,
.footer-newsletter-form input,
.footer-subscribe input,
.auth-form input,
.admin-form input,
.admin-form textarea,
.account-password-form input {
  border: 1px solid transparent;
}

.newsletter-form input,
.footer-newsletter-form input,
.footer-subscribe input {
  width: min(100%, 460px);
  min-height: 52px;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.36);
}

.newsletter-form button,
.footer-newsletter-form button,
.footer-subscribe button {
  min-width: 132px;
  min-height: 52px;
}

.newsletter-feedback {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.newsletter-feedback.success {
  color: rgba(255, 255, 255, 0.92);
}

.newsletter-feedback.error {
  color: #ffd5db;
}

.site-footer {
  align-items: flex-start;
  gap: 38px;
  padding: 56px 52px 70px;
  color: var(--footer-text);
  background: var(--footer-bg);
  border-top: 1px solid rgba(45, 33, 64, 0.04);
}

.footer-brand,
.footer-links,
.footer-subscribe {
  flex: 1;
}

.footer-brand p,
.footer-subscribe p {
  color: rgba(45, 33, 64, 0.62);
  line-height: 1.7;
  font-size: 12px;
}

.footer-brand strong,
.footer-links h3,
.footer-subscribe h3 {
  color: var(--footer-text);
}

.footer-logo-row strong {
  font-size: 18px;
}

.social-row {
  gap: 12px;
  margin-top: 18px;
}

.social-row span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(157, 49, 217, 0.12);
  border-radius: 999px;
  color: var(--purple);
  font-size: 11px;
  font-weight: 700;
}

.footer-links {
  display: grid;
  gap: 14px;
}

.footer-links a {
  color: rgba(45, 33, 64, 0.7);
  font-size: 12px;
}

.footer-subscribe form {
  display: flex;
  gap: 12px;
}

.footer-subscribe input {
  color: #36264b;
  background: rgba(45, 33, 64, 0.08);
}

.footer-subscribe input::placeholder {
  color: rgba(45, 33, 64, 0.46);
}

.auth-page-section {
  width: 100%;
}

.auth-page-section.register-mode .auth-shell {
  width: min(860px, 100%);
  display: grid;
  justify-items: center;
}

.auth-page-section.login-mode .auth-shell {
  width: min(1320px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
}

.auth-shell {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.auth-utility-nav {
  justify-content: flex-end;
  gap: 14px;
  margin-bottom: 8px;
}

.utility-text-link {
  color: var(--white);
}

.auth-tab {
  border: 0;
  color: var(--purple-strong);
  background: var(--white);
}

.auth-tab.active {
  color: var(--white);
  background: linear-gradient(90deg, var(--purple-strong), #bb3ce4);
}

.auth-card-public {
  min-height: 640px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(780px, 100%);
  padding: 62px 74px 52px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 44px;
  background: linear-gradient(180deg, rgba(126, 45, 151, 0.96), rgba(94, 36, 143, 0.94));
  box-shadow: 0 28px 90px rgba(35, 16, 62, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-page-section.register-mode .auth-card-public {
  width: min(640px, 100%);
  min-height: 0;
  padding-top: 56px;
  padding-bottom: 46px;
}

.auth-page-section.register-mode .auth-branding {
  margin-bottom: 22px;
}

.auth-page-section.register-mode .auth-branding h1 {
  font-size: clamp(58px, 6vw, 84px);
}

.auth-page-section.register-mode .auth-branding h2 {
  font-size: 30px;
}

.auth-page-section.register-mode .auth-form-public {
  gap: 12px;
}

.auth-branding {
  margin-bottom: 26px;
  text-align: center;
}

.auth-branding h1 {
  font-size: clamp(64px, 7vw, 94px);
  line-height: 0.94;
  margin-bottom: 10px;
  color: #000000;
}

.auth-branding h2 {
  margin: 0;
  font-size: 34px;
  color: #ffffff;
}

.auth-form-public,
.auth-form,
.auth-stack,
.form-grid,
.inventory-list,
.account-password-grid,
.account-grid {
  display: grid;
}

.auth-form-public,
.auth-form,
.auth-stack {
  gap: 14px;
}

.auth-form label,
.admin-form label,
.account-password-form label {
  display: grid;
  gap: 8px;
}

.auth-form label span,
.admin-form label span,
.account-password-form label span {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.field-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.66);
}

.auth-form input,
.admin-form input,
.admin-form textarea,
.account-password-form input {
  min-height: 52px;
  padding: 0 18px;
  color: var(--white);
  background: rgba(153, 47, 191, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.admin-form textarea {
  min-height: 128px;
  padding: 14px 16px;
  resize: vertical;
}

.admin-form input[type="file"] {
  min-height: auto;
  padding: 12px 14px;
}

.auth-submit-btn,
.admin-primary-btn {
  min-height: 56px;
  width: 196px;
  margin: 14px auto 0;
  border: 1px solid transparent;
}

.auth-bottom-copy {
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
}

.auth-text-link {
  padding: 0;
  border: 0;
  color: var(--white);
  background: transparent;
  text-decoration: underline;
}

.auth-text-link-dark {
  color: #140f26;
  text-decoration: none;
}

.auth-bottom-copy-register {
  margin-top: 28px;
  color: #ffffff;
}

.content-section,
.category-promo-grid,
.newsletter-section,
.site-footer {
  margin-top: 34px;
}

.content-section {
  padding: 26px 26px 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background: rgba(20, 15, 35, 0.62);
  backdrop-filter: blur(16px);
}

.split-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.split-section > div {
  display: grid;
  gap: 18px;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: 30px;
}

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

.category-promo-card {
  min-height: 154px;
  border-radius: 18px;
}

.auth-secondary-form {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-secondary-form h3 {
  margin: 0;
}

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

.account-card,
.account-password-form,
.admin-card {
  padding: 28px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
}

.account-card strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.account-password-form {
  margin-top: 24px;
}

.account-password-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.account-password-actions {
  gap: 14px;
  margin-top: 20px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 24px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.wide-field {
  grid-column: 1 / -1;
}

.cover-preview-card {
  display: grid;
  gap: 12px;
}

.cover-preview-image {
  width: 180px;
  height: 252px;
  object-fit: cover;
  object-position: center top;
  border-radius: 12px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.24);
}

.inventory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.inventory-header strong {
  font-size: 36px;
  color: var(--text-dark);
}

.inventory-list {
  gap: 12px;
  max-height: 520px;
  overflow: auto;
}

.inventory-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.76);
}

.inventory-row img {
  width: 58px;
  height: 78px;
  object-fit: cover;
  border-radius: 8px;
}

.inventory-copy {
  flex: 1;
}

.inventory-copy strong {
  display: block;
  margin-bottom: 4px;
}

.inventory-copy span,
.inventory-copy small {
  color: rgba(20, 15, 38, 0.58);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 1280px) {
  .book-row-grid,
  .trending-grid,
  .top-rated-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .best-seller-row,
  .category-card-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checkout-summary-card,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .split-section,
  .category-promo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .site-header,
  .site-main {
    padding-inline: 16px;
  }

  .header-inner,
  .main-nav,
  .header-actions,
  .hero-card,
  .newsletter-section,
  .footer-subscribe form,
  .books-heading,
  .books-toolbar,
  .section-heading.between,
  .account-password-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .header-inner {
    padding: 16px;
  }

  .hero-card {
    padding: 26px;
  }

  .hero-visual {
    width: 100%;
  }

  .hero-stage {
    width: 100%;
    min-height: 280px;
    border-radius: 24px;
  }

  .hero-book-stack-back {
    right: 134px;
  }

  .hero-book-stack-front {
    right: 52px;
  }

  .book-row-grid,
  .book-row-grid,
  .trending-grid,
  .top-rated-grid,
  .books-grid,
  .best-seller-row,
  .category-card-row,
  .account-grid,
  .account-password-grid,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .books-layout {
    grid-template-columns: 1fr;
  }

  .books-sidebar {
    padding-right: 0;
    padding-bottom: 24px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  }

  .checkout-table-header,
  .checkout-row {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-wrap: wrap;
  }

  .auth-card-public {
    min-height: auto;
    padding: 44px 28px;
  }
}

/* Definitive mobile book layout: isolated grid cells prevent card collisions */
@media (max-width: 640px) {
  .book-row-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    grid-auto-columns: initial !important;
    align-items: stretch !important;
    width: 100% !important;
    margin-inline: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    gap: 16px 12px !important;
  }

  .book-row-grid::after {
    display: none !important;
  }

  .book-row-grid > .book-cover-card,
  .book-row-grid > .book-cover-card.compact {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    flex: none !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    transform: none !important;
  }

  .book-row-grid .book-cover-card.compact .book-cover-frame {
    width: 100% !important;
    max-width: none !important;
  }

  .book-row-grid .book-cover-card.compact .book-cover-image {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 2 / 3;
    object-fit: cover;
  }

  .book-row-grid .book-cover-card.compact .book-meta {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .book-row-grid .book-cover-card.compact .book-category-label,
  .book-row-grid .book-cover-card.compact .book-meta h3,
  .book-row-grid .book-cover-card.compact .book-meta p {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis;
  }

  .book-row-grid .book-cover-card.compact .book-buy-btn {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    margin-top: auto !important;
  }
}

@media (max-width: 350px) {
  .book-row-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .book-row-grid > .book-cover-card,
  .book-row-grid > .book-cover-card.compact {
    width: min(100%, 240px) !important;
    margin-inline: auto !important;
  }
}

/* Store UX components */
.ui-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.book-title-btn { display: block; width: 100%; padding: 0; border: 0; color: inherit; background: transparent; text-align: inherit; }
.book-title-btn:hover h3 { color: #f3b0ff; }
.favorite-btn { position: absolute; top: 10px; right: 10px; z-index: 3; display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; color: #fff; background: rgba(15,12,26,.76); backdrop-filter: blur(12px); }
.favorite-btn.active { color: #ff8add; background: rgba(90,24,91,.9); }
.favorite-btn.active .ui-icon { fill: currentColor; }
.search-combobox { position: relative; min-width: min(360px, 42vw); }
.search-combobox > .ui-icon { position: absolute; top: 50%; left: 13px; z-index: 2; color: rgba(255,255,255,.6); transform: translateY(-50%); }
.search-combobox .books-search { width: 100%; padding-left: 42px; }
.search-suggestions { position: absolute; top: calc(100% + 7px); right: 0; left: 0; z-index: 50; overflow: hidden; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; background: #15111f; box-shadow: 0 20px 45px rgba(0,0,0,.4); }
.search-suggestions button { display: grid; grid-template-columns: 42px minmax(0,1fr); width: 100%; gap: 10px; padding: 9px 11px; border: 0; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; background: transparent; text-align: left; }
.search-suggestions button:hover { background: rgba(255,255,255,.08); }
.search-suggestions img { width: 42px; height: 56px; border-radius: 6px; object-fit: cover; }
.search-suggestions span { display: grid; align-content: center; min-width: 0; }
.search-suggestions strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-suggestions small { margin-top: 4px; color: rgba(255,255,255,.6); }
.books-sort { min-height: 44px; padding: 0 36px 0 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; color: #fff; background: #211a31; }
.books-sort.mobile { display: none; width: 100%; }
.rich-empty-state { display: grid; justify-items: center; gap: 10px; padding: 46px 24px; border-radius: 18px; text-align: center; }
.rich-empty-state > .ui-icon { width: 48px; height: 48px; color: #d56bed; }
.rich-empty-state h2, .rich-empty-state p { margin: 0; }
.rich-empty-state p { color: rgba(255,255,255,.7); }
.book-detail-page { width: min(100%,1280px); margin: 18px auto 0; }
.detail-back-btn { margin-bottom: 14px; padding: 10px 0; border: 0; color: rgba(255,255,255,.8); background: transparent; font-weight: 700; }
.book-detail-card { display: grid; grid-template-columns: minmax(260px,360px) minmax(0,1fr); gap: clamp(28px,5vw,72px); padding: clamp(24px,5vw,64px); border: 1px solid rgba(255,255,255,.12); border-radius: 24px; background: rgba(25,19,43,.84); box-shadow: var(--shadow-card); }
.book-detail-cover img { width: 100%; aspect-ratio: 2/3; border-radius: 18px; object-fit: cover; box-shadow: 0 24px 54px rgba(0,0,0,.36); }
.book-detail-copy { align-self: center; }
.book-detail-copy > span { color: #eda5fa; font-weight: 800; }
.book-detail-copy h1 { margin: 10px 0; font-size: clamp(34px,5vw,64px); line-height: 1.02; text-wrap: balance; }
.book-detail-copy h2 { margin: 0 0 16px; color: rgba(255,255,255,.7); font-size: 20px; }
.detail-rating { display: inline-flex; padding: 8px 12px; border-radius: 99px; color: #ffe6a7; background: rgba(255,255,255,.08); }
.book-detail-copy p { max-width: 680px; margin: 22px 0; color: rgba(255,255,255,.78); font-size: 16px; line-height: 1.75; }
.detail-price { display: block; margin-bottom: 20px; font-size: 30px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.detail-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding-inline: 20px; }
.detail-favorite { border: 1px solid rgba(255,255,255,.2); border-radius: 10px; color: #fff; background: rgba(255,255,255,.06); }
.detail-favorite.active { color: #ff9be2; border-color: rgba(255,155,226,.5); }
.related-books { margin-top: 28px; padding: 26px; border-radius: 22px; background: rgba(255,255,255,.05); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; align-items: center; gap: 14px; max-width: min(420px,calc(100vw - 24px)); padding: 15px 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; color: #fff; background: #17121f; box-shadow: 0 20px 45px rgba(0,0,0,.4); }
.toast button { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.1); font-size: 22px; }
.back-to-top { position: fixed; right: 20px; bottom: 82px; z-index: 80; width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: #fff; background: #9229c5; box-shadow: 0 12px 30px rgba(0,0,0,.3); font-size: 22px; }
.skeleton-page { width: min(100%,1280px); margin: 20px auto; }
.skeleton { position: relative; overflow: hidden; border-radius: 18px; background: rgba(255,255,255,.08); }
.skeleton::after { position: absolute; inset: 0; background: linear-gradient(90deg,transparent,rgba(255,255,255,.1),transparent); content: ""; animation: skeleton-shimmer 1.3s infinite; transform: translateX(-100%); }
.hero-skeleton { height: 360px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-top: 22px; }
.book-skeleton { height: 340px; }
@keyframes skeleton-shimmer { to { transform: translateX(100%); } }

@media (max-width: 980px) {
  .books-sort.mobile { display: block; }
  .book-detail-card { grid-template-columns: minmax(200px,280px) minmax(0,1fr); }
  .skeleton-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .search-combobox { width: 100%; min-width: 0; }
  .search-suggestions { position: fixed; top: 136px; right: 20px; left: 20px; }
  .book-detail-card { grid-template-columns: 1fr; gap: 24px; padding: 18px; }
  .book-detail-cover { width: min(72vw,260px); margin-inline: auto; }
  .book-detail-copy h1 { font-size: 32px; }
  .detail-actions { display: grid; }
  .detail-actions button { width: 100%; }
  .related-books { padding: 18px 12px; }
  .toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
  .back-to-top { right: 12px; bottom: 76px; }
  .hero-skeleton { height: 280px; }
  .skeleton-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .book-skeleton { height: 260px; }
}

/* Actionable cart toast and compact mobile checkout */
.toast { justify-content: space-between; }
.toast > span { min-width: 0; line-height: 1.35; }
.toast-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.toast .toast-cart-btn { display: inline-flex; width: auto; min-width: 112px; height: 38px; padding: 0 12px; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 9px; color: #fff; background: linear-gradient(90deg,var(--purple-strong),#c33cde); font-size: 13px; font-weight: 800; }
.toast .toast-cart-btn .ui-icon { width: 16px; height: 16px; }
.toast .toast-close-btn { flex: 0 0 32px; }

@media (max-width: 640px) {
  .toast { align-items: flex-start; }
  .toast-actions { align-self: center; }

  .checkout-list { gap: 12px; }
  .checkout-row {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) auto !important;
    grid-template-rows: auto auto !important;
    gap: 16px 12px !important;
    min-height: 0 !important;
    padding: 16px !important;
    align-items: center !important;
    overflow: hidden;
  }
  .checkout-item-cell {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: 68px minmax(0,1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 12px !important;
    align-items: start !important;
  }
  .checkout-item-cell img {
    width: 68px !important;
    height: 96px !important;
    min-width: 0 !important;
    border-radius: 10px !important;
    object-fit: cover !important;
  }
  .checkout-item-cell div { min-width: 0 !important; }
  .checkout-item-cell small,
  .checkout-item-cell strong,
  .checkout-item-cell span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .checkout-item-cell strong { margin: 5px 0 !important; font-size: 17px !important; line-height: 1.2 !important; }
  .checkout-qty-cell {
    grid-column: 1 !important;
    display: grid !important;
    grid-template-columns: 40px 38px 40px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: max-content !important;
    height: 40px !important;
    justify-self: start !important;
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(111,55,142,.16);
    border-radius: 10px;
    background: #f0e7f5 !important;
  }
  .checkout-qty-cell button,
  .checkout-qty-cell span {
    display: grid !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 0 !important;
    padding: 0 !important;
    place-items: center !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 18px !important;
  }
  .checkout-qty-cell span { width: 38px !important; color: var(--text-dark) !important; font-size: 15px !important; }
  .checkout-price-cell { display: none !important; }
  .checkout-price-cell::before,
  .checkout-total-cell::before { display: none !important; content: none !important; }
  .checkout-total-cell {
    grid-column: 2 !important;
    display: grid !important;
    grid-template-columns: auto auto !important;
    width: auto !important;
    min-width: 0 !important;
    justify-self: end !important;
    align-items: center !important;
    justify-content: end !important;
    gap: 8px !important;
  }
  .checkout-total-cell strong { white-space: nowrap; font-size: 17px !important; }
  .checkout-remove-btn { width: auto !important; min-width: 0 !important; min-height: 38px !important; padding: 0 10px !important; }
}

@media (max-width: 390px) {
  .toast { display: grid; gap: 10px; }
  .toast-actions { width: 100%; justify-content: space-between; }
  .checkout-row { grid-template-columns: minmax(0,1fr) !important; }
  .checkout-qty-cell,
  .checkout-total-cell { grid-column: 1 !important; justify-self: stretch !important; }
  .checkout-total-cell { grid-template-columns: minmax(0,1fr) auto !important; }
}

@media (max-width: 640px) {
  .auth-shell-page {
    padding: 16px 12px;
  }

  .site-header {
    padding: 12px 12px 0;
  }

  .site-main {
    padding: 0 12px 40px;
  }

  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    min-height: auto;
    padding: 14px;
  }

  .brand-btn {
    align-self: center;
  }

  .header-actions {
    display: none;
  }

  .main-nav {
    display: none;
  }

  .mobile-menu-trigger {
    display: block;
    align-self: center;
  }

  .mobile-menu-sheet.open {
    display: block;
    grid-column: 1 / -1;
  }

  .trending-grid,
  .top-rated-grid,
  .books-grid,
  .best-seller-row,
  .category-card-row,
  .account-grid,
  .account-password-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .newsletter-form,
  .footer-subscribe form,
  .checkout-qty-cell,
  .book-admin-actions,
  .auth-utility-nav,
  .auth-bottom-copy {
    flex-direction: column;
    align-items: stretch;
  }

  .section-heading h2,
  .books-sidebar h2,
  .checkout-summary-copy h2 {
    font-size: 28px;
  }

  .home-section,
  .books-page,
  .checkout-page,
  .account-panel,
  .admin-section {
    padding-top: 34px;
  }

  .hero-card {
    gap: 18px;
    min-height: auto;
    padding: 22px 18px 18px;
    border-radius: 22px;
  }

  .hero-copy {
    width: 100%;
    padding-top: 0;
  }

  .hero-copy h1 {
    max-width: 240px;
    font-size: 28px;
    line-height: 1.08;
  }

  .hero-copy p {
    max-width: 220px;
    margin: 12px 0 16px;
    font-size: 12px;
  }

  .hero-cta-btn {
    min-width: 0;
    min-height: 36px;
    padding: 0 14px;
    font-size: 11px;
  }

  .hero-visual {
    width: 100%;
  }

  .hero-stage {
    min-height: 204px;
    border-radius: 18px;
  }

  .hero-book-tile {
    width: 70px;
    height: 106px;
  }

  .hero-book-tile.small {
    width: 58px;
    height: 88px;
  }

  .hero-book-stack {
    gap: 12px;
  }

  .hero-book-stack-back {
    top: 24px;
    right: 92px;
  }

  .hero-book-stack-front {
    right: 26px;
    bottom: 68px;
  }

  .hero-highlight-card {
    left: 16px;
    bottom: 16px;
    width: 128px;
    gap: 4px;
    padding: 10px 10px 9px;
  }

  .hero-highlight-card strong {
    font-size: 14px;
  }

  .hero-highlight-card small,
  .hero-highlight-card span,
  .hero-highlight-kicker {
    font-size: 9px;
  }

  .hero-slide-indicators {
    right: 18px;
    bottom: 16px;
  }

  .book-meta h3,
  .checkout-item-cell strong {
    font-size: 18px;
  }

  .book-cover-frame,
  .books-grid-item .book-cover-frame {
    width: min(100%, 172px);
  }

  .book-cover-image {
    height: 230px;
  }

  .book-cover-card.compact .book-cover-frame {
    width: min(100%, 132px);
  }

  .book-cover-card.compact .book-cover-image {
    height: 162px;
  }

  .book-meta {
    width: 100%;
    max-width: 184px;
  }

  .books-toolbar {
    gap: 12px;
  }

  .books-search-input,
  .cart-summary-btn {
    width: 100%;
  }

  .books-sidebar {
    padding-bottom: 18px;
  }

  .newsletter-section {
    gap: 18px;
    padding: 52px 0 44px;
  }

  .newsletter-copy {
    max-width: 260px;
  }

  .newsletter-copy h2 {
    font-size: 26px;
    line-height: 1.08;
  }

  .newsletter-section::before,
  .newsletter-section::after {
    display: none;
  }

  .checkout-row,
  .checkout-summary-card,
  .site-footer {
    padding: 18px;
  }

  .site-footer {
    gap: 24px;
  }

  .footer-link-column,
  .footer-subscribe {
    width: 100%;
  }

  .overlay-panel {
    min-height: 380px;
    padding: 28px 20px;
    border-radius: 42px;
  }

  .overlay-primary-btn,
  .overlay-secondary-btn {
    min-height: 58px;
    font-size: 18px;
  }

  .auth-branding h1 {
    font-size: 54px;
  }

  .auth-branding h2 {
    font-size: 26px;
  }

  .auth-card-public {
    padding: 34px 18px;
  }

  .auth-form input,
  .newsletter-form input,
  .newsletter-form button,
  .footer-subscribe input,
  .footer-subscribe button,
  .ghost-header-btn,
  .header-primary-btn,
  .auth-submit-btn,
  .checkout-primary-btn,
  .checkout-secondary-btn,
  .cart-summary-btn {
    width: 100%;
  }

  .page-breadcrumb {
    min-height: auto;
    gap: 6px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 12px;
    line-height: 1.3;
    border-radius: 10px;
  }

  .books-layout {
    gap: 20px;
  }

  .books-sidebar {
    display: grid;
    gap: 12px;
  }

  .books-sidebar h3 {
    margin: 0;
    font-size: 20px;
  }

  .category-filter-list {
    gap: 10px;
  }

  .category-filter-link,
  .featured-toggle {
    font-size: 13px;
  }

  .featured-toggle {
    margin-top: 4px;
  }

  .books-heading {
    gap: 14px;
  }

  .books-heading h2 {
    font-size: 28px;
  }

  .books-heading p {
    max-width: none;
    margin: 8px 0 0;
    font-size: 13px;
  }

  .books-search-input,
  .cart-summary-btn {
    min-height: 42px;
    font-size: 13px;
  }

  .book-admin-actions .ghost-header-btn,
  .book-admin-actions .delete-icon-btn {
    width: 100%;
  }

  .checkout-table-header {
    display: none;
  }

  .checkout-list {
    gap: 14px;
  }

  .checkout-row {
    gap: 14px;
  }

  .checkout-item-cell {
    align-items: flex-start;
    gap: 14px;
  }

  .checkout-item-cell img {
    width: 78px;
    height: 104px;
    border-radius: 10px;
  }

  .checkout-item-cell strong {
    margin: 6px 0;
    font-size: 18px;
  }

  .checkout-item-cell small,
  .checkout-item-cell span {
    font-size: 11px;
  }

  .checkout-qty-cell {
    justify-content: flex-start;
  }

  .checkout-qty-cell button {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  .checkout-qty-cell span,
  .checkout-price-cell,
  .checkout-total-cell strong {
    font-size: 16px;
  }

  .checkout-price-cell::before,
  .checkout-total-cell::before {
    display: block;
    margin-bottom: 4px;
    color: var(--text-soft-dark);
    font-size: 11px;
    font-weight: 600;
  }

  .checkout-price-cell::before {
    content: "Цена";
  }

  .checkout-total-cell::before {
    content: "Итого";
  }

  .checkout-summary-card {
    gap: 18px;
    margin-top: 24px;
    padding: 18px 16px;
  }

  .checkout-summary-card::before {
    display: none;
  }

  .checkout-summary-copy h2 {
    font-size: 28px;
  }

  .checkout-summary-copy p {
    margin-top: 10px;
    font-size: 13px;
  }

  .checkout-summary-values {
    gap: 12px;
  }

  .checkout-primary-btn,
  .checkout-secondary-btn {
    min-height: 46px;
    font-size: 13px;
  }

  .account-card,
  .account-password-form,
  .admin-card {
    padding: 18px;
  }

  .account-card strong {
    font-size: 18px;
  }

  .account-password-form h3,
  .admin-card h3 {
    font-size: 22px;
  }

  .account-password-grid {
    gap: 14px;
  }

  .account-password-actions {
    gap: 10px;
  }

  .account-password-actions .header-primary-btn,
  .account-password-actions .ghost-header-btn {
    width: 100%;
  }

  .admin-layout {
    gap: 16px;
  }

  .admin-form-heading,
  .inventory-header,
  .inventory-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .inventory-header strong {
    font-size: 24px;
  }

  .inventory-list {
    max-height: none;
  }

  .inventory-row {
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
  }

  .inventory-row img {
    width: 48px;
    height: 66px;
  }

  .inventory-actions .ghost-header-btn,
  .inventory-actions .inventory-delete-btn {
    width: 100%;
  }

  .footer-link-column h4,
  .footer-subscribe h3 {
    margin-bottom: 10px;
  }

  .footer-subscribe p,
  .footer-brand p {
    font-size: 13px;
    line-height: 1.55;
  }
}

/* Mobile navigation layering */
@media (max-width: 980px) {
  .site-header {
    position: relative;
    z-index: 100;
    isolation: isolate;
  }

  .header-inner {
    overflow: visible;
  }

  .mobile-menu-sheet.open {
    right: 0;
    left: 0;
    z-index: 110;
    width: 100%;
    max-width: 100%;
    border-color: rgba(255, 255, 255, 0.18);
    background: #100e19;
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.48);
    opacity: 1;
  }

  .mobile-menu-links,
  .mobile-menu-actions {
    position: relative;
    z-index: 1;
  }

  .mobile-menu-link {
    width: 100%;
    background: #191622;
  }

  .mobile-menu-link.active {
    background: #2b1638;
  }

  .books-mobile-sticky {
    z-index: 20;
  }
}

@media (max-width: 420px) {
  .site-header,
  .site-main {
    padding-inline: 10px;
  }

  .header-inner {
    padding: 12px;
  }

  .brand {
    gap: 8px;
    font-size: 14px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .nav-link {
    font-size: 10px;
  }

  .hero-card {
    padding: 18px 14px 14px;
  }

  .hero-copy h1 {
    max-width: 210px;
    font-size: 24px;
  }

  .hero-stage {
    min-height: 188px;
  }

  .hero-book-stack-back {
    right: 78px;
  }

  .hero-book-stack-front {
    right: 18px;
    bottom: 58px;
  }

  .hero-book-tile {
    width: 62px;
    height: 94px;
  }

  .hero-book-tile.small {
    width: 50px;
    height: 78px;
  }

  .hero-highlight-card {
    width: 116px;
    padding: 9px 9px 8px;
  }

  .section-heading h2,
  .books-sidebar h2,
  .checkout-summary-copy h2,
  .books-heading h2 {
    font-size: 24px;
  }

  .book-cover-frame,
  .books-grid-item .book-cover-frame {
    width: min(100%, 154px);
  }

  .book-cover-image {
    height: 210px;
  }

  .book-meta {
    max-width: 168px;
  }

  .checkout-row,
  .checkout-summary-card,
  .account-card,
  .account-password-form,
  .admin-card,
  .site-footer {
    padding: 14px;
  }
}

/* Current app.js layout overrides */
.shell-content {
  display: grid;
  gap: 40px;
}

.books-search {
  width: min(360px, 100%);
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.books-search::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.filter-card {
  display: grid;
  gap: 18px;
  padding: 22px 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.filter-card h3 {
  margin: 0;
  font-size: 20px;
}

.filter-list {
  display: grid;
  gap: 10px;
}

.filter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  text-align: left;
}

.filter-link.active {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.filter-link small {
  color: rgba(255, 255, 255, 0.54);
  font-size: 12px;
}

.hero-book {
  display: block;
  border-radius: 18px;
  object-fit: cover;
  object-position: center top;
  box-shadow: 0 18px 38px rgba(12, 9, 26, 0.38);
}

.hero-book-back {
  width: 92px;
  height: 138px;
}

.hero-book-front {
  width: 112px;
  height: 168px;
}

.hero-indicators {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-right: 8px;
}

.hero-indicator {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.hero-indicator.active {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.2);
}

.hero-highlight-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-highlight-card b {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.account-page,
.admin-page {
  display: grid;
  gap: 24px;
}

.account-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.account-card {
  display: grid;
  gap: 14px;
}

.account-card h1,
.account-card h2,
.admin-form h1,
.inventory-panel h2 {
  margin: 0;
}

.account-card p,
.account-card small,
.admin-form p,
.inventory-item p,
.inventory-item small {
  margin: 0;
}

.account-card label,
.admin-form label {
  display: grid;
  gap: 8px;
}

.account-card small {
  color: rgba(255, 255, 255, 0.72);
}

.admin-form {
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.inventory-panel {
  display: grid;
  gap: 16px;
  padding: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
}

.inventory-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.82);
}

.inventory-item img {
  width: 62px;
  height: 88px;
  object-fit: cover;
  object-position: center top;
  border-radius: 8px;
}

.inventory-item-actions {
  display: grid;
  gap: 10px;
}

.upload-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-cover-selection {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(13, 9, 25, 0.28);
}

.admin-cover-selection small {
  color: rgba(255, 255, 255, 0.62);
}

.admin-book-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.admin-image-slot {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  min-height: 190px;
  padding: 12px;
  color: rgba(255, 255, 255, 0.84);
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-image-slot.filled { border-style: solid; border-color: rgba(238, 100, 214, 0.32); }
.admin-image-slot > img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 9px; }
.admin-image-slot > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-image-actions { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 6px; }
.admin-image-actions button, .admin-image-actions label { min-width: 0; padding: 7px 8px; font-size: 11px; }

.book-detail-gallery { display: grid; gap: 12px; align-self: start; }
.book-detail-thumbnails { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.book-detail-thumbnails button { padding: 3px; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: rgba(255,255,255,.08); }
.book-detail-thumbnails button.active { border-color: var(--pink); }
.book-detail-thumbnails img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; }

@media (max-width: 760px) {
  .admin-book-images { grid-template-columns: 1fr; }
  .admin-image-slot { grid-template-columns: 100px minmax(0, 1fr); min-height: 0; align-items: start; }
  .admin-image-slot > span, .admin-image-slot > small, .admin-image-slot > .upload-btn { grid-column: 1 / -1; }
  .admin-image-slot > img { grid-row: 2 / span 2; width: 100px; }
  .admin-image-actions { grid-column: 2; }
}

.admin-cover-error {
  color: #ffb8ca;
  font-size: 13px;
}

.admin-cover-preview {
  display: grid;
  width: fit-content;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  text-align: center;
}

.admin-cover-preview img {
  width: 180px;
  height: 252px;
  object-fit: cover;
  object-position: center top;
  border-radius: 12px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.24);
}

.summary-watermark {
  position: absolute;
  right: 18px;
  top: 14px;
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  color: rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.summary-line.total {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

@media (min-width: 981px) {
  .site-main {
    padding: 0 32px 88px;
  }

  .shell-content {
    gap: 52px;
  }

  .hero-card {
    min-height: 560px;
    gap: 42px;
    padding: 42px;
  }

  .hero-copy {
    width: min(430px, 100%);
    padding-top: 18px;
  }

  .hero-copy h1 {
    max-width: 420px;
    font-size: clamp(48px, 5vw, 72px);
    line-height: 0.98;
  }

  .hero-copy p {
    max-width: 360px;
    margin: 18px 0 26px;
    font-size: 15px;
    line-height: 1.6;
  }

  .hero-visual {
    width: min(480px, 44vw);
  }

  .hero-stage {
    min-height: 420px;
  }

  .books-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 36px;
  }

  .books-heading {
    align-items: flex-start;
  }

  .books-heading h1 {
    margin: 0;
    font-size: 40px;
    line-height: 1.04;
  }

  .books-heading p {
    max-width: 460px;
  }

  .books-toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
  }

  .checkout-row {
    grid-template-columns: 1.45fr 0.75fr 0.55fr 0.7fr;
  }

  .checkout-summary-card {
    position: relative;
    margin-top: 28px;
    padding: 28px;
  }

  .account-layout {
    align-items: start;
  }
}

@media (max-width: 980px) {
  .books-search {
    width: 100%;
  }

  .account-layout,
  .admin-layout,
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .inventory-item {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .inventory-item-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .auth-shell {
    width: 100%;
    max-width: 398px;
    margin: 0 auto;
  }

  .auth-page-section.login-mode .auth-utility-nav {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(18, 13, 33, 0.72);
    backdrop-filter: blur(14px);
  }

  .auth-page-section.login-mode .utility-text-link,
  .auth-page-section.login-mode .auth-tab {
    width: auto;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 38px;
    padding: 0 12px;
  }

  .auth-bottom-copy {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .auth-card-public {
    min-height: auto;
    width: min(100%, 358px);
    padding: 22px 16px 18px;
    border-radius: 28px;
  }

  .auth-branding {
    margin-bottom: 18px;
  }

  .auth-branding h1 {
    font-size: 44px;
    margin-bottom: 8px;
  }

  .auth-branding h2 {
    font-size: 20px;
  }

  .auth-form-public,
  .auth-form,
  .auth-stack {
    gap: 14px;
  }

  .auth-form label span {
    font-size: 13px;
  }

  .auth-form input {
    min-height: 44px;
    padding: 0 13px;
  }

  .auth-submit-btn {
    min-height: 48px;
    margin-top: 10px;
  }

  .shell-content {
    gap: 28px;
  }

  .hero-card {
    padding: 20px 16px 18px;
  }

  .hero-copy h1 {
    max-width: 260px;
    font-size: 30px;
  }

  .hero-copy p {
    max-width: none;
    font-size: 13px;
  }

  .hero-stage {
    min-height: 220px;
  }

  .hero-book-back {
    width: 58px;
    height: 88px;
  }

  .hero-book-front {
    width: 70px;
    height: 106px;
  }

  .hero-book-stack-back {
    right: 92px;
  }

  .hero-book-stack-front {
    right: 24px;
    bottom: 68px;
  }

  .hero-indicators {
    justify-content: center;
    padding-right: 0;
  }

  .books-layout {
    gap: 18px;
  }

  .filter-card {
    padding: 18px 16px;
  }

  .books-heading h1 {
    margin: 0;
    font-size: 30px;
  }

  .books-toolbar {
    display: grid;
    gap: 12px;
  }

  .book-admin-actions,
  .inventory-item-actions {
    grid-template-columns: 1fr;
  }

  .checkout-row {
    padding: 16px;
  }

  .checkout-summary-card {
    position: relative;
  }

  .summary-watermark {
    font-size: 34px;
  }
}

@media (max-width: 420px) {
  .auth-page-section.register-mode .auth-card-public {
    width: min(100%, 332px);
    padding: 20px 14px 16px;
    border-radius: 24px;
  }

  .auth-page-section.register-mode .auth-branding h1 {
    font-size: 38px;
  }

  .auth-page-section.register-mode .auth-branding h2 {
    font-size: 18px;
  }

  .book-row-grid {
    grid-auto-columns: 128px;
  }

  .book-row-grid .book-cover-card {
    width: 128px;
  }

  .book-row-grid .book-cover-card.compact .book-cover-image {
    height: 168px;
  }

  .auth-page-section.login-mode .auth-utility-nav {
    justify-content: center;
  }

  .auth-page-section.login-mode .utility-text-link,
  .auth-page-section.login-mode .auth-tab {
    font-size: 12px;
  }

  .auth-card-public {
    width: min(100%, 332px);
    padding: 18px 14px 16px;
    border-radius: 24px;
  }

  .auth-branding h1 {
    font-size: 38px;
  }

  .auth-branding h2 {
    font-size: 18px;
  }

  .site-main {
    padding: 0 10px 32px;
  }

  .hero-copy h1 {
    font-size: 26px;
  }

  .hero-stage {
    min-height: 196px;
  }

  .hero-book-back {
    width: 50px;
    height: 76px;
  }

  .hero-book-front {
    width: 62px;
    height: 94px;
  }

  .hero-book-stack-back {
    right: 74px;
  }

  .hero-book-stack-front {
    right: 16px;
    bottom: 58px;
  }

  .hero-highlight-card {
    width: 124px;
    padding: 10px;
  }

  .hero-highlight-card strong {
    font-size: 13px;
  }

  .hero-highlight-card b,
  .hero-highlight-label,
  .hero-highlight-card small {
    font-size: 9px;
  }

  .inventory-item {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .inventory-item img {
    width: 72px;
    height: 100px;
  }
}

/* Books catalog refinement for desktop and phone */
.books-mobile-sticky {
  display: none;
}

.books-content {
  min-width: 0;
}

.books-heading h1 {
  margin: 0;
}

@media (min-width: 981px) {
  .books-content {
    display: grid;
    gap: 22px;
  }

  .books-heading {
    align-items: flex-end;
  }

  .books-toolbar {
    position: sticky;
    top: 16px;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(20, 15, 35, 0.72);
    backdrop-filter: blur(18px);
  }

  .books-search {
    width: min(420px, 100%);
  }

  .cart-summary-btn {
    min-width: 168px;
  }
}

@media (max-width: 640px) {
  .auth-page-section.register-mode .auth-shell {
    width: 100%;
    max-width: 398px;
  }

  .auth-page-section.register-mode .auth-card-public {
    width: min(100%, 358px);
    padding: 24px 16px 20px;
    border-radius: 30px;
  }

  .auth-page-section.register-mode .auth-branding h1 {
    font-size: 44px;
  }

  .auth-page-section.register-mode .auth-branding h2 {
    font-size: 21px;
  }

  .book-row-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 142px;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 10px;
    scrollbar-width: thin;
  }

  .book-row-grid::-webkit-scrollbar {
    height: 6px;
  }

  .book-row-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
  }

  .book-row-grid .book-cover-card {
    width: 142px;
  }

  .book-row-grid .book-cover-card.compact .book-cover-frame {
    width: 100%;
  }

  .book-row-grid .book-cover-card.compact .book-cover-image {
    height: 182px;
  }

  .book-row-grid .book-cover-card.compact .book-meta {
    max-width: none;
  }

  .book-row-grid .book-cover-card.compact .book-meta h3 {
    font-size: 13px;
  }

  .book-row-grid .book-cover-card.compact .book-buy-btn {
    width: 100%;
    min-width: 0;
  }

  .books-sidebar,
  .books-toolbar {
    display: none;
  }

  .content-section {
    padding: 18px 16px 18px;
    border-radius: 18px;
  }

  .category-promo-grid {
    gap: 12px;
  }

  .category-promo-card {
    min-height: 110px;
    padding: 14px 12px;
  }

  .category-promo-card strong {
    font-size: 15px;
  }

  .value-strip {
    gap: 12px;
    padding: 14px;
    margin-top: 24px;
  }

  .value-item {
    text-align: left;
  }

  .value-item p {
    font-size: 11px;
  }

  .split-section {
    gap: 16px;
  }

  .books-mobile-sticky {
    position: sticky;
    top: 10px;
    z-index: 12;
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(18, 13, 33, 0.92);
    backdrop-filter: blur(18px);
  }

  .books-mobile-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .books-mobile-filter-scroller {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .books-mobile-filter-scroller::-webkit-scrollbar {
    height: 6px;
  }

  .books-mobile-filter-scroller::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
  }

  .books-mobile-chip,
  .books-mobile-toggle {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.84);
    background: rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
  }

  .books-mobile-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .books-mobile-chip small {
    color: rgba(255, 255, 255, 0.56);
    font-size: 11px;
  }

  .books-mobile-chip.active,
  .books-mobile-toggle.active {
    border-color: rgba(208, 93, 255, 0.42);
    background: linear-gradient(90deg, rgba(154, 52, 224, 0.85), rgba(205, 88, 241, 0.76));
    color: var(--white);
  }

  .books-mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
  }

  .books-mobile-toggle input {
    width: 14px;
    height: 14px;
    margin: 0;
  }

  .books-content {
    display: grid;
    gap: 12px;
  }

  .books-heading {
    gap: 8px;
  }

  .books-heading h1 {
    font-size: 28px;
  }

  .books-heading p {
    margin: 6px 0 0;
    font-size: 12px;
  }

  .books-grid {
    gap: 14px;
  }

  .books-grid-item {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .books-grid-item .book-cover-card {
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
  }

  .books-grid-item .book-cover-frame {
    flex: 0 0 104px;
    width: 104px;
    margin: 0;
  }

  .books-grid-item .book-cover-image {
    height: 148px;
    border-radius: 12px;
  }

  .books-grid-item .book-meta {
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
    padding-top: 2px;
  }

  .books-grid-item .book-meta h3 {
    max-width: none;
    font-size: 18px;
  }

  .books-grid-item .book-meta p {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .books-grid-item .book-buy-btn {
    min-height: 38px;
    min-width: 0;
    padding: 0 12px;
  }
}

@media (max-width: 420px) {
  .books-mobile-sticky {
    top: 8px;
    margin-bottom: 14px;
    padding: 10px;
  }

  .books-grid-item {
    padding: 12px;
  }

  .books-grid-item .book-cover-card {
    gap: 12px;
  }

  .books-grid-item .book-cover-frame {
    flex-basis: 92px;
    width: 92px;
  }

  .books-grid-item .book-cover-image {
    height: 132px;
  }

  .books-grid-item .book-meta h3 {
    font-size: 16px;
  }
}

/* Checkout and admin refinement */
@media (min-width: 981px) {
  .checkout-page {
    display: grid;
    gap: 24px;
  }

  .checkout-list {
    gap: 16px;
  }

  .checkout-row {
    grid-template-columns: 1.6fr 0.65fr 0.55fr 0.7fr;
    padding: 20px 22px;
  }

  .checkout-summary-card {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
  }

  .inventory-panel {
    position: sticky;
    top: 16px;
    align-self: start;
  }
}

@media (max-width: 640px) {
  .checkout-page {
    display: grid;
    gap: 14px;
  }

  .checkout-list {
    gap: 12px;
  }

  .checkout-row {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
  }

  .checkout-item-cell {
    gap: 12px;
  }

  .checkout-item-cell img {
    width: 72px;
    height: 96px;
  }

  .checkout-item-cell strong {
    margin: 4px 0 6px;
    font-size: 17px;
    line-height: 1.16;
  }

  .checkout-item-cell small,
  .checkout-item-cell span {
    font-size: 11px;
    line-height: 1.35;
  }

  .checkout-qty-cell {
    display: inline-flex;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(91, 40, 147, 0.08);
    width: fit-content;
  }

  .checkout-qty-cell button {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .checkout-price-cell,
  .checkout-total-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .checkout-price-cell::before {
    content: "Цена";
    color: var(--text-soft-dark);
    font-size: 12px;
    font-weight: 600;
  }

  .checkout-total-cell::before {
    content: "Итого";
    color: var(--text-soft-dark);
    font-size: 12px;
    font-weight: 600;
  }

  .checkout-total-cell {
    flex-wrap: wrap;
  }

  .checkout-remove-btn {
    min-height: 34px;
    margin-left: auto;
  }

  .checkout-summary-card {
    gap: 14px;
    margin-top: 10px;
    padding: 16px 14px;
    border-radius: 14px;
  }

  .summary-watermark {
    font-size: 28px;
  }

  .summary-line,
  .summary-line.total {
    font-size: 14px;
  }

  .checkout-primary-btn,
  .overlay-secondary-btn {
    width: 100%;
  }

  .admin-page {
    gap: 18px;
  }

  .admin-form,
  .inventory-panel {
    padding: 18px 14px;
    border-radius: 14px;
  }

  .admin-form-heading {
    align-items: stretch;
    gap: 10px;
  }

  .admin-form h1 {
    font-size: 26px;
    line-height: 1.08;
  }

  .admin-form p {
    font-size: 13px;
    line-height: 1.45;
  }

  .inventory-actions {
    align-items: stretch;
    gap: 10px;
  }

  .upload-btn,
  .inventory-actions .feature-toggle {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }

  .admin-cover-preview img {
    width: 132px;
    height: 188px;
  }

  .inventory-panel h2 {
    font-size: 24px;
  }

  .inventory-list {
    gap: 10px;
    max-height: none;
    overflow: visible;
  }

  .inventory-item {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
  }

  .inventory-item img {
    width: 56px;
    height: 78px;
  }

  .inventory-item div strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.2;
  }

  .inventory-item p,
  .inventory-item small {
    font-size: 11px;
    line-height: 1.35;
  }
}

@media (max-width: 420px) {
  .checkout-row {
    padding: 12px;
  }

  .checkout-item-cell {
    gap: 10px;
  }

  .checkout-item-cell img {
    width: 66px;
    height: 90px;
  }

  .checkout-item-cell strong {
    font-size: 16px;
  }

  .checkout-qty-cell {
    width: 100%;
    justify-content: center;
  }

  .checkout-summary-card {
    padding: 14px 12px;
  }

  .admin-form h1 {
    font-size: 22px;
  }

  .inventory-item {
    grid-template-columns: 1fr;
  }

  .inventory-item-actions {
    grid-column: auto;
  }
}

/* Final polish for desktop/mobile auth and home */
.auth-shell-page {
  padding: 20px 16px 30px;
}

.auth-page-section.login-mode .auth-shell {
  width: min(980px, 100%);
  gap: 18px;
}

.auth-page-section.login-mode .auth-utility-nav {
  justify-content: center;
  width: fit-content;
  margin: 0 auto;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(18, 13, 33, 0.46);
  backdrop-filter: blur(18px);
}

.auth-card-public {
  width: min(760px, 100%);
  min-height: 600px;
  padding: 56px 68px 46px;
}

.auth-branding {
  margin-bottom: 22px;
}

.auth-branding h1 {
  font-size: clamp(72px, 7vw, 96px);
  margin-bottom: 12px;
}

.auth-branding h2 {
  font-size: 30px;
}

.auth-form-public {
  gap: 12px;
}

.auth-form label {
  gap: 6px;
}

.auth-form input {
  min-height: 50px;
}

.auth-submit-btn {
  min-height: 52px;
  margin-top: 8px;
}

.auth-bottom-copy {
  margin-top: 6px;
}

.hero-card {
  align-items: stretch;
  min-height: 380px;
}

.hero-copy {
  width: min(42%, 430px);
  padding-top: 58px;
}

.hero-copy p {
  max-width: 390px;
}

.hero-visual {
  min-width: 0;
}

.hero-stage {
  width: min(100%, 590px);
  min-height: 380px;
}

.value-strip {
  align-items: stretch;
}

.content-section {
  padding: 24px 24px 26px;
}

.split-section {
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.category-promo-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (min-width: 981px) {
  .site-main {
    padding: 0 28px 72px;
  }

  .auth-shell-page {
    align-items: flex-start;
    padding-top: 56px;
  }

  .auth-page-section.login-mode .auth-shell {
    gap: 22px;
  }

  .content-section.split-section {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
  }

  .books-layout {
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 24px;
  }

  .books-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .category-promo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-card {
    display: grid;
    gap: 18px;
    padding: 24px 22px 22px;
  }

  .hero-copy,
  .hero-visual {
    width: 100%;
  }

  .hero-copy {
    padding-top: 0;
  }

  .hero-copy h1 {
    max-width: 520px;
  }

  .hero-stage {
    width: 100%;
    border-radius: 22px;
  }
}

@media (max-width: 640px) {
  .auth-shell-page {
    align-items: flex-start;
    padding: 12px 10px 22px;
  }

  .auth-shell,
  .auth-page-section.login-mode .auth-shell,
  .auth-page-section.register-mode .auth-shell {
    width: 100%;
    max-width: 100%;
  }

  .auth-page-section.login-mode .auth-utility-nav {
    width: min(100%, 358px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 16px;
  }

  .auth-page-section.login-mode .utility-text-link,
  .auth-page-section.login-mode .auth-tab {
    width: 100%;
    justify-content: center;
  }

  .auth-card-public,
  .auth-page-section.register-mode .auth-card-public {
    width: 100%;
    min-height: 0;
    padding: 24px 16px 20px;
    border-radius: 26px;
  }

  .auth-branding h1,
  .auth-page-section.register-mode .auth-branding h1 {
    font-size: 52px;
  }

  .auth-branding h2,
  .auth-page-section.register-mode .auth-branding h2 {
    font-size: 22px;
  }

  .auth-form input {
    min-height: 46px;
  }

  .hero-card {
    padding: 18px 14px 16px;
    border-radius: 24px;
  }

  .hero-copy h1 {
    font-size: 28px;
  }

  .hero-copy p {
    margin: 12px 0 18px;
    font-size: 13px;
  }

  .hero-stage {
    min-height: 232px;
  }

  .value-strip {
    display: grid;
    grid-template-columns: 1fr;
  }

  .content-section {
    padding: 16px 14px 18px;
  }

  .section-heading {
    margin-bottom: 18px;
  }

  .section-heading h2 {
    font-size: 24px;
  }

  .category-promo-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .books-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .auth-shell-page {
    padding-inline: 8px;
  }

  .auth-page-section.login-mode .auth-utility-nav {
    width: 100%;
  }

  .auth-card-public,
  .auth-page-section.register-mode .auth-card-public {
    padding: 20px 14px 18px;
    border-radius: 24px;
  }

  .auth-branding h1,
  .auth-page-section.register-mode .auth-branding h1 {
    font-size: 44px;
  }

  .auth-branding h2,
  .auth-page-section.register-mode .auth-branding h2 {
    font-size: 19px;
  }

  .hero-card {
    padding: 16px 12px 14px;
  }

  .hero-copy h1 {
    font-size: 25px;
  }

  .hero-stage {
    min-height: 208px;
  }

  .category-promo-grid {
    grid-template-columns: 1fr;
  }
}

/* Final storefront polish */
.hero-card {
  box-shadow: 0 24px 64px rgba(12, 9, 28, 0.3);
}

.hero-copy h1 {
  letter-spacing: 0;
}

.hero-highlight-card {
  backdrop-filter: blur(20px);
}

.value-item h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.content-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(11, 8, 22, 0.14);
}

.category-promo-grid {
  display: grid;
}

.category-promo-card {
  border-radius: 18px;
  min-height: 148px;
  box-shadow: 0 16px 32px rgba(12, 8, 26, 0.18);
}

.books-page {
  display: grid;
  gap: 18px;
}

.books-layout {
  align-items: start;
}

.filter-card {
  position: sticky;
  top: 18px;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(12, 8, 26, 0.18);
}

.books-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.books-heading h1 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.02;
}

.books-toolbar {
  box-shadow: 0 16px 32px rgba(10, 8, 18, 0.12);
}

.books-grid {
  gap: 18px;
}

.books-grid-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 14px 28px rgba(10, 8, 18, 0.12);
}

.books-grid-item .book-cover-card {
  text-align: left;
}

.books-grid-item .book-cover-frame {
  width: min(100%, 188px);
  margin: 0 auto;
}

.books-grid-item .book-meta {
  max-width: 100%;
}

.books-grid-item .book-meta h3 {
  font-size: 20px;
}

.books-grid-item .book-meta p {
  font-size: 12px;
  line-height: 1.5;
}

.book-admin-actions {
  margin-top: 14px;
  justify-content: stretch;
  gap: 10px;
}

.book-admin-actions > * {
  flex: 1 1 0;
}

.checkout-page {
  display: grid;
  gap: 18px;
}

.checkout-table-header {
  position: sticky;
  top: 16px;
  z-index: 6;
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(10, 8, 18, 0.12);
}

.checkout-list {
  display: grid;
  gap: 14px;
}

.checkout-row {
  box-shadow: 0 14px 30px rgba(10, 8, 18, 0.12);
}

.checkout-summary-card {
  box-shadow: 0 18px 38px rgba(10, 8, 18, 0.16);
}

.checkout-primary-btn,
.overlay-secondary-btn {
  min-height: 48px;
}

@media (min-width: 981px) {
  .hero-card {
    grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  }

  .content-section {
    border-radius: 22px;
  }

  .books-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .checkout-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .checkout-summary-card {
    align-items: start;
  }
}

@media (max-width: 980px) {
  .books-heading {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checkout-table-header {
    position: static;
  }
}

@media (max-width: 640px) {
  .hero-card {
    min-height: 0;
  }

  .value-item h3 {
    font-size: 14px;
  }

  .books-page {
    gap: 14px;
  }

  .books-grid-item {
    padding: 14px 12px;
    border-radius: 16px;
  }

  .books-grid-item .book-cover-card {
    align-items: flex-start;
  }

  .books-grid-item .book-meta h3 {
    font-size: 17px;
    line-height: 1.14;
  }

  .book-admin-actions {
    grid-template-columns: 1fr;
  }

  .checkout-table-header {
    display: none;
  }

  .checkout-row {
    gap: 12px;
  }

  .checkout-summary-card {
    padding: 18px 14px;
  }

  .summary-line {
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .books-grid {
    grid-template-columns: 1fr;
  }

  .books-grid-item .book-meta h3 {
    font-size: 16px;
  }

  .checkout-summary-card {
    border-radius: 14px;
  }
}

/* Final pass for storefront density */
.page-breadcrumb {
  min-height: 46px;
  padding: 0 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.hero-indicators {
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.hero-indicator {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
}

.hero-indicator.active {
  background: rgba(255, 255, 255, 0.92);
  transform: scale(1.14);
}

.book-row-grid {
  gap: 16px;
}

.book-row-grid .book-cover-card.compact .book-cover-frame {
  width: min(100%, 152px);
}

.book-row-grid .book-cover-card.compact .book-cover-image {
  border-radius: 14px;
}

.book-row-grid .book-cover-card.compact .book-meta {
  padding-top: 10px;
}

.book-row-grid .book-cover-card.compact .book-meta h3 {
  margin-top: 4px;
}

.newsletter-section {
  align-items: center;
  padding: 88px 0 64px;
}

.newsletter-copy p {
  margin: 12px 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.site-footer {
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px rgba(11, 8, 22, 0.06);
}

@media (min-width: 981px) {
  .hero-card {
    padding-right: 0;
  }

  .books-content {
    gap: 18px;
  }

  .books-grid-item {
    min-height: 100%;
  }

  .checkout-page {
    gap: 16px;
  }

  .checkout-table-header {
    margin-bottom: 8px;
  }

  .checkout-row {
    grid-template-columns: 1.7fr 0.7fr 0.55fr 0.78fr;
    border-radius: 16px;
  }

  .checkout-summary-card {
    margin-top: 12px;
    padding: 26px 28px;
    border-radius: 18px;
  }
}

@media (max-width: 980px) {
  .page-breadcrumb {
    margin-bottom: 14px;
  }

  .newsletter-section {
    display: grid;
    gap: 18px;
    padding: 64px 0 44px;
  }

  .newsletter-form {
    justify-content: stretch;
  }

  .newsletter-form input {
    width: 100%;
  }

  .site-footer {
    display: grid;
    gap: 24px;
    padding: 34px 24px 40px;
  }
}

@media (max-width: 640px) {
  .page-breadcrumb {
    min-height: 40px;
    padding: 0 14px;
    font-size: 13px;
  }

  .hero-indicators {
    margin-top: 8px;
  }

  .book-row-grid {
    gap: 12px;
    padding-bottom: 8px;
  }

  .book-row-grid .book-cover-card.compact .book-cover-frame {
    width: 100%;
  }

  .book-row-grid .book-cover-card.compact .book-meta h3 {
    font-size: 13px;
    line-height: 1.2;
  }

  .books-mobile-sticky {
    top: 8px;
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
  }

  .books-mobile-search-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .books-search,
  .cart-summary-btn {
    width: 100%;
  }

  .books-grid-item .book-buy-btn {
    width: 100%;
  }

  .checkout-page {
    gap: 12px;
  }

  .checkout-list {
    gap: 10px;
  }

  .checkout-row {
    gap: 10px;
    padding: 12px;
  }

  .checkout-item-cell {
    align-items: flex-start;
  }

  .checkout-item-cell div {
    min-width: 0;
  }

  .checkout-item-cell strong {
    font-size: 16px;
  }

  .checkout-price-cell,
  .checkout-total-cell {
    width: 100%;
  }

  .checkout-summary-card {
    margin-top: 0;
    padding: 16px 12px;
  }

  .summary-watermark {
    opacity: 0.18;
  }

  .newsletter-section {
    padding: 48px 0 32px;
  }

  .newsletter-copy h2 {
    font-size: 28px;
  }

  .newsletter-form,
  .footer-newsletter-form {
    display: grid;
    gap: 10px;
  }

  .newsletter-form button,
  .footer-newsletter-form button {
    width: 100%;
  }

  .site-footer {
    padding: 28px 18px 34px;
    border-radius: 18px 18px 0 0;
  }
}

@media (max-width: 640px) {
  .book-row-grid {
    grid-auto-columns: 170px;
    gap: 14px;
  }

  .book-row-grid .book-cover-card {
    width: 170px;
  }

  .book-row-grid .book-cover-card.compact {
    align-items: stretch;
    text-align: left;
  }

  .book-row-grid .book-cover-card.compact .book-cover-image {
    height: 210px;
  }

  .book-row-grid .book-cover-card.compact .book-meta {
    display: grid;
    gap: 4px;
    align-items: start;
    text-align: left;
  }

  .book-row-grid .book-cover-card.compact .book-category-label {
    font-size: 11px;
  }

  .book-row-grid .book-cover-card.compact .book-meta h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 36px;
    font-size: 16px;
    line-height: 1.14;
  }

  .book-row-grid .book-cover-card.compact .book-meta p {
    min-height: 16px;
    margin-bottom: 8px;
    font-size: 12px;
  }

  .book-row-grid .book-cover-card.compact .book-buy-btn {
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 0 12px;
  }

  .book-row-grid .book-cover-card.compact .book-buy-btn strong {
    font-size: 14px;
  }

  .book-row-grid .book-cover-card.compact .book-buy-btn small {
    font-size: 11px;
  }

  .newsletter-copy {
    max-width: none;
  }
}

@media (max-width: 420px) {
  .book-row-grid {
    grid-auto-columns: 156px;
  }

  .book-row-grid .book-cover-card {
    width: 156px;
  }

  .book-row-grid .book-cover-card.compact .book-cover-image {
    height: 194px;
  }

  .book-row-grid .book-cover-card.compact .book-meta h3 {
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 12px 10px 0;
  }

  .header-inner {
    min-height: 64px;
    padding: 0 14px;
    border-radius: 18px;
  }

  .brand {
    gap: 10px;
    font-size: 16px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .mobile-menu-trigger {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .site-main {
    padding: 0 10px 28px;
  }

  .hero-card {
    gap: 14px;
    min-height: 0;
    margin-top: 8px;
  }

  .hero-copy h1 {
    max-width: none;
    font-size: 24px;
  }

  .hero-copy p {
    font-size: 12px;
    line-height: 1.5;
  }

  .hero-cta-btn {
    width: 100%;
    min-height: 44px;
  }

  .hero-stage {
    min-height: 198px;
  }

  .hero-highlight-card {
    left: 12px;
    bottom: 12px;
    width: 118px;
    padding: 10px;
    border-radius: 14px;
  }

  .hero-highlight-card strong {
    font-size: 13px;
  }

  .content-section {
    gap: 0;
  }

  .section-heading h2,
  .home-section .section-heading h2 {
    font-size: 20px;
    line-height: 1.06;
  }

  .books-heading h1 {
    font-size: 20px;
    line-height: 1.06;
  }

  .books-heading p {
    font-size: 11px;
    line-height: 1.45;
  }

  .books-mobile-chip,
  .books-mobile-toggle {
    min-height: 36px;
    padding: 0 10px;
    font-size: 11px;
  }

  .books-mobile-chip small {
    font-size: 10px;
  }

  .newsletter-section {
    gap: 14px;
  }

  .newsletter-copy h2 {
    font-size: 22px;
    line-height: 1.08;
  }

  .newsletter-form input,
  .footer-newsletter-form input,
  .footer-subscribe input {
    min-height: 46px;
  }

  .newsletter-form button,
  .footer-newsletter-form button,
  .footer-subscribe button {
    min-height: 46px;
  }

  .site-footer {
    gap: 18px;
  }

  .footer-brand p,
  .footer-subscribe p {
    font-size: 11px;
    line-height: 1.55;
  }

  .social-row {
    margin-top: 12px;
    gap: 10px;
  }

  .social-row span {
    width: 34px;
    height: 34px;
    font-size: 10px;
  }
}

@media (max-width: 420px) {
  .site-main {
    padding: 0 8px 24px;
  }

  .header-inner {
    padding: 0 12px;
  }

  .hero-copy h1 {
    font-size: 22px;
  }

  .hero-stage {
    min-height: 184px;
  }

  .books-mobile-sticky {
    padding: 8px;
  }

  .newsletter-copy h2 {
    font-size: 20px;
  }
}

@media (max-width: 640px) {
  .books-mobile-sticky {
    top: 6px;
    margin-bottom: 12px;
    background: rgba(18, 13, 33, 0.9);
  }

  .book-row-grid .book-cover-card.compact {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    align-content: start;
    gap: 0;
    min-width: 0;
    overflow: hidden;
  }

  .book-row-grid .book-cover-card.compact .book-cover-frame {
    width: 100%;
    min-width: 0;
  }

  .book-row-grid .book-cover-card.compact .book-meta {
    width: 100%;
    min-width: 0;
    padding-top: 10px;
    overflow: hidden;
  }

  .book-row-grid .book-cover-card.compact .book-category-label,
  .book-row-grid .book-cover-card.compact .book-meta h3,
  .book-row-grid .book-cover-card.compact .book-meta p {
    max-width: 100%;
    overflow: hidden;
  }

  .book-row-grid .book-cover-card.compact .book-meta h3 {
    word-break: break-word;
    text-wrap: balance;
  }

  .book-row-grid .book-cover-card.compact .book-buy-btn {
    margin-top: 6px;
    overflow: hidden;
  }

  .book-row-grid .book-cover-card.compact .book-buy-btn strong,
  .book-row-grid .book-cover-card.compact .book-buy-btn small {
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .books-mobile-sticky {
    margin-bottom: 10px;
  }

  .book-row-grid .book-cover-card.compact .book-meta h3 {
    min-height: 34px;
  }
}

/* Responsive layout consolidation */
html {
  overflow-x: hidden;
}

body,
#root,
.page-shell {
  width: 100%;
  min-width: 0;
  overflow-x: clip;
}

button,
input,
textarea,
select {
  max-width: 100%;
}

.hero-card,
.value-strip,
.content-section,
.category-promo-grid,
.books-page,
.checkout-page,
.account-page,
.admin-page,
.newsletter-section,
.site-footer {
  width: min(100%, 1280px);
  margin-inline: auto;
}

@media (min-width: 1440px) {
  .site-main {
    padding-inline: 40px;
  }

  .header-inner {
    max-width: 1280px;
  }

  .hero-card {
    min-height: 540px;
  }
}

@media (max-width: 980px) {
  .site-header {
    padding-inline: 18px;
  }

  .site-main {
    padding-inline: 18px;
  }

  .header-inner {
    padding-inline: 20px;
  }

  .main-nav,
  .header-actions {
    display: none;
  }

  .mobile-menu-trigger {
    display: block;
  }

  .mobile-menu-sheet.open {
    display: block;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
  }

  .header-inner {
    position: relative;
  }

  .hero-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 40px;
  }

  .hero-copy {
    max-width: 680px;
  }

  .hero-stage {
    width: 100%;
    min-height: 360px;
  }

  .value-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-section,
  .newsletter-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .category-promo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .books-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-card,
  .books-heading .books-toolbar {
    display: none;
  }

  .books-mobile-sticky {
    display: grid;
  }

  .site-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-shell {
    width: min(100%, 680px);
    min-height: auto;
    margin-inline: auto;
  }
}

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
  }

  .site-header {
    padding: 10px 10px 0;
  }

  .site-main {
    padding: 0 10px 32px;
  }

  .header-inner {
    min-height: 60px;
    padding-inline: 14px;
  }

  .mobile-menu-sheet.open {
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
  }

  .mobile-menu-link,
  .mobile-menu-actions button {
    min-height: 44px;
  }

  .hero-card {
    gap: 20px;
    padding: 24px 18px 20px;
    border-radius: 20px;
  }

  .hero-copy h1 {
    font-size: clamp(28px, 9vw, 38px);
    line-height: 1.06;
  }

  .hero-copy p {
    font-size: 14px;
  }

  .hero-stage {
    min-height: 240px;
  }

  .value-strip {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .value-item {
    min-height: 0;
    padding: 14px;
  }

  .content-section {
    padding: 22px 14px;
    border-radius: 18px;
  }

  .section-heading h2,
  .home-section .section-heading h2,
  .books-heading h1 {
    font-size: 24px;
  }

  .book-row-grid {
    width: calc(100% + 14px);
    margin-right: -14px;
    padding-right: 14px;
    scroll-padding-inline: 14px;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .book-row-grid::-webkit-scrollbar {
    display: none;
  }

  .category-promo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .category-card {
    min-width: 0;
  }

  .books-mobile-sticky {
    position: sticky;
    top: 8px;
    z-index: 12;
  }

  .books-mobile-search-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .books-search,
  .cart-summary-btn,
  .books-mobile-toggle {
    min-height: 44px;
  }

  .books-mobile-filter-scroller {
    scrollbar-width: none;
  }

  .books-mobile-filter-scroller::-webkit-scrollbar {
    display: none;
  }

  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .books-grid-item {
    min-width: 0;
    padding: 12px 10px;
  }

  .books-grid-item .book-cover-frame,
  .books-grid-item .book-cover-image {
    width: 100%;
  }

  .books-grid-item .book-cover-image {
    aspect-ratio: 2 / 3;
    height: auto;
    object-fit: cover;
  }

  .books-grid-item .book-meta h3 {
    display: -webkit-box;
    min-height: 38px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 16px;
  }

  .books-grid-item .book-meta p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .checkout-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .checkout-item-cell {
    grid-column: 1 / -1;
  }

  .checkout-item-cell img {
    flex: 0 0 64px;
    width: 64px;
    height: 92px;
    object-fit: cover;
  }

  .checkout-qty-cell {
    justify-self: start;
  }

  .checkout-qty-cell button {
    width: 42px;
    height: 42px;
  }

  .checkout-price-cell {
    display: none;
  }

  .checkout-total-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
  }

  .checkout-summary-card {
    width: 100%;
  }

  .checkout-primary-btn,
  .overlay-secondary-btn {
    width: 100%;
    min-height: 48px;
  }

  .newsletter-section {
    padding: 42px 14px 34px;
  }

  .site-footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-shell-page {
    align-items: flex-start;
    min-height: 100dvh;
    padding: 12px;
  }

  .auth-utility-nav {
    position: static;
    width: 100%;
    margin-bottom: 12px;
  }

  .auth-card-public {
    width: 100%;
    min-height: auto;
    padding: 28px 18px;
    border-radius: 22px;
  }

  .auth-branding h1 {
    font-size: 40px;
  }

  .auth-form input,
  .auth-submit-btn {
    min-height: 48px;
  }
}

@media (max-width: 420px) {
  .brand span:last-child {
    font-size: 15px;
  }

  .hero-card {
    padding-inline: 14px;
  }

  .hero-copy h1 {
    font-size: 27px;
  }

  .hero-stage {
    min-height: 210px;
  }

  .category-promo-grid,
  .books-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .books-grid-item {
    padding: 16px;
  }

  .books-grid-item .book-cover-frame {
    width: min(100%, 220px);
  }

  .checkout-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .checkout-total-cell {
    justify-content: space-between;
  }

  .auth-branding h1 {
    font-size: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Visual quality pass: desktop and mobile */
:root {
  --surface-glass: rgba(25, 19, 43, 0.82);
  --surface-glass-strong: rgba(17, 14, 30, 0.94);
  --surface-light: #fbf9ff;
  --surface-light-muted: #f1ebf7;
  --focus-ring: #f3a7ff;
  --shadow-card: 0 18px 44px rgba(8, 6, 18, 0.22);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

body {
  background:
    radial-gradient(circle at 8% 16%, rgba(202, 67, 210, 0.48), transparent 24%),
    radial-gradient(circle at 88% 36%, rgba(72, 53, 245, 0.42), transparent 26%),
    radial-gradient(circle at 68% 82%, rgba(174, 70, 202, 0.32), transparent 24%),
    linear-gradient(180deg, #0f0e19 0%, #18132d 48%, #2b1c46 100%);
}

:where(button, a, input, textarea, select):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

:where(button, a, input, textarea, select) {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease,
    box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.header-inner {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
}

.brand-mark {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.nav-link {
  position: relative;
  min-height: 40px;
  padding-inline: 5px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.nav-link::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  content: "";
  opacity: 0;
  transform: scaleX(0.55);
  transition: inherit;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
}

.nav-link:hover::after,
.nav-link.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.header-primary-btn,
.auth-submit-btn,
.admin-primary-btn,
.checkout-primary-btn,
.newsletter-form button,
.footer-subscribe button {
  min-height: 46px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(151, 42, 207, 0.28);
}

.header-primary-btn:hover,
.auth-submit-btn:hover,
.admin-primary-btn:hover,
.checkout-primary-btn:hover,
.newsletter-form button:hover,
.footer-subscribe button:hover {
  box-shadow: 0 16px 34px rgba(176, 55, 224, 0.38);
  transform: translateY(-2px);
}

.hero-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 78% 38%, rgba(150, 50, 222, 0.32), transparent 34%),
    linear-gradient(135deg, rgba(25, 18, 44, 0.98), rgba(43, 20, 70, 0.9));
  box-shadow: var(--shadow-card);
}

.hero-copy h1 {
  text-wrap: balance;
}

.hero-copy p,
.newsletter-copy p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
}

.value-strip,
.content-section,
.books-grid-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.065);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
}

.value-item h3,
.book-meta h3,
.section-heading h2,
.books-heading h1 {
  color: #fff;
}

.value-item p,
.book-meta p,
.books-heading p {
  color: rgba(255, 255, 255, 0.72);
}

.book-cover-card {
  min-width: 0;
}

.book-cover-frame {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 30px rgba(8, 6, 18, 0.28);
}

.book-cover-image {
  transition: transform 220ms ease, filter 220ms ease;
}

.book-cover-card:hover .book-cover-image {
  filter: saturate(1.06) contrast(1.02);
  transform: scale(1.025);
}

.book-category-label {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
}

.book-buy-btn {
  min-height: 44px;
  border-radius: var(--radius-sm);
}

.book-buy-btn:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.13);
  transform: translateY(-2px);
}

.category-card {
  overflow: hidden;
  min-height: 108px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 30px rgba(8, 6, 18, 0.16);
}

.category-card:hover {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 18px 36px rgba(8, 6, 18, 0.25);
  transform: translateY(-3px);
}

.books-search,
.newsletter-form input,
.footer-subscribe input,
.auth-form input,
.admin-form input,
.admin-form textarea,
.account-password-form input {
  border-radius: var(--radius-sm);
}

.books-search::placeholder,
.newsletter-form input::placeholder,
.auth-form input::placeholder {
  opacity: 0.76;
}

.filter-card,
.books-mobile-sticky {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--surface-glass-strong);
  backdrop-filter: blur(22px);
}

.checkout-row,
.checkout-summary-card {
  border-radius: var(--radius-md);
}

.checkout-row {
  border: 1px solid rgba(25, 18, 43, 0.1);
}

.site-footer {
  color: rgba(255, 255, 255, 0.78);
  background: linear-gradient(135deg, rgba(17, 14, 30, 0.98), rgba(35, 20, 53, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.site-footer h2,
.site-footer h3,
.site-footer strong,
.site-footer .brand {
  color: #fff;
}

.site-footer p,
.site-footer a,
.site-footer button:not(.footer-subscribe button) {
  color: rgba(255, 255, 255, 0.72);
}

.site-footer a:hover,
.site-footer button:not(.footer-subscribe button):hover {
  color: #fff;
}

@media (hover: none) {
  .book-cover-card:hover .book-cover-image,
  .category-card:hover,
  .book-buy-btn:hover,
  .header-primary-btn:hover,
  .auth-submit-btn:hover,
  .checkout-primary-btn:hover {
    transform: none;
  }
}

@media (max-width: 640px) {
  .hero-card {
    background:
      radial-gradient(circle at 82% 75%, rgba(147, 55, 217, 0.28), transparent 34%),
      linear-gradient(145deg, rgba(24, 18, 43, 0.99), rgba(43, 22, 68, 0.96));
  }

  .hero-copy p {
    font-size: 14px;
  }

  .hero-stage {
    max-height: 260px;
    overflow: hidden;
  }

  .hero-book-stack-back {
    opacity: 0.55;
  }

  .books-mobile-sticky {
    max-height: min(238px, 34dvh);
    overflow-y: auto;
    box-shadow: 0 14px 30px rgba(7, 5, 15, 0.3);
  }

  .books-mobile-filter-scroller {
    flex: 0 0 auto;
  }

  .book-row-grid::after {
    display: block;
    width: 4px;
    content: "";
  }

  .checkout-remove-btn {
    min-height: 38px;
    padding-inline: 12px;
    border-radius: 9px;
  }

  .site-footer {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .books-grid-item {
    width: 100%;
  }

  .books-grid-item .book-cover-frame {
    width: min(68vw, 230px);
  }

  .books-grid-item .book-meta {
    text-align: center;
  }

  .books-grid-item .book-meta h3 {
    min-height: 0;
  }

  .hero-stage {
    min-height: 190px;
    max-height: 220px;
  }

  .hero-highlight-card {
    width: min(118px, 38vw);
  }

  .newsletter-section,
  .site-footer,
  .content-section {
    padding-inline: 14px;
  }
}

/* Mobile carousel fix: old explicit grid columns caused cards to overlap */
@media (max-width: 640px) {
  .book-row-grid {
    display: flex;
    grid-template-columns: none;
    grid-auto-flow: initial;
    grid-auto-columns: initial;
    align-items: stretch;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .book-row-grid > .book-cover-card,
  .book-row-grid > .book-cover-card.compact {
    flex: 0 0 170px;
    width: 170px;
    max-width: 170px;
  }

  .book-row-grid .book-cover-card.compact .book-meta {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
  }

  .book-row-grid .book-cover-card.compact .book-buy-btn {
    margin-top: auto;
  }

  .book-row-grid::after {
    flex: 0 0 1px;
  }
}

@media (max-width: 420px) {
  .book-row-grid > .book-cover-card,
  .book-row-grid > .book-cover-card.compact {
    flex-basis: 156px;
    width: 156px;
    max-width: 156px;
  }
}

/* Mobile width containment: prevent desktop widths from clipping text */
@media (max-width: 640px) {
  .content-shell,
  .hero-card,
  .hero-copy,
  .hero-visual,
  .hero-stage,
  .value-strip,
  .value-item,
  .content-section,
  .section-heading,
  .newsletter-section,
  .newsletter-copy,
  .site-footer,
  .footer-brand,
  .footer-links,
  .footer-subscribe {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .hero-copy {
    padding-top: 0;
  }

  .hero-copy h1,
  .hero-copy p,
  .value-item h3,
  .value-item strong,
  .value-item p,
  .section-heading h2,
  .newsletter-copy h2,
  .newsletter-copy p,
  .footer-brand p,
  .footer-links a,
  .footer-subscribe p {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .hero-cta-btn {
    width: 100%;
    min-width: 0;
    padding-inline: 14px;
    white-space: normal;
  }

  .value-strip {
    overflow: hidden;
  }

  .value-item {
    overflow: hidden;
    text-align: left;
  }
}
/* Keep the checkout totals in one vertical column. Older layout rules made
   every label/value/button a separate grid cell and caused the block to drift. */
.checkout-summary-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.checkout-summary-card > h2,
.checkout-summary-card > .summary-line,
.checkout-summary-card > button {
  position: relative;
  z-index: 1;
  width: 100%;
}

@media (min-width: 981px) {
  .checkout-table-header,
  .checkout-row {
    grid-template-columns: minmax(280px, 1.5fr) minmax(150px, 0.7fr) minmax(110px, 0.5fr) minmax(130px, 0.7fr);
  }
}
