:root{
  --wine:#6B2737;
  --gold:#B08D57;
  --ink:#1F2333;
  --parchment:#EEE6D6;
  --text:#2A2620;
}
header{
  display: flex;
  align-items: center;
  justify-content:space-between;
  background-color: var(--ink);
  color:var(--parchment);
  padding: 18px 40px;
}
nav{
  display: flex;
  gap: 24px;
}
.header-actions{
  display: flex;
  align-items: center;
  gap: 18px;
}
h1{
  color: var(--wine);
  font-family: 'Fraunces', serif;
  font-size: 3rem;
}
body {
  margin: 0;
  background-color: var(--parchment);
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(31,35,51,0.04) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23000' opacity='0.015'/%3E%3Crect width='2' height='2' fill='%23fff' opacity='0.02'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cg fill='none' stroke='%236B2737' stroke-width='1.5' opacity='0.16'%3E%3Cpath d='M18 24 L30 22 L30 36 L18 38 Z'/%3E%3Cpath d='M42 24 L30 22 L30 36 L42 38 Z'/%3E%3Cpath transform='rotate(18 205 40)' d='M190 55 L212 25'/%3E%3Cpath transform='rotate(18 205 40)' d='M212 25 L207 29 M212 25 L209 32 M212 25 L202 25'/%3E%3Crect x='60' y='150' width='20' height='16' rx='2' transform='rotate(-8 70 158)'/%3E%3Cpath transform='rotate(-8 70 158)' d='M80 154 q7 0 7 7 q0 7 -7 7'/%3E%3Cpath d='M150 200 l3 7 l7 1 l-5 5 l1 7 l-6 -4 l-6 4 l1 -7 l-5 -5 l7 -1 Z'/%3E%3Cpath d='M225 130 q10 -14 20 0 q-6 -2 -10 3 q-4 -5 -10 -3 Z'/%3E%3Cpath d='M100 90 q8 -10 16 -2 q-9 0 -12 8 q-2 -8 -4 -6 Z'/%3E%3Cpath transform='rotate(25 40 110)' d='M35 105 L45 105 L45 122 L40 118 L35 122 Z' fill='%23B08D57' stroke='none' opacity='0.6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 100% 100%, 4px 4px, 260px 260px;
  background-attachment: fixed, fixed, scroll;
  color: var(--text);
  font-family: 'Lora', serif;
}
.shelf:nth-child(even) {
  background: rgba(255,255,255,0.5);
}
a{
  color: var(--parchment);
  text-decoration: none;
}
nav a:hover{
  color: var(--gold);
}
header input{
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  outline: none;
  font-family: 'Lora' , serif;
}
.brand img{
  height: 34px;
  width:auto;
}
.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 600;
}
.promo-bar {
  background: var(--wine);
  color: var(--parchment);
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 0;
  font-family: 'Lora', serif;
}
.hero-banner {
  position: relative;
  overflow: hidden;
  padding: 130px 40px;
  background-size: cover;
  background-position: center;
  animation: bannerRotate 20s infinite;
}
.hero-banner::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(176,141,87,0.35) 0%, transparent 70%);
  z-index: 1;
  pointer-events: none;
}
.hero-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(31, 35, 51, 0.65);
}
.hero-text {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
  color: white;
}
.hero-text .eyebrow { color: var(--gold); }
.hero-text p { color: rgba(255,255,255,0.9); }
@keyframes bannerRotate {
  0%   { background-image: url('https://images.unsplash.com/photo-1499447155021-4907f71b9ef5?w=1600&q=80'); }
  25%  { background-image: url('https://images.unsplash.com/photo-1573592371950-348a8f1d9f38?w=1600&q=80'); }
  50%  { background-image: url('https://images.unsplash.com/photo-1622010652810-eba11f92f90f?w=1600&q=80'); }
  75%  { background-image: url('https://images.unsplash.com/photo-1518373714866-3f1478910cc0?w=1600&q=80'); }
  100% { background-image: url('https://images.unsplash.com/photo-1499447155021-4907f71b9ef5?w=1600&q=80'); }
}
.btn {
  display: inline-block;
  background: var(--wine);
  color: var(--parchment);
  padding: 14px 32px;
  border-radius: 4px;
  font-weight: 600;
}
.featured {
  padding: 60px 40px;
  max-width: 1100px;
  margin: 0 auto;
}
.featured h2 {
  text-align: center;
  margin-bottom: 40px;
}
.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 700px;
  margin: 0 auto;
}
.book-card {
  background: white;
  padding: 16px;
  border-radius: 6px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.book-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 20px rgba(0,0,0,0.15);
}
.book-card img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  background: #f0ebe0;
  border-radius: 4px;
  margin-bottom: 12px;
}
.book-card h3 {
  font-size: 1rem;
  margin: 0 0 4px;
}
.author {
  color: var(--text);
  font-size: 0.85rem;
  margin: 0 0 6px;
}
.rating {
  color: var(--gold);
  margin-bottom: 8px;
}
.price del {
  color: #999;
  font-size: 0.85rem;
  margin-right: 8px;
}
.new-price {
  color: var(--wine);
  font-weight: 700;
  font-size: 1.1rem;
}
.intro {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: introFade 2.5s ease forwards;
}
.intro-content {
  text-align: center;
  color: var(--gold);
}
.intro-content svg {
  opacity: 0;
  animation: popIn 0.7s ease forwards;
}
.intro-content p {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  margin-top: 12px;
  letter-spacing: 2px;
  opacity: 0;
  animation: popIn 0.7s ease forwards;
  animation-delay: 0.3s;
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes introFade {
  0%   { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
.genres {
  padding: 60px 40px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.genres h2 {
  margin-bottom: 40px;
}
.genre-grid {
  display: flex;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
}
.genre-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.genre-card p {
  font-weight: 600;
  font-size: 0.9rem;
}
.genre-icon {
  font-size: 2.4rem;
  display: block;
  transition: transform 0.2s ease;
}
.genre-card:hover .genre-icon {
  transform: scale(1.15);
}
.genres {
  position: relative;
}
.genres::before,
.genres::after {
  content: "❦";
  position: absolute;
  font-size: 2rem;
  color: var(--gold);
  opacity: 0.5;
}
.genres::before {
  top: 10px;
  left: 20px;
}
.genres::after {
  top: 10px;
  right: 20px;
}
footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
  background: var(--ink);
  color: var(--parchment);
  padding: 50px 40px;
  margin-top: 60px;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-brand {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  color: var(--gold);
  margin: 0 0 6px;
}
footer h4 {
  color: var(--gold);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 4px;
}
footer a:hover {
  color: var(--gold);
}
.cart-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 60px 40px;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.cart-item img {
  width: 70px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
}
.cart-item-info {
  flex: 1;
}
.qty-control {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.qty-control button {
  width: 28px;
  height: 28px;
  border: 1px solid #ccc;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.cart-summary {
  margin-top: 30px;
  background: white;
  padding: 24px;
  border-radius: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  color: var(--text);
}

.summary-row.total {
  border-top: 2px solid var(--ink);
  margin-top: 10px;
  padding-top: 14px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.cart-summary .btn {
  display: block;
  text-align: center;
  margin-top: 16px;
}
.auth-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 40px;
}

.auth-box {
  background: white;
  padding: 40px 30px;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
}
.catalog-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 60px 40px;
}
.filter-chips {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0 40px;
}
.chip {
  padding: 8px 18px;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
}
.chip.active {
  background: var(--ink);
  color: var(--parchment);
  border-color: var(--ink);
}
.catalog-grid {
  grid-template-columns: repeat(3, 1fr);
  max-width: 100%;
}
.book-card {
  position: relative;
}
.genre-tag {
  position: absolute;
  top: 24px;
  left: 24px;
  background: var(--wine);
  color: white;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.page-subtitle {
  color: var(--text);
  margin-top: -30px;
  margin-bottom: 40px;
}
.rank-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  background: var(--gold);
  color: var(--ink);
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 12px;
}
.ebook-badge {
  position: absolute;
  top: 24px;
  left: 24px;
  background: var(--ink);
  color: var(--parchment);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.about-page {
  max-width: 650px;
  margin: 0 auto;
  padding: 70px 40px;
  text-align: center;
}
.about-page p {
  text-align: left;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 20px;
}
.about-stats {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin: 40px 0;
}
.stat h3 {
  color: var(--wine);
  font-size: 1.8rem;
  margin-bottom: 4px;
}
.stat p {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text);
}
.wishlist-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 60px 40px;
}
.wishlist-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.wishlist-item img {
  width: 70px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
}
.wishlist-item-info {
  flex: 1;
}
.wishlist-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-small {
  padding: 8px 16px;
  font-size: 0.8rem;
  text-align: center;
}
.remove-btn {
  background: none;
  border: 1px solid #ccc;
  color: var(--text);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}
.remove-btn:hover {
  border-color: var(--wine);
  color: var(--wine);
}
.shelf {
  max-width: 1100px;
  margin: 0 auto;
  padding: 50px 40px;
}
.shelf h2 {
  margin-bottom: 24px;
}
.shelf-row {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.shelf-row .book-card {
  flex: 0 0 200px;
}
.trust-strip {
  display: flex;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
  padding: 50px 40px;
  background: white;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.trust-icon {
  font-size: 2rem;
}
.trust-item p {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}
.trust-item span {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text);
}
.newsletter {
  background: var(--ink);
  color: var(--parchment);
  text-align: center;
  padding: 60px 40px;
}
.newsletter h2 {
  color: var(--gold);
}
.newsletter p {
  margin-bottom: 24px;
}
.newsletter-form {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.newsletter-form input {
  padding: 12px 16px;
  border: none;
  border-radius: 4px;
  font-family: 'Lora', serif;
  min-width: 260px;
  outline: none;
}
.newsletter-form .btn {
  border: none;
  cursor: pointer;
}
.summary-row.discount span:last-child {
  color: #2e7d32;
}
.rating-num {
  font-size: 0.75rem;
  color: var(--text);
  font-family: 'Lora', serif;
}
.filter-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.filter-chips .chip {
  cursor: pointer;
  user-select: none;
}
#filter-fantasy:checked ~ .book-grid .book-card:not(.fantasy),
#filter-mystery:checked ~ .book-grid .book-card:not(.mystery),
#filter-romance:checked ~ .book-grid .book-card:not(.romance),
#filter-adventure:checked ~ .book-grid .book-card:not(.adventure),
#filter-horror:checked ~ .book-grid .book-card:not(.horror) {
  display: none;
}
#filter-all:checked ~ .filter-chips label[for="filter-all"],
#filter-fantasy:checked ~ .filter-chips label[for="filter-fantasy"],
#filter-mystery:checked ~ .filter-chips label[for="filter-mystery"],
#filter-romance:checked ~ .filter-chips label[for="filter-romance"],
#filter-adventure:checked ~ .filter-chips label[for="filter-adventure"],
#filter-horror:checked ~ .filter-chips label[for="filter-horror"] {
  background: #2b2140;
  color: #fff;
  border-color: #2b2140;
}