/* 딥코드 전자책 스토어 — deepbook-pixel-shelf 템플릿 포팅 */
:root {
  --background: #121310;
  --foreground: #efeee9;
  --card: #1b1c18;
  --primary: #bef264;
  --primary-foreground: #1a200d;
  --secondary: #24251f;
  --muted-foreground: #96978e;
  --border: #32332c;
  --cover-lime: #bef264;
  --cover-teal: #4aa39a;
  --cover-silver: #cdcbc4;
  --cover-pink: #e4a9a5;
  --cover-ink: #23261e;
  --cover-light: #efeee9;
  --book-shadow: 4px 10px 24px rgba(0, 0, 0, 0.38);
  --detail-book-shadow: 8px 18px 32px rgba(0, 0, 0, 0.45);
  --reading: #f4f4f1;
  --reading-ink: #30312c;
  --reading-muted: #6f7069;
  --campaign-background: #000;
  --font-sans: "Noto Sans KR", sans-serif;
  --font-editorial: "Noto Serif KR", serif;
}
* { box-sizing: border-box; border-color: var(--border); }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; word-break: keep-all; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; }
::selection { background: var(--primary); color: var(--primary-foreground); }

.store-width { max-width: 1160px; margin-inline: auto; padding-inline: 32px; }
.store-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--primary); color: var(--primary-foreground); border: 0; border-radius: 3px; font-weight: 700; font-size: 13px; padding: 0 22px; height: 44px; transition: filter 0.2s; }
.store-btn:hover { filter: brightness(1.06); }
.store-btn[disabled] { opacity: 0.45; pointer-events: none; }
.ghost-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--border); color: var(--foreground); border-radius: 3px; font-size: 12px; padding: 0 16px; height: 38px; }
.ghost-btn:hover { border-color: var(--muted-foreground); }
.link-btn { color: var(--primary); font-size: 12px; background: none; border: 0; padding: 0; }

/* 헤더 / 푸터 */
.site-header { height: 84px; border-bottom: 1px solid var(--border); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.header-left { display: flex; align-items: center; gap: 60px; }
.brand-logo img { height: 30px; display: block; }
.main-nav { display: flex; align-items: center; gap: 30px; height: 84px; font-size: 13px; }
.main-nav a { color: var(--muted-foreground); transition: color 0.2s; }
.main-nav a:hover { color: var(--foreground); }
.main-nav .current { color: var(--primary); height: 100%; display: flex; align-items: center; position: relative; }
.main-nav .current::after { content: ""; position: absolute; height: 2px; background: var(--primary); bottom: 0; left: 0; right: 0; }
.footer { padding-block: 32px; display: flex; justify-content: space-between; gap: 25px; color: var(--muted-foreground); font-size: 10px; border-top: 1px solid var(--border); margin-top: 60px; }
.footer p { margin-top: 14px; }
.footer img { height: 24px; width: auto; display: block; }
.footer-right { display: flex; flex-direction: column; gap: 10px; text-align: right; }

/* 히어로 */
.hero { position: relative; height: 262px; overflow: hidden; }
.hero-image { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--background) 0%, rgba(18, 19, 16, 0.88) 26%, transparent 65%); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; padding-top: 26px; }
.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 2px; color: var(--primary); }
.hero h1 { font-family: var(--font-editorial); font-size: 28px; font-weight: 600; line-height: 1.32; margin: 9px 0 8px; }
.hero-description { font-size: 12px; line-height: 1.7; color: var(--muted-foreground); margin: 0; }
.hero-cta { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.hero-cta > span { font-size: 11px; color: var(--muted-foreground); }
.hero-bottom { position: absolute; bottom: 13px; inset-inline: 0; z-index: 1; }
.hero-position { display: flex; align-items: center; gap: 12px; font-size: 10px; color: var(--muted-foreground); }
.hero-position .line { height: 2px; width: 56px; background: var(--border); }
.hero-position .line:first-of-type { background: var(--primary); }

/* 카탈로그 */
.catalog { padding-block: 24px 60px; }
.section-heading h2 { font-size: 24px; font-weight: 700; margin: 0 0 9px; }
.section-heading p { font-size: 12px; color: var(--muted-foreground); margin: 0; }
.filters { display: flex; gap: 7px; flex-wrap: wrap; margin-block: 16px 22px; }
.filter-btn { background: transparent; border: 1px solid var(--border); color: var(--muted-foreground); border-radius: 3px; font-size: 11px; padding: 7px 13px; }
.filter-btn[data-active="true"] { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); font-weight: 700; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fit, 270px); justify-content: center; gap: 32px 28px; }
.book-card { position: relative; }
.book-art { height: 281px; background: var(--card); border: 1px solid rgba(50, 51, 44, 0.6); border-radius: 4px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.book-open { position: absolute; inset: 0; z-index: 1; }
.book-label { position: absolute; top: 13px; left: 13px; padding: 3px 7px; border: 1px solid var(--border); background: var(--background); font-size: 8px; color: var(--primary); z-index: 2; }
.book-info { padding-top: 15px; }
.book-category { font-size: 9px; color: var(--primary); }
.book-title { font-size: 15px; font-weight: 600; margin: 6px 0; }
.book-title a:hover { color: var(--primary); }
.book-author { font-size: 10px; color: var(--muted-foreground); }
.book-description { font-size: 11px; color: var(--muted-foreground); line-height: 1.7; margin: 10px 0 12px; }
.book-footer { display: flex; align-items: center; justify-content: space-between; }
.book-price { font-size: 14px; font-weight: 700; }
.book-price small { margin-left: 8px; font-size: 10px; font-weight: 400; color: var(--muted-foreground); text-decoration: line-through; }
.book-format { font-size: 8px; color: var(--muted-foreground); border: 1px solid var(--border); padding: 2px 5px; }

/* 북 커버 (제너러티브 아트) */
.cover { position: relative; width: 155px; height: 219px; padding: 20px 16px 13px; color: var(--cover-ink); background: var(--cover-lime); box-shadow: var(--book-shadow); border-radius: 1px 3px 3px 1px; overflow: hidden; transform: rotate(-5deg); transition: transform 0.35s; display: flex; flex-direction: column; }
.cover::before { content: ""; position: absolute; inset-block: 0; left: 4px; width: 2px; background: rgba(35, 38, 30, 0.15); }
.book-card:hover .cover { transform: rotate(0deg) translateY(-5px); }
.cover-teal { background: var(--cover-teal); transform: rotate(5deg); }
.cover-silver { background: var(--cover-silver); transform: rotate(-4deg); }
.cover-pink { background: var(--cover-pink); transform: rotate(5deg); }
.cover-top { font-size: 6px; letter-spacing: 1.5px; font-weight: 600; }
.cover-title { font-size: 21px; line-height: 1.35; font-weight: 800; margin-top: 12px; white-space: pre-line; z-index: 1; }
.cover-subtitle { font-size: 6px; margin-top: 7px; opacity: 0.75; }
.cover-art { width: 100%; height: 91px; margin-top: auto; fill: none; stroke: currentColor; stroke-width: 0.65; }
.cover-bottom { font-size: 5px; display: flex; justify-content: space-between; margin-top: 6px; }

/* 에디터 노트 */
.editor-note { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding-block: 36px; }
.editor-inner { display: flex; align-items: center; gap: 34px; }
.editor-icon { color: var(--primary); width: 39px; height: 39px; flex-shrink: 0; }
.editor-inner h2 { font-family: var(--font-editorial); font-size: 20px; margin: 0 0 9px; font-weight: 600; }
.editor-inner p { font-size: 12px; color: var(--muted-foreground); line-height: 1.8; margin: 0; }
.editor-inner a { margin-left: auto; flex-shrink: 0; font-size: 12px; color: var(--primary); }

/* 책 상세 (블랙 에디토리얼) */
.book-detail-page { min-height: 100dvh; background: var(--campaign-background); }
.book-detail-breadcrumb { display: flex; justify-content: space-between; align-items: center; padding-top: 25px; font-size: 10px; color: var(--muted-foreground); }
.book-detail-breadcrumb a:hover { color: var(--primary); }
.book-detail-hero { padding-top: 32px; padding-bottom: 38px; }
.book-product-image { height: 290px; display: flex; align-items: center; justify-content: center; margin-top: 10px; }
.book-product-image .cover { width: 180px; height: 255px; padding: 24px 20px 16px; transform: rotate(-5deg); box-shadow: var(--detail-book-shadow); }
.book-product-image .cover-title { font-size: 21px; margin-top: 16px; }
.book-product-image .cover-art { height: 102px; }
.book-product-caption { text-align: center; }
.book-product-category { font-size: 10px; color: var(--muted-foreground); }
.book-product-caption h1 { font-size: 30px; font-weight: 600; line-height: 1.5; margin: 10px 20px 7px; }
.book-product-caption p { font-size: 12px; color: var(--muted-foreground); margin: 0 0 11px; }
.book-reading-width { width: 100%; max-width: 744px; margin-inline: auto; padding-inline: 32px; }
.book-section-label { display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 10px; color: var(--muted-foreground); }
.book-intro-title { max-width: 580px; font-size: 30px; line-height: 1.7; font-weight: 500; margin: 22px 0 0; font-family: var(--font-editorial); }
.book-intro-meta { margin-top: 28px; display: flex; gap: 18px; font-size: 11px; color: var(--muted-foreground); }
.book-contents-heading { display: flex; justify-content: space-between; align-items: center; margin-top: 48px; padding-bottom: 8px; }
.book-contents-heading h3 { font-size: 17px; font-weight: 600; margin: 0; }
.book-contents-heading span { font-size: 10px; color: var(--muted-foreground); }
.book-contents { list-style: none; padding: 0; margin: 0; }
.book-contents li { display: flex; align-items: baseline; gap: 22px; padding-block: 14px; font-size: 16px; border-bottom: 1px solid var(--border); }
.book-chapter-number { font-size: 12px; color: var(--muted-foreground); }
.book-purchase-section { padding-block: 48px 80px; border-top: 1px solid var(--border); margin-top: 56px; }
.book-purchase-section h2 { font-size: 24px; font-weight: 500; margin: 12px 0 0; }
.book-purchase-section > .book-reading-width > p { font-size: 12px; color: var(--muted-foreground); margin-top: 10px; }
.book-purchase-line { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 30px; }
.book-purchase-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; font-size: 23px; font-weight: 600; }
.book-purchase-price s { font-size: 12px; color: var(--muted-foreground); font-weight: 400; }
.book-sticky-purchase { position: fixed; bottom: 0; inset-inline: 0; z-index: 40; border-top: 1px solid var(--border); background: rgba(18, 19, 16, 0.96); backdrop-filter: blur(16px); padding-bottom: env(safe-area-inset-bottom); }
.book-sticky-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; }
.book-sticky-inner strong { font-size: 16px; }
.book-sticky-inner span { font-size: 11px; color: var(--muted-foreground); display: block; }

/* 주문 · 결제 */
.checkout-page { padding-block: 40px 80px; }
.checkout-page h1 { font-size: 28px; margin: 6px 0 32px; }
.back-link { font-size: 11px; color: var(--muted-foreground); }
.back-link:hover { color: var(--foreground); }
.checkout-grid { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.checkout-section { margin-bottom: 40px; }
.checkout-section h2 { font-size: 16px; font-weight: 700; margin: 0 0 16px; }
.checkout-section .hint { font-size: 13.5px; line-height: 1.75; color: var(--muted-foreground); margin: -10px 0 16px; }
.shelf-row { display: flex; gap: 18px; align-items: center; border-bottom: 1px solid var(--border); padding-block: 14px; }
.shelf-row .cover { width: 58px; height: 82px; padding: 8px; transform: none; flex-shrink: 0; }
.shelf-row .cover-title { font-size: 9px; margin-top: 4px; }
.shelf-row .cover-top, .shelf-row .cover-subtitle, .shelf-row .cover-bottom { display: none; }
.shelf-row .cover-art { height: 30px; }
.shelf-row-info { flex: 1; min-width: 0; }
.shelf-row-info strong { font-size: 15px; display: block; }
.shelf-row-info .meta { font-size: 13px; color: var(--muted-foreground); margin-top: 4px; }
.shelf-row-info .price { font-size: 15px; margin-top: 8px; }
.remove-btn { background: none; border: 0; color: var(--muted-foreground); font-size: 16px; padding: 6px; }
.remove-btn:hover { color: var(--foreground); }
.field-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.field-grid label { font-size: 13px; color: var(--muted-foreground); display: flex; flex-direction: column; gap: 8px; }
.field-grid input { height: 48px; border-radius: 3px; border: 1px solid var(--border); background: var(--background); color: var(--foreground); padding: 0 14px; font-size: 15px; outline: none; font-family: inherit; }
.field-grid input:focus { border-color: var(--primary); }
.bump-box { border: 1px dashed var(--border); border-radius: 3px; padding: 22px; background: var(--card); }
.bump-box[data-selected="true"] { border-color: var(--primary); background: rgba(190, 242, 100, 0.05); }
.bump-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.bump-head h2 { margin: 0; font-size: 16px; }
.bump-head span { font-size: 13px; color: var(--primary); }
.bump-check { display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; font-size: 15px; line-height: 1.6; cursor: pointer; }
.bump-check input { accent-color: var(--primary); margin-top: 3px; }
.bump-check .plus { color: var(--primary); }
.summary-box .store-btn { height: 52px; font-size: 16px; }
.summary-box { border: 1px solid var(--border); border-radius: 3px; background: var(--card); padding: 24px; position: sticky; top: 20px; }
.summary-box h2 { font-size: 16px; margin: 0 0 20px; }
.summary-box dl { margin: 0; font-size: 15px; }
.summary-box dl div { display: flex; justify-content: space-between; margin-bottom: 12px; }
.summary-box dt { color: var(--muted-foreground); }
.summary-box .discount dd { color: var(--primary); }
.summary-box .total { border-top: 1px solid var(--border); padding-top: 16px; font-size: 20px; font-weight: 700; }
.agree-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted-foreground); margin: 20px 0 16px; line-height: 1.7; cursor: pointer; }
.agree-row input { accent-color: var(--primary); margin-top: 2px; }
.pay-note { font-size: 10px; color: var(--muted-foreground); margin-top: 12px; }
.empty-state { padding: 70px 10px; text-align: center; color: var(--muted-foreground); font-size: 14px; line-height: 2.2; }

/* 결제 결과 */
.result-page { max-width: 560px; margin-inline: auto; padding: 80px 24px; text-align: center; }
.result-page h1 { font-size: 24px; margin: 20px 0 10px; }
.result-page .sub { font-size: 13px; color: var(--muted-foreground); line-height: 1.9; }
.result-icon { width: 48px; height: 48px; color: var(--primary); margin-inline: auto; }
.download-list { margin: 32px 0; text-align: left; }
.order-meta { font-size: 11px; color: var(--muted-foreground); margin-top: 32px; }

@media (max-width: 900px) {
  .header-left { gap: 30px; }
  .main-nav { gap: 20px; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero h1 { font-size: 25px; }
  .hero-image { object-position: 60% center; }
  .book-art { height: 260px; }
  .checkout-grid { grid-template-columns: 1fr; }
  .summary-box { position: static; }
}
@media (max-width: 640px) {
  .store-width { padding-inline: 20px; }
  .site-header, .main-nav { height: 70px; }
  .brand-logo img { height: 24px; }
  .header-left { gap: 24px; }
  .main-nav { gap: 16px; font-size: 12px; }
  .hero { height: 196px; }
  .hero-image { object-position: 65% center; opacity: 0.55; }
  .hero::after { background: linear-gradient(90deg, var(--background), transparent 120%); }
  .hero-inner { padding-top: 22px; }
  .hero h1 { font-size: 20px; }
  .hero-description { font-size: 11px; }
  .hero-cta > span, .hero-bottom { display: none; }
  .catalog { padding-top: 18px; }
  .section-heading h2 { font-size: 22px; }
  .section-heading p { font-size: 11px; line-height: 1.8; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; }
  .book-art { height: 205px; }
  .cover { width: 124px; height: 178px; padding: 15px 12px 10px; }
  .cover-title { font-size: 18px; }
  .cover-art { height: 65px; }
  .book-title { font-size: 13px; }
  .book-description { font-size: 10px; }
  .book-price { font-size: 12px; }
  .book-label { font-size: 7px; top: 9px; left: 9px; }
  .editor-inner { gap: 17px; flex-wrap: wrap; }
  .editor-inner h2 { font-size: 17px; }
  .editor-inner p { font-size: 11px; }
  .editor-inner a { margin-left: 0; }
  .footer { flex-direction: column; }
  .footer-right { text-align: left; }
  .book-product-image { height: 275px; margin-top: 4px; }
  .book-product-image .cover { width: 158px; height: 224px; padding: 20px 17px 14px; }
  .book-product-image .cover-title { font-size: 18px; }
  .book-product-image .cover-art { height: 85px; }
  .book-product-caption h1 { font-size: 25px; }
  .book-reading-width { padding-inline: 24px; }
  .book-intro-title { font-size: 24px; margin-top: 26px; }
  .book-contents li { font-size: 14px; gap: 17px; }
  .book-purchase-price { font-size: 21px; gap: 5px; flex-direction: column; align-items: flex-start; }
  .field-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 패키지 연출 (구성상품 있는 책) */
.package-stack { position: relative; }
.package-stack::before, .package-stack::after { content: ""; position: absolute; inset: 8px -9px; border-radius: 2px; z-index: 0; }
.package-stack::before { background: #2c2d27; transform: rotate(9deg); }
.package-stack::after { background: #23241f; transform: rotate(-4deg); }
.package-stack .cover { position: relative; z-index: 1; }
/* 체크아웃 추가 요소 */
.field-grid .span2 { grid-column: 1 / -1; }
.composition { border-bottom: 1px solid var(--border); margin-bottom: 16px; padding-bottom: 8px; }
.comp-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted-foreground); margin-bottom: 9px; }
@media (max-width: 640px) { .field-grid .span2 { grid-column: auto; } }
