/* Shared shop styles: navigation, CTA, realistic PDF books catalogue, cart */
.shop-page {
  --color-bg: #0b0f19;
  --color-paper: #151b2b;
  --color-ink: #e2e8f0;
  --color-muted: #94a3b8;
  --color-line: #334155;
  --color-soft: #1e293b;
  --color-accent: #10b981;
  --color-accent2: #0ea5e9;
  --color-gold: #fbbf24;
  --border-radius: 18px;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}
.shop-page * { box-sizing: border-box; }
.shop-page a { color: inherit; }

.shop-page .site-header {
  background: #0f172a;
  color: #fff;
  padding: 12px 18px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 4px 15px rgba(0,0,0,.4);
}
.header-logo { height: 34px; display: block; }
.header-brand-wrap { display: inline-flex; align-items: center; }

.shop-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shop-nav a {
  text-decoration: none;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all .2s;
}
.shop-nav a:hover {
  color: #fff;
  border-color: var(--color-accent);
}
.shop-nav a.active {
  color: #fff;
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--color-accent);
}
.cart-badge {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  line-height: 20px;
}
.cart-badge.zero { background: #334155; }

.cta-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #059669, #0284c7);
  color: #fff !important;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
  transition: transform .2s, box-shadow .2s;
}
.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.55);
}

/* Layout of pages */
.shop-container { max-width: 1160px; margin: 0 auto; padding: 24px 18px 48px; }
.shop-title { font-size: clamp(26px, 3.5vw, 40px); margin: 12px 0 6px; letter-spacing: -.02em; }
.shop-title .accent { color: var(--color-accent); }
.shop-lead { color: var(--color-muted); max-width: 75ch; margin: 0 0 26px; }

/* Features banner on books page */
.pdf-perks-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  border-radius: var(--border-radius);
  padding: 16px 20px;
}
.pdf-perk {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: #cbd5e1;
}
.pdf-perk-icon {
  font-size: 22px;
  background: var(--color-soft);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--color-line);
  flex-shrink: 0;
}
.pdf-perk strong { color: #fff; display: block; font-size: 13.5px; }

/* Books Grid */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px; }
.book-card {
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  border-radius: var(--border-radius);
  padding: 20px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.book-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-accent);
  box-shadow: 0 16px 36px rgba(0,0,0,.5);
}

/* 3D Realistic Book Cover */
.book-cover-wrap {
  perspective: 1000px;
  display: flex;
  justify-content: center;
  padding: 10px 0 16px;
}
.book-cover-realistic {
  position: relative;
  width: 170px;
  height: 245px;
  background: var(--book-accent, #1e293b);
  border-radius: 3px 10px 10px 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: rotateY(-13deg) rotateX(4deg);
  transform-origin: left center;
  transition: transform .35s ease, box-shadow .35s ease;
  box-shadow:
    6px 10px 24px rgba(0,0,0,.65),
    1px 2px 4px rgba(0,0,0,.5),
    inset -3px 0 8px rgba(0,0,0,.45);
  border-right: 2px solid rgba(255,255,255,.08);
}
.book-card:hover .book-cover-realistic {
  transform: rotateY(-3deg) rotateX(1deg) scale(1.04);
  box-shadow:
    10px 16px 32px rgba(0,0,0,.7),
    0 0 20px rgba(16, 185, 129, 0.25);
}

/* Spine effect */
.book-spine-effect {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(
    90deg,
    rgba(0,0,0,.6) 0%,
    rgba(255,255,255,.22) 40%,
    rgba(0,0,0,.5) 85%,
    transparent 100%
  );
  z-index: 5;
  pointer-events: none;
}

/* Gloss / Sheen */
.book-gloss-effect {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    rgba(255,255,255,.25) 0%,
    rgba(255,255,255,.08) 25%,
    transparent 55%
  );
  z-index: 6;
  pointer-events: none;
}

/* Photo and overlays */
.cover-photo-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}
.cover-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.92) contrast(1.08) saturate(1.1);
  transition: transform .4s ease, filter .4s ease;
}
.book-card:hover .cover-photo {
  transform: scale(1.08);
  filter: brightness(0.8) contrast(1.15) saturate(1.15);
}
.cover-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.45) 0%,
    rgba(15, 23, 42, 0.15) 35%,
    rgba(15, 23, 42, 0.65) 75%,
    rgba(15, 23, 42, 0.92) 100%
  );
}

/* PDF badge on cover */
.cover-format-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cover-format-tag .pdf-icon {
  background: #dc2626;
  color: #fff;
  font-size: 8px;
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: 900;
}

/* Typography on realistic cover */
.cover-content {
  position: relative;
  z-index: 3;
  padding: 12px 12px 10px 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}
.cover-header-brand {
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--color-gold);
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.cover-main-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.18;
  color: #ffffff;
  margin: 4px 0 2px;
  text-shadow: 0 2px 6px rgba(0,0,0,.9);
}
.cover-subtitle {
  font-size: 9px;
  color: #e2e8f0;
  line-height: 1.25;
  margin: 0;
  opacity: .95;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
}
.cover-footer-meta {
  border-top: 1px solid rgba(255,255,255,.3);
  padding-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8px;
  color: #cbd5e1;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.cover-pub-mark {
  font-weight: 700;
  color: var(--color-gold);
  letter-spacing: .06em;
}

/* Card Info */
.book-info h3 { margin: 0 0 4px; font-size: 17px; line-height: 1.25; }
.book-meta {
  font-size: 12px;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.badge-pdf-pill {
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(220, 38, 38, 0.5);
  color: #fca5a5;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}
.badge-download {
  color: #34d399;
  font-weight: 600;
}
.book-desc { font-size: 13.5px; color: #cbd5e1; margin: 8px 0 0; line-height: 1.45; }
.book-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
}
.book-price { font-size: 22px; font-weight: 800; color: #fff; }
.book-price small { font-size: 11px; font-weight: 500; color: var(--color-muted); display: block; }

.btn-primary {
  background: linear-gradient(135deg, #059669, #0284c7);
  color: #fff;
  border: 0;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
  transition: filter .2s, transform .15s;
  font-family: inherit;
}
.btn-primary:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--color-muted);
  border: 1px solid var(--color-line);
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-family: inherit;
}
.btn-ghost:hover { color: #fff; border-color: var(--color-accent); }

/* Cart Layout */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 26px; align-items: start; }
.panel {
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  border-radius: var(--border-radius);
  padding: 22px;
}
.panel h2 { margin: 0 0 16px; font-size: 19px; }

.cart-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-line);
}
.cart-item:last-child { border-bottom: 0; }
.mini-cover-realistic {
  width: 60px;
  height: 84px;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  background: var(--book-accent, #1e293b);
  box-shadow: 2px 4px 10px rgba(0,0,0,.5);
  flex-shrink: 0;
}
.mini-cover-realistic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85);
}
.mini-cover-badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: #dc2626;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  padding: 1px 3px;
  border-radius: 2px;
}
.ci-title { font-weight: 700; font-size: 15px; }
.ci-unit { font-size: 12px; color: var(--color-muted); margin-top: 2px; }
.ci-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ci-line-price { font-weight: 800; font-size: 16px; color: #fff; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--color-line); border-radius: 999px; overflow: hidden; }
.qty button { background: var(--color-soft); color: #fff; border: 0; width: 30px; height: 30px; cursor: pointer; font-size: 16px; }
.qty button:hover { background: var(--color-accent); }
.qty span { min-width: 34px; text-align: center; font-weight: 700; font-size: 14px; }
.link-remove { background: none; border: 0; color: var(--color-muted); font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0; }
.link-remove:hover { color: #f87171; }

.sum-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: #cbd5e1; }
.sum-row.total {
  border-top: 1px solid var(--color-line);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}
.sum-note { font-size: 12px; color: var(--color-muted); margin: 6px 0 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; color: var(--color-muted); margin-bottom: 4px; font-weight: 600; }
.field input, .field select {
  width: 100%;
  background: var(--color-soft);
  border: 1px solid var(--color-line);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}
.field input:focus, .field select:focus { outline: 0; border-color: var(--color-accent); }
.field.invalid input, .field.invalid select { border-color: #f87171; }
.pay-btn { width: 100%; margin-top: 16px; padding: 14px; font-size: 16px; }
.notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  background: rgba(251,191,36,.12);
  border: 1px solid #fbbf24;
  color: #fde68a;
  display: none;
}
.notice.show { display: block; }
.empty-cart { text-align: center; padding: 40px 10px; color: var(--color-muted); }
.empty-cart .big { font-size: 54px; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #0f172a;
  border: 1px solid var(--color-accent);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  z-index: 300;
  opacity: 0;
  transform: translateY(12px);
  transition: all .25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }

.shop-footer {
  border-top: 1px solid var(--color-line);
  margin-top: 40px;
  padding-top: 20px;
  font-size: 12px;
  color: var(--color-muted);
}
.shop-footer a { margin-right: 14px; }

@media (max-width: 860px) {
  .cart-layout { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 52px 1fr; }
  .ci-right {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
}

/* Trash remove button */
.btn-trash-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  font-family: inherit;
}
.btn-trash-remove:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
  color: #fff;
  transform: translateY(-1px);
}
.trash-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.btn-primary.in-cart {
  background: var(--color-soft);
  border: 1px solid var(--color-accent);
  color: #34d399;
  cursor: default;
}
.btn-primary.in-cart:hover {
  filter: none;
  transform: none;
}
