/* Dense Stripe-like public shop */
:root {
  --shop-bg: #f8fafc;
  --shop-card: #ffffff;
  --shop-border: #e2e8f0;
  --shop-border-hover: #94a3b8;
  --shop-teal: #0f766e;
  --shop-teal-dark: #134e4a;
  --shop-navy: #1e3a5f;
  --shop-slate: #64748b;
  --shop-text: #0f172a;
  --shop-muted: #64748b;
  --shop-radius: 8px;
  --shop-radius-sm: 6px;
}

.shop-page {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  background: var(--shop-bg);
  color: var(--shop-text);
  min-height: 60vh;
}

.shop-page * {
  box-sizing: border-box;
}

.shop-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* —— Catalog shell —— */
.shop-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 899px) {
  .shop-shell {
    grid-template-columns: 1fr;
  }
  .shop-sidebar {
    display: none;
  }
}

.shop-sidebar {
  position: sticky;
  top: 88px;
  background: var(--shop-card);
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius);
  padding: 16px;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.shop-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.shop-sidebar-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.shop-clear {
  font-size: 12px;
  color: var(--shop-teal);
  text-decoration: none;
  font-weight: 500;
}

.shop-clear:hover {
  text-decoration: underline;
}

.shop-filter-group {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--shop-border);
}

.shop-filter-group:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.shop-filter-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--shop-muted);
  margin-bottom: 8px;
}

.shop-input,
.shop-select {
  width: 100%;
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius-sm);
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: var(--shop-text);
}

.shop-input:focus,
.shop-select:focus,
.shop-check input:focus-visible + span,
.shop-grade:focus-visible,
.shop-btn:focus-visible,
.shop-page-btn:focus-visible,
.shop-quick:focus-visible {
  outline: 2px solid var(--shop-teal);
  outline-offset: 2px;
}

.shop-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin: 6px 0;
  cursor: pointer;
}

.shop-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--shop-teal);
}

.shop-check .count {
  margin-left: auto;
  color: var(--shop-muted);
  font-size: 12px;
}

.shop-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin: 6px 0;
  cursor: pointer;
}

.shop-radio input {
  accent-color: var(--shop-teal);
}

.shop-grade-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.shop-grade {
  appearance: none;
  border: 1px solid var(--shop-border);
  background: #fff;
  border-radius: var(--shop-radius-sm);
  padding: 7px 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--shop-text);
}

.shop-grade[aria-pressed="true"],
.shop-grade.is-on {
  background: var(--shop-navy);
  border-color: var(--shop-navy);
  color: #fff;
}

.shop-price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.shop-applied {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.shop-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius-sm);
  background: #f1f5f9;
  color: var(--shop-text);
  text-decoration: none;
}

/* —— Main —— */
.shop-main-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.shop-main-head h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.shop-sub {
  margin: 0;
  font-size: 13px;
  color: var(--shop-muted);
  max-width: 42rem;
}

.shop-stats {
  font-size: 12px;
  color: var(--shop-muted);
  white-space: nowrap;
}

.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--shop-muted);
}

.shop-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-view-toggle {
  display: inline-flex;
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius-sm);
  overflow: hidden;
}

.shop-view-toggle a {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--shop-muted);
  text-decoration: none;
  background: #fff;
  border-right: 1px solid var(--shop-border);
}

.shop-view-toggle a:last-child {
  border-right: 0;
}

.shop-view-toggle a.is-active {
  background: var(--shop-navy);
  color: #fff;
}

.shop-toolbar .shop-select {
  width: auto;
  min-width: 120px;
  padding: 6px 8px;
  font-size: 12px;
}

/* —— Product grid —— */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 1099px) {
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 899px) {
  .shop-grid {
    display: none;
  }
}

.shop-card {
  display: flex;
  flex-direction: column;
  background: var(--shop-card);
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}

.shop-card:hover {
  border-color: var(--shop-border-hover);
}

.shop-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.shop-meta {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--shop-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.shop-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--shop-teal);
}

.shop-dot--free {
  background: var(--shop-slate);
}

.shop-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.shop-card-desc {
  margin: 0;
  font-size: 13px;
  color: var(--shop-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.shop-price {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.shop-price--free {
  color: var(--shop-teal);
}

.shop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--shop-radius-sm);
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.shop-btn-primary {
  background: var(--shop-teal);
  color: #fff;
}

.shop-btn-primary:hover {
  background: var(--shop-teal-dark);
}

.shop-btn-ghost {
  background: #fff;
  border-color: var(--shop-border);
  color: var(--shop-text);
}

.shop-btn-navy {
  background: var(--shop-navy);
  color: #fff;
}

.shop-btn-block {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
}

/* —— Cover —— */
.shop-cover {
  position: relative;
  height: 132px;
  overflow: hidden;
  background: #e2e8f0;
}

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

.shop-cover-grad {
  width: 100%;
  height: 100%;
  position: relative;
  color: #fff;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.shop-cover-grad::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(255, 255, 255, 0.35) 8px,
    rgba(255, 255, 255, 0.35) 9px
  );
  pointer-events: none;
}

.shop-cover-grad--notes {
  background: linear-gradient(135deg, #0f766e 0%, #134e4a 55%, #0e7490 100%);
}

.shop-cover-grad--exams {
  background: linear-gradient(135deg, #1e3a5f 0%, #0369a1 50%, #0f766e 100%);
}

.shop-cover-grad--sample,
.shop-cover-grad--other {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.shop-cover-kicker {
  position: absolute;
  top: 12px;
  left: 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
  z-index: 1;
}

.shop-cover-grade {
  position: absolute;
  top: 28px;
  left: 14px;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  z-index: 1;
  opacity: 0.95;
}

.shop-cover-sub {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.92;
}

/* —— Mobile chrome —— */
.shop-mobile-top {
  display: none;
  margin-bottom: 14px;
}

@media (max-width: 899px) {
  .shop-mobile-top {
    display: block;
  }
  .shop-main-head h1 {
    display: none;
  }
}

.shop-mobile-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
}

.shop-mobile-search {
  display: flex;
  gap: 8px;
  margin: 12px 0 10px;
}

.shop-mobile-search .shop-input {
  flex: 1;
}

.shop-quick-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.shop-quick {
  flex: 0 0 auto;
  border: 1px solid var(--shop-border);
  background: #fff;
  border-radius: var(--shop-radius-sm);
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--shop-text);
  text-decoration: none;
  white-space: nowrap;
}

.shop-quick.is-active {
  background: var(--shop-navy);
  border-color: var(--shop-navy);
  color: #fff;
}

/* —— Mobile list —— */
.shop-list {
  display: none;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 899px) {
  .shop-list {
    display: flex;
  }
}

.shop-list.is-desktop-list {
  display: flex;
}

@media (min-width: 900px) {
  .shop-list:not(.is-desktop-list) {
    display: none;
  }
  .shop-grid.is-hidden {
    display: none;
  }
}

.shop-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--shop-card);
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius);
  padding: 10px;
  text-decoration: none;
  color: inherit;
  min-height: 88px;
}

.shop-row:hover {
  border-color: var(--shop-border-hover);
}

.shop-row .shop-cover {
  height: 88px;
  width: 88px;
  border-radius: var(--shop-radius-sm);
}

.shop-row .shop-cover-grade {
  font-size: 28px;
  top: 22px;
  left: 8px;
}

.shop-row .shop-cover-kicker {
  top: 8px;
  left: 8px;
  font-size: 9px;
}

.shop-row .shop-cover-sub {
  display: none;
}

.shop-row-mid {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shop-row .shop-card-title {
  font-size: 14px;
}

.shop-row .shop-price {
  font-size: 15px;
}

.shop-row-cta {
  align-self: center;
}

/* —— Pagination —— */
.shop-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--shop-border);
  font-size: 13px;
  color: var(--shop-muted);
}

.shop-pager-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.shop-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius-sm);
  background: #fff;
  color: var(--shop-text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.shop-page-btn.is-active {
  background: var(--shop-navy);
  border-color: var(--shop-navy);
  color: #fff;
}

.shop-page-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.shop-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--shop-muted);
  font-size: 14px;
  background: var(--shop-card);
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius);
}

/* —— Filter sheet (mobile) —— */
.shop-sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 80;
}

.shop-sheet-backdrop.is-open {
  display: block;
}

.shop-sheet {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px 12px 0 0;
  z-index: 90;
  padding: 16px 16px 28px;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.12);
}

.shop-sheet.is-open {
  display: block;
}

.shop-sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.shop-sheet-bar h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.shop-sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 12px;
}

/* —— Detail —— */
.shop-detail {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 899px) {
  .shop-detail {
    grid-template-columns: 1fr;
    padding-bottom: 100px;
  }
}

.shop-crumb {
  font-size: 12px;
  color: var(--shop-muted);
  margin-bottom: 14px;
}

.shop-crumb a {
  color: var(--shop-muted);
  text-decoration: none;
}

.shop-crumb a:hover {
  color: var(--shop-teal);
}

.shop-detail-card {
  background: var(--shop-card);
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius);
  overflow: hidden;
}

.shop-detail-cover {
  height: 220px;
}

.shop-detail-cover .shop-cover-grade {
  font-size: 72px;
  top: 48px;
}

.shop-detail-body {
  padding: 20px 22px 24px;
}

.shop-detail-body h1 {
  margin: 8px 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.shop-detail-lead {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--shop-muted);
  line-height: 1.5;
}

.shop-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

@media (max-width: 599px) {
  .shop-facts {
    grid-template-columns: repeat(2, 1fr);
  }
}

.shop-fact {
  background: #f8fafc;
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius-sm);
  padding: 10px 12px;
}

.shop-fact-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--shop-muted);
  margin-bottom: 4px;
}

.shop-fact-value {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.shop-included h2 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}

.shop-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.shop-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--shop-muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--shop-border);
}

.shop-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--shop-border);
  font-variant-numeric: tabular-nums;
}

.shop-table td:last-child,
.shop-table th:last-child {
  text-align: right;
}

.shop-rail {
  position: sticky;
  top: 88px;
  background: var(--shop-card);
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius);
  padding: 18px;
}

.shop-rail-price {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 4px;
  font-variant-numeric: tabular-nums;
}

.shop-rail-note {
  font-size: 12px;
  color: var(--shop-muted);
  margin: 0 0 14px;
}

.shop-summary {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  font-size: 13px;
}

.shop-summary li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--shop-border);
  color: var(--shop-muted);
}

.shop-summary li strong {
  color: var(--shop-text);
  font-weight: 600;
}

.shop-rail label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
}

.shop-rail .shop-input {
  margin-bottom: 12px;
}

.shop-steps {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--shop-muted);
}

.shop-steps li {
  display: flex;
  gap: 8px;
  margin: 6px 0;
}

.shop-steps b {
  color: var(--shop-navy);
  font-variant-numeric: tabular-nums;
}

.shop-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--shop-radius-sm);
  font-size: 13px;
  display: none;
}

.shop-status.show {
  display: block;
}

.shop-status.ok {
  background: #ecfdf5;
  border: 1px solid #99f6e4;
  color: #134e4a;
}

.shop-status.err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.shop-mobile-paybar {
  display: none;
}

@media (max-width: 899px) {
  .shop-rail {
    position: static;
  }
  .shop-mobile-paybar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    background: #fff;
    border-top: 1px solid var(--shop-border);
    padding: 12px 16px;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  }
  .shop-mobile-paybar .shop-price {
    font-size: 18px;
  }
}

/* Header CTA radius match */
.shop-page ~ footer,
body:has(.shop-page) .btn-primary {
  border-radius: 8px;
}

body:has(.shop-page) .site-header .btn-primary {
  border-radius: 8px;
}

.shop-dl-table td {
  vertical-align: middle;
}

.shop-dl-num {
  width: 2.5rem;
  color: var(--shop-muted);
  font-variant-numeric: tabular-nums;
}

.shop-dl-action {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 599px) {
  .shop-dl-action .shop-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}
