:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #12263f;
  --muted: #58708c;
  --accent: #0a7a6a;
  --accent-2: #ffb703;
  --danger: #d64045;
  --ring: rgba(10, 122, 106, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "Trebuchet MS", "Verdana", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 20% 10%, #ddeeff 0, transparent 35%),
    radial-gradient(circle at 80% 90%, #fff0d0 0, transparent 30%),
    var(--bg);
}

.top {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: linear-gradient(110deg, #0f2540, #214a73);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-wordmark {
  width: 112px;
  height: auto;
  display: block;
  margin-bottom: 2px;
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
}

.brand p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  opacity: 0.85;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-inline-form {
  margin: 0;
}

.nav-item {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 12px;
  border-radius: 10px;
  transition: 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.2);
}

.nav-item-btn {
  appearance: none;
  font: inherit;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
}

.badge {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  border-radius: 999px;
  background: #fff;
  color: #1a2f49;
  padding: 1px 7px;
  font-size: 0.78rem;
  margin-left: 4px;
}

.badge-danger {
  background: #d64045;
  color: #fff;
}

.login-trigger {
  color: #173252;
  text-decoration: none;
  font-weight: 700;
  background: #f7c34f;
  border: 1px solid #ffc74f;
  padding: 8px 14px;
  border-radius: 10px;
}

.account-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-pill {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 0.9rem;
}

.ghost-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #fff;
  padding: 8px 11px;
}

.hero {
  width: 100%;
  max-width: 1200px;
  margin: 22px auto 0;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.hero-content {
  grid-column: span 2;
  width: 100%;
  background: linear-gradient(130deg, #214a73, #0a7a6a);
  color: #fff;
  border-radius: 18px;
  padding: 26px;
}

.hero-content h2 {
  margin: 4px 0 10px;
  font-size: 2rem;
}

.hero-content p {
  margin: 0;
  opacity: 0.95;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  opacity: 0.8;
}

.search-card {
  grid-column: span 1;
  width: 100%;
  background: var(--panel);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(22, 47, 77, 0.08);
  border: 1px solid #e8eef5;
}

.search-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 8px;
}

.more-filters {
  margin-top: 10px;
}

.more-filters summary {
  cursor: pointer;
  font-weight: 700;
  color: #214a73;
  user-select: none;
}

.more-filters[open] summary {
  margin-bottom: 4px;
}

.filters-grid input,
.filters-grid select {
  width: 100%;
}

.price-range-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.price-range-row label {
  font-size: 0.82rem;
  color: var(--muted);
}

.search-suggest {
  display: none;
  border: 1px solid #d5e2ee;
  border-radius: 10px;
  margin-top: 6px;
  max-height: 220px;
  overflow: auto;
}

.search-suggest.open {
  display: block;
}

.suggest-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: #163654;
  padding: 8px 10px;
  border-bottom: 1px solid #ebf1f7;
}

.suggest-item:last-child {
  border-bottom: 0;
}

.suggest-item small {
  color: #617c96;
}

.catalog-wrap {
  max-width: 1200px;
  margin: 18px auto 26px;
  padding: 0 16px;
}

.wrap {
  max-width: 1200px;
  margin: 18px auto 26px;
  padding: 0 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid #e8eef5;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 16px rgba(14, 38, 64, 0.05);
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.panel-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

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

.book-card {
  border: 1px solid #e5edf5;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: grid;
  grid-template-columns: 128px 1fr;
  min-height: 190px;
}

.book-cover {
  background: linear-gradient(160deg, #f0f5fb, #dae9f8);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-cover.no-cover {
  background: #eef3f9;
}

.availability {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 0.7rem;
  border-radius: 99px;
  padding: 4px 8px;
  font-weight: 600;
}

.availability.ok {
  background: #ddf8f2;
  color: #0a6f60;
}

.availability.ko {
  background: #ffe3e5;
  color: #af1f31;
}

.book-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.book-body h4 {
  margin: 0;
  line-height: 1.25;
}

.book-body h4 a {
  color: inherit;
  text-decoration: none;
}

.book-ref {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.book-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.cart-book-detail {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 3px;
}

.stock-label {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  padding: 4px 7px;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 6px;
  gap: 6px;
}

.stock-label.ok {
  background: #ddf8f2;
  color: #0a6f60;
}

.stock-label.warn {
  background: #fff3c4;
  color: #7a5600;
}

.stock-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border-radius: 50%;
  background: #7a5600;
  color: #fff;
  font-size: 0.72rem;
  line-height: 1;
  cursor: help;
}

.stock-help::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: 230px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #173252;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 8px 18px rgba(10, 30, 50, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 5;
}

.stock-help:hover::after,
.stock-help:focus::after {
  opacity: 1;
}

.price {
  margin: 0;
  color: #0c5a52;
  font-weight: 700;
}

.add-form {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.stack-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

input,
select,
button,
.cta-link {
  border-radius: 10px;
  border: 1px solid #d6e1ec;
  padding: 9px 10px;
  font-size: 0.95rem;
}

input {
  width: 100%;
  margin-top: 4px;
}

input:focus,
select:focus {
  outline: 3px solid var(--ring);
  border-color: var(--accent);
}

button,
.cta-link {
  background: linear-gradient(135deg, #0a7a6a, #0e8f7b);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

button:hover,
.cta-link:hover {
  filter: brightness(1.05);
}

button:disabled {
  background: #b8c3cf;
  border-color: #b8c3cf;
  cursor: not-allowed;
}

.muted {
  color: var(--muted);
  margin: 0 0 8px;
}

.order-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.order-status.paid {
  background: #ddf8f2;
  color: #0a6f60;
}

.order-status.processing {
  background: #fff0d8;
  color: #a35e00;
}

.order-status.failed {
  background: #ffe3e5;
  color: #af1f31;
}

.order-status.pending {
  background: #edf2fa;
  color: #3c5a76;
}

.order-flag-new {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #d64045;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}

.inline-form {
  display: inline-flex;
  margin-right: 6px;
}

.inline-form button {
  padding: 6px 9px;
  font-size: 0.82rem;
}

.danger-btn {
  background: linear-gradient(135deg, #c7393c, #a61f30);
  border-color: #a61f30;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #0f4f78;
  font-weight: 700;
  margin-right: 8px;
  font-size: 0.86rem;
}

.book-detail-panel {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.book-detail-cover {
  background: #edf3fa;
  border: 1px solid #e0eaf5;
  border-radius: 12px;
  min-height: 380px;
  overflow: hidden;
}

.book-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-detail-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.book-info-table {
  width: 100%;
  max-width: 520px;
  border-collapse: collapse;
  margin: 2px 0 8px;
}

.book-info-table th,
.book-info-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5edf5;
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

.book-info-table th {
  width: 170px;
  color: #284560;
  font-weight: 700;
}

.book-info-table td {
  color: #536b84;
}

.book-summary-section {
  grid-column: 1 / -1;
  border-top: 1px solid #e5edf5;
  padding-top: 16px;
}

.book-summary-section p {
  margin: 0;
  color: #284560;
  line-height: 1.7;
}

.about-hero-panel {
  background: linear-gradient(135deg, #173b63, #0a7a6a);
  color: #fff;
}

.about-hero-panel h2 {
  font-size: 2rem;
  margin-bottom: 14px;
}

.about-hero-panel p {
  max-width: 840px;
  line-height: 1.75;
}

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

.about-section h3 {
  margin-bottom: 10px;
}

.about-section p {
  margin: 0;
  line-height: 1.75;
  color: #284560;
}

.about-section p + p {
  margin-top: 12px;
}

.about-list {
  margin: 0;
  padding-left: 18px;
  color: #284560;
  line-height: 1.75;
}

.about-list li + li {
  margin-top: 8px;
}

.about-section p + p {
  margin-top: 12px;
}

.about-list {
  margin: 0;
  padding-left: 18px;
  color: #284560;
  line-height: 1.75;
}

.about-list li + li {
  margin-top: 8px;
}

.about-leadership {
  margin-top: 16px;
}

.about-leadership-copy p {
  line-height: 1.75;
}

.about-contact {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e5edf5;
}

.about-contact p {
  margin: 6px 0;
}

.about-contact {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e5edf5;
}

.about-contact p {
  margin: 6px 0;
}

.book-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.book-media-section {
  grid-column: 1 / -1;
  border-top: 1px solid #e8eef5;
  padding-top: 18px;
}

.book-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.media-card {
  border: 1px solid #e5edf5;
  border-radius: 14px;
  background: #fbfdff;
  overflow: hidden;
}

.media-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e5edf5;
}

.media-card-head h4 {
  margin: 0;
}

.media-caption {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.media-preview {
  width: 100%;
  height: 340px;
  border: 0;
  display: block;
  background: #eef3f9;
}

.video-preview {
  background: #0f2540;
}

.shipping-summary {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #e5edf5;
  border-radius: 12px;
  background: #f8fbff;
}

.shipping-summary p {
  margin: 4px 0;
}

.billing-box {
  margin: -6px 0 18px;
  padding: 0 2px;
}

.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #284560;
}

.billing-toggle input {
  width: auto;
  margin: 0;
}

.billing-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #e5edf5;
  border-radius: 12px;
  background: #fbfdff;
}

.billing-fields[hidden] {
  display: none;
}

.billing-fields label {
  display: block;
  font-weight: 700;
}

.billing-span-2 {
  grid-column: span 2;
}

.promo-box {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #e5edf5;
  border-radius: 12px;
  background: #f8fbff;
}

.promo-box h3 {
  margin: 0 0 10px;
}

.promo-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.promo-form input {
  flex: 1 1 240px;
}

.promo-active {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: #0f4f78;
  font-weight: 600;
}

.promo-feedback {
  margin: 10px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.promo-feedback.ok {
  color: #0a6f60;
}

.promo-feedback.err {
  color: #af1f31;
}

.promo-line {
  color: #0a6f60;
}

.profile-panel {
  max-width: 760px;
}

.profile-form {
  margin-top: 12px;
}

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

.profile-span-2 {
  grid-column: span 2;
}

.profile-readonly {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #e8eef5;
  border-radius: 12px;
  background: #fbfdff;
}

.profile-row span {
  color: var(--muted);
}

.profile-row strong {
  text-align: right;
}

.profile-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(11, 24, 42, 0.7);
}

.profile-modal-overlay.active {
  display: flex;
}

.profile-modal {
  width: min(100%, 720px);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #d9e5f0;
  border-radius: 16px;
  box-shadow: 0 20px 44px rgba(7, 24, 40, 0.28);
  padding: 18px;
}

.profile-modal-head {
  margin-bottom: 12px;
}

.profile-modal-head h3 {
  margin: 0 0 6px;
}

.profile-modal-head p {
  margin: 0;
  color: var(--muted);
}

.secondary-link {
  background: #eef4fb;
  border-color: #d6e2ef;
  color: #153554;
}

.summary-status {
  margin: 0;
  color: #58708c;
  font-size: 0.92rem;
}

.flash {
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
}

.flash.ok {
  background: #dff8ec;
  color: #0a6f60;
}

.flash.err {
  background: #ffe5e7;
  color: #a5202f;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.orders-table {
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid #e8eef5;
  padding: 10px 8px;
  text-align: left;
}

.cart-remove-cell {
  width: 44px;
  text-align: right;
}

.remove-item-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  background: #fff;
  border: 1px solid #d8e4ef;
  color: #6d7f92;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.remove-item-btn:hover {
  color: #af1f31;
  border-color: #efc4cb;
  background: #fff5f6;
}

.remove-item-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.total-line {
  margin: 14px 0 8px;
}

.cart-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cgv-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
  line-height: 1.4;
}

.cgv-line input {
  width: auto;
  margin-top: 2px;
}

.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.search-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 24, 42, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 74px 26px 20px;
  z-index: 25;
}

.auth-modal {
  position: relative;
  width: 390px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #dfe8f1;
  box-shadow: 0 20px 44px rgba(9, 28, 48, 0.26);
  overflow: hidden;
}

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}

.auth-head-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-head-title img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.auth-head h3 {
  margin: 0;
}

.close-auth {
  text-decoration: none;
  color: #3e546b;
  font-size: 1.6rem;
  line-height: 1;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid #e5edf5;
}

.tab-btn {
  background: #f8fbff;
  color: #35506a;
  border: 0;
  border-radius: 0;
  border-right: 1px solid #e5edf5;
  padding: 11px 8px;
  font-size: 0.84rem;
}

.tab-btn:last-child {
  border-right: 0;
}

.tab-btn.active {
  background: #fff;
  color: #0f2942;
  box-shadow: inset 0 -3px 0 #0a7a6a;
}

.tab-panel {
  display: none;
  padding: 14px 16px 16px;
}

.tab-panel.active {
  display: block;
}

.switch-text {
  color: #56718c;
  margin: 10px 0 0;
  font-size: 0.9rem;
}

.auth-help-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 0;
}

.auth-step-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 24, 42, 0.68);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 26;
}

.auth-step-overlay.active {
  display: flex;
}

.auth-overlay.step-open {
  justify-content: center;
  padding: 0;
}

.auth-overlay.step-open .auth-modal {
  display: none;
}

.auth-step-panel {
  display: none;
  width: min(100%, 320px);
  background: #fff;
  border: 1px solid #dfe8f1;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 18px 36px rgba(7, 24, 40, 0.24);
}

.auth-step-panel.active {
  display: block;
}

body.modal-open {
  overflow: hidden;
}

.auth-step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.cgv-box {
  padding: 14px 16px;
  border: 1px solid #dce7f2;
  border-radius: 14px;
  background: #f8fbff;
}

.cgv-summary {
  margin: 0 0 10px;
  color: #35506a;
}

.cgv-trigger-line {
  margin-bottom: 10px;
}

.cgv-status {
  align-self: center;
  font-size: 0.95rem;
  color: #a13f3f;
}

.cgv-status.ok {
  color: #0a7a6a;
}

.secondary-btn {
  background: #eef4fb;
  color: #173b63;
  border: 1px solid #cddceb;
}

.cgv-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(11, 24, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.cgv-modal-overlay[hidden] {
  display: none !important;
}

.cgv-modal {
  width: min(100%, 920px);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #d9e5f0;
  box-shadow: 0 20px 44px rgba(7, 24, 40, 0.28);
  overflow: hidden;
}

.cgv-modal-head,
.cgv-modal-foot {
  padding: 16px 18px;
  border-bottom: 1px solid #e5edf5;
}

.cgv-modal-foot {
  border-bottom: 0;
  border-top: 1px solid #e5edf5;
}

.cgv-modal-foot .cart-actions {
  justify-content: flex-end;
}

.cgv-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.cgv-modal-head h3,
.cgv-modal-head p {
  margin: 0;
}

.cgv-modal-head p {
  margin-top: 4px;
  color: #5a738e;
}

.cgv-modal-body {
  min-height: 0;
  overflow: hidden;
  background: #f4f7fb;
}

.cgv-document-frame {
  height: min(64vh, 680px);
  overflow: hidden;
  border-bottom: 1px solid #e5edf5;
  background: #f4f7fb;
}

.cgv-document {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #f4f7fb;
}

.cgv-download-line {
  margin: 0;
  padding: 10px 18px 12px;
  background: #fbfdff;
  line-height: 1.35;
}

.auth-step-head h4 {
  margin: 0;
  font-size: 1rem;
}

.close-step {
  background: transparent;
  border: 0;
  color: #4c6278;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
}

.close-step:hover {
  filter: none;
  color: #0f2942;
}

.auth-step-copy {
  margin: 0 0 14px;
  color: #56718c;
  line-height: 1.5;
}

.inline-reset-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #dbe6f1;
}

.text-btn {
  border: 0;
  background: transparent;
  color: #0d7a6b;
  padding: 0;
  font-weight: 700;
  cursor: pointer;
}

.catalog-panel {
  min-height: 420px;
}

.pagination {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination a {
  text-decoration: none;
  color: #0e3a5b;
  border: 1px solid #d5e1ec;
  background: #fff;
  padding: 7px 11px;
  border-radius: 8px;
  font-weight: 600;
}

.pagination a.disabled {
  pointer-events: none;
  opacity: 0.45;
}

.pagination span {
  color: #48617c;
  font-size: 0.92rem;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.page-jump label {
  color: #48617c;
  font-size: 0.88rem;
}

.page-jump input {
  width: 84px;
  margin-top: 0;
}

.page-jump button {
  padding: 7px 10px;
}

.site-footer {
  margin-top: auto;
  padding: 20px 16px 26px;
  background: #0f2540;
  color: #d9e8f7;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.footer-brand {
  margin-top: 18px;
  display: inline-flex;
  align-items: flex-end;
}

.footer-brand img {
  width: 115px;
  height: auto;
  opacity: 0.95;
}

.footer-col h4 {
  margin: 0 0 8px;
  color: #fff;
}

.footer-title-link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-col p {
  margin: 4px 0;
  font-size: 0.9rem;
}

.site-footer a {
  color: #9fdcff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer .footer-title-link {
  color: #fff;
  text-underline-offset: 3px;
}

.site-footer a:hover,
.site-footer a:focus {
  color: #ffffff;
}

.floating-checkout-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 8px;
  background: #f7c34f;
  border: 1px solid #ffc74f;
  color: #173252;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(10, 30, 50, 0.22);
}

.floating-checkout-btn:hover,
.floating-checkout-btn:focus {
  background: #ffd166;
  color: #173252;
}

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 45;
  background: #ffffff;
  border: 1px solid #d7e4ef;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(10, 30, 50, 0.2);
  padding: 12px 230px 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  margin: 0;
  color: #26435f;
  font-size: 0.92rem;
}

.cookie-actions {
  display: flex;
  gap: 8px;
}

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

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

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

@media (max-width: 720px) {
  body {
    font-size: 0.88rem;
  }

  .top {
    padding: 8px 8px 9px;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 7px;
    overflow: hidden;
  }

  .brand {
    gap: 6px;
    width: 100%;
    justify-content: center;
  }

  .brand-logo-link {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .brand-logo {
    width: 24px;
    height: 24px;
  }

  .brand-wordmark {
    width: 70px;
    margin-bottom: 0;
  }

  .brand p {
    display: none;
  }

  .nav-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    align-items: stretch;
    justify-self: stretch;
    overflow: visible;
    flex-wrap: initial;
    padding-bottom: 0;
  }

  .nav-item,
  .login-trigger,
  .ghost-btn {
    justify-content: center;
    min-width: 0;
    padding: 5px 4px;
    border-radius: 7px;
    font-size: 0.66rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    gap: 4px;
    line-height: 1;
  }

  .nav-item svg {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
  }

  .badge {
    min-width: 15px;
    padding: 0 4px;
    font-size: 0.62rem;
    margin-left: 1px;
  }

  .account-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .account-pill {
    display: none;
  }

  .account-box .ghost-btn {
    width: 100%;
  }

  .nav-inline-form {
    min-width: 0;
  }

  .nav-inline-form .nav-item {
    width: 100%;
  }

  .login-trigger {
    display: inline-flex;
    align-items: center;
    grid-column: 1 / -1;
    justify-self: end;
    padding-left: 9px;
    padding-right: 9px;
  }

  .hero {
    margin-top: 8px;
    padding: 0 7px;
    gap: 7px;
  }

  .hero-content {
    border-radius: 12px;
    padding: 12px 14px;
  }

  .hero-content h2 {
    margin: 2px 0 4px;
    font-size: 1.18rem;
    line-height: 1.15;
  }

  .hero-content p:not(.eyebrow) {
    font-size: 0.78rem;
  }

  .eyebrow {
    font-size: 0.62rem;
    letter-spacing: 0.07em;
  }

  .search-card {
    border-radius: 11px;
    padding: 8px;
  }

  .search-card label {
    margin-bottom: 3px;
    font-size: 0.78rem;
  }

  .more-filters {
    margin-top: 4px;
  }

  .more-filters summary {
    font-size: 0.78rem;
  }

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

  .price-range-row {
    display: none;
  }

  input,
  select,
  button,
  .cta-link {
    padding: 6px 7px;
    border-radius: 7px;
    font-size: 0.78rem;
  }

  .search-btn {
    margin-top: 4px;
    padding: 6px 8px;
    gap: 5px;
  }

  .search-btn svg {
    width: 13px;
    height: 13px;
  }

  .pagination {
    margin-top: 10px;
    gap: 6px;
  }

  .pagination a {
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 0.76rem;
  }

  .pagination span {
    font-size: 0.78rem;
  }

  .page-jump {
    width: 100%;
    justify-content: center;
    gap: 5px;
    margin-left: 0;
  }

  .page-jump label {
    font-size: 0.76rem;
  }

  .page-jump input {
    width: 72px;
    padding: 5px 7px;
  }

  .page-jump button {
    padding: 5px 8px;
  }

  .catalog-wrap,
  .wrap {
    margin: 10px auto 18px;
    padding: 0 8px;
  }

  .panel {
    border-radius: 12px;
    padding: 10px;
  }

  .panel-head {
    margin-bottom: 8px;
  }

  .panel-head h3 {
    font-size: 1rem;
  }

  .panel-head span {
    font-size: 0.78rem;
  }

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

  .book-card {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 11px;
  }

  .book-cover {
    min-height: 0;
    aspect-ratio: 0.78;
  }

  .availability {
    left: 5px;
    bottom: 5px;
    padding: 2px 6px;
    font-size: 0.58rem;
  }

  .book-body {
    padding: 7px;
    gap: 4px;
  }

  .book-body h4 {
    font-size: 0.78rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .book-ref,
  .book-meta {
    display: none;
  }

  .price {
    font-size: 0.82rem;
  }

  .book-body .muted {
    font-size: 0.7rem;
    margin: 0;
  }

  .add-form {
    gap: 5px;
  }

  .add-form input[type="number"] {
    width: 42px;
    min-width: 42px;
    padding: 6px 4px;
    text-align: center;
  }

  .add-form button {
    flex: 1;
    padding: 6px 5px;
    font-size: 0.72rem;
  }

  .auth-overlay {
    padding: 64px 10px 10px;
    justify-content: center;
  }

  .auth-modal {
    width: min(100%, 390px);
  }

  .auth-step-overlay {
    padding: 12px;
  }

  .auth-step-panel {
    width: 100%;
  }

  .book-detail-panel {
    grid-template-columns: 1fr;
  }

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

  .billing-fields {
    grid-template-columns: 1fr;
  }

  .profile-span-2 {
    grid-column: auto;
  }

  .billing-span-2 {
    grid-column: auto;
  }

  .profile-row {
    flex-direction: column;
    gap: 6px;
  }

  .profile-row strong {
    text-align: left;
  }

  .site-footer {
    grid-template-columns: 1fr;
    padding: 14px 14px 18px;
    gap: 8px;
  }

  .footer-col h4 {
    margin-bottom: 5px;
    font-size: 0.9rem;
  }

  .footer-col p {
    margin: 2px 0;
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .footer-brand {
    margin-top: 10px;
  }

  .footer-brand img {
    width: 78px;
  }

  .floating-checkout-btn {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
    min-height: 40px;
    padding: 10px 12px;
    font-size: 0.86rem;
  }

  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
    bottom: 72px;
  }

  .orders-table td,
  .orders-table th {
    white-space: nowrap;
  }

  .orders-table {
    min-width: 100%;
  }

  .orders-table thead {
    display: none;
  }

  .orders-table tbody {
    display: block;
  }

  .orders-table tbody tr {
    display: block;
    border: 1px solid #e8eef5;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 10px;
    padding: 8px 10px;
  }

  .orders-table tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    white-space: normal;
    border-bottom: 1px solid #eef3f8;
    padding: 8px 0;
  }

  .orders-table tbody td:last-child {
    border-bottom: 0;
  }

  .orders-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #385772;
    min-width: 92px;
  }

  .orders-table .inline-form {
    margin-right: 4px;
    margin-top: 6px;
  }
}
