/* ============================================
   VINTAGE PAGES BOOKSTORE — Antique Book Aesthetic
   Aged cream, deep brown leather, gold/sepia accents.
   Like browsing the pages of a beautiful antique volume.
   ============================================ */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;1,400;1,600&family=Inter:wght@400;500;600&display=swap');

/* ============================================
   ROOT & BASE STYLES
   ============================================ */

:root {
  /* Antique Book Palette */
  --color-cream: #FFF8E7;           /* Aged book page background */
  --color-ivory: #FFFEF5;           /* Lightest background */
  --color-parchment: #F5EFE0;       /* Accent / card backgrounds */
  --color-parchment-border: #E8D9C0; /* Subtle borders */
  --color-deep-brown: #5C4033;      /* Old leather bindings, primary text */
  --color-dark-brown: #3E2B1E;      /* Darker text / footer */
  --color-gold: #C4A574;            /* Aged gold accents */
  --color-gold-rich: #B8860B;       /* Deep gold highlights */
  --color-gold-light: #D4AF37;      /* Bright gold */
  --color-rust: #8B6F47;            /* Muted rust / secondary accent */
  --color-rust-warm: #A0826D;       /* Warm rust hover */
  --color-charcoal: #2C2C2C;        /* Readable dark text */
  --color-muted: #7A5C3E;           /* Muted warm text */
  --color-white: #FFFEF5;           /* Off-white */

  /* Legacy aliases — keep for any JS references */
  --color-burgundy: #5C4033;
  --color-burnt-orange: #C4A574;
  --color-light-bg: #F5EFE0;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--color-deep-brown);
  background-color: var(--color-cream);
}

/* Subtle aged paper texture overlay applied via body pseudo-element */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.35;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-deep-brown);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
}

p {
  line-height: 1.7;
  color: var(--color-deep-brown);
}

a {
  color: var(--color-deep-brown);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-gold);
}

/* ============================================
   SKIP LINK — visually hidden until focused
   ============================================ */

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 100;
  background-color: var(--color-deep-brown);
  color: var(--color-cream);
  padding: 0.75rem 1.5rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border: 2px solid var(--color-gold);
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   BUTTONS & FORMS
   ============================================ */

.btn-primary {
  background-color: var(--color-deep-brown);
  color: var(--color-cream);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  display: inline-block;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: var(--color-dark-brown);
  color: var(--color-gold);
}

.btn-outline {
  border: 1px solid var(--color-gold);
  color: var(--color-deep-brown);
  background-color: transparent;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  display: inline-block;
  text-decoration: none;
}

.btn-outline:hover {
  background-color: var(--color-deep-brown);
  color: var(--color-cream);
  border-color: var(--color-deep-brown);
}

input,
textarea,
select {
  font-family: 'Inter', sans-serif;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-parchment-border);
  border-radius: 0.25rem;
  background-color: var(--color-ivory);
  transition: border-color 0.15s ease;
  color: var(--color-deep-brown);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 2px rgba(196, 165, 116, 0.18);
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background-color: var(--color-parchment);
  border-radius: 0.125rem;
  border: 1px solid var(--color-parchment-border);
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(92, 64, 51, 0.10);
}

/* Product card — gallery style, antique book pages */
.product-card {
  background-color: var(--color-parchment);
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--color-parchment-border);
  transition: box-shadow 0.2s ease;
  position: relative;
}

.product-card:hover {
  box-shadow: 0 6px 24px rgba(92, 64, 51, 0.14);
}

.product-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.product-card-body {
  padding: 1rem 1.25rem 1.25rem;
  background-color: var(--color-parchment);
}

.product-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-deep-brown);
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.product-card-author {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.product-card-price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-deep-brown);
  margin-bottom: 0.875rem;
}

/* ============================================
   CART DRAWER
   ============================================ */

.cart-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background-color: var(--color-parchment);
  box-shadow: -2px 0 20px rgba(92, 64, 51, 0.18);
  transition: right 0.3s ease;
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.cart-drawer.open {
  right: 0;
}

.cart-drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-parchment-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-deep-brown);
}

.cart-drawer-header h2 {
  color: var(--color-cream);
}

.cart-drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-cream);
  padding: 0;
  transition: color 0.15s ease;
}

.cart-drawer-close:hover {
  color: var(--color-gold);
}

.cart-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background-color: var(--color-parchment);
}

.cart-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-parchment-border);
}

.cart-item-img {
  width: 80px;
  height: 100px;
  object-fit: cover;
  border-radius: 0;
  flex-shrink: 0;
  border: 1px solid var(--color-parchment-border);
}

.cart-item-details {
  flex: 1;
}

.cart-item-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--color-deep-brown);
}

.cart-item-qty {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0;
}

.cart-item-qty button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--color-gold);
  background-color: var(--color-cream);
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-deep-brown);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.cart-item-qty button:hover {
  background-color: var(--color-gold);
  color: var(--color-cream);
}

.cart-drawer-footer {
  border-top: 1px solid var(--color-parchment-border);
  padding: 1.5rem;
  background-color: var(--color-cream);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-deep-brown);
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(62, 43, 30, 0.50);
  z-index: 40;
}

.modal-overlay.open {
  display: block;
}

.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--color-parchment);
  border-radius: 0.125rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 20px 60px rgba(62, 43, 30, 0.22);
  border: 1px solid var(--color-parchment-border);
}

.modal.open {
  display: block;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-deep-brown);
  padding: 0;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--color-gold);
}

/* ============================================
   NAVIGATION — Deep brown with gold highlights
   ============================================ */

.site-nav {
  background-color: var(--color-deep-brown);
  border-bottom: 1px solid rgba(196, 165, 116, 0.25);
}

/* ============================================
   HERO SECTION — High-resolution vintage book photography
   ============================================ */

.hero-image-section {
  position: relative;
  min-height: 85vh;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Dark overlay for text readability — 42% flat + a bottom-anchored gradient
   so contrast doesn't depend on which part of the photo sits behind the text */
.hero-image-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(20, 12, 6, 0.20) 0%, rgba(20, 12, 6, 0.42) 45%, rgba(20, 12, 6, 0.68) 100%),
    rgba(20, 12, 6, 0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 4rem 0;
}

.hero-image-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
}

.hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #C4A574;
  margin-bottom: 1.5rem;
  font-family: 'Inter', sans-serif;
}

.hero-image-heading {
  font-family: 'Playfair Display', serif;
  color: #FFF8E7;
  font-size: 4rem;
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.hero-image-subtext {
  color: rgba(255, 248, 231, 0.88);
  font-size: 1.125rem;
  margin-bottom: 2.25rem;
  line-height: 1.65;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

/* Gold CTA button */
.hero-btn-gold {
  display: inline-block;
  background-color: #C4A574;
  color: #3E2B1E;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.875rem 2rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.hero-btn-gold:hover {
  background-color: #D4AF37;
  color: #3E2B1E;
}

/* Ghost outline button for secondary CTA */
.hero-btn-ghost {
  display: inline-block;
  background-color: transparent;
  color: #FFF8E7;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.875rem 2rem;
  text-decoration: none;
  border: 1.5px solid rgba(196, 165, 116, 0.65);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.hero-btn-ghost:hover {
  border-color: #C4A574;
  background-color: rgba(196, 165, 116, 0.12);
  color: #FFF8E7;
}

@media (max-width: 768px) {
  .hero-image-section {
    min-height: 70vh;
  }
  .hero-image-heading {
    font-size: 2.5rem;
  }
  .hero-image-subtext {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-image-heading {
    font-size: 2rem;
  }
  .hero-btn-gold,
  .hero-btn-ghost {
    width: 100%;
    text-align: center;
  }
}

/* ============================================
   SECTION STYLES — Antique book parchment tones
   ============================================ */

.section-light {
  background-color: var(--color-cream);
  padding: 6rem 2rem;
}

.section-white {
  background-color: var(--color-ivory);
  padding: 6rem 2rem;
}

.section-subtle {
  background-color: var(--color-parchment);
  padding: 6rem 2rem;
}

/* Dark section — deep brown leather cover */
.section-dark {
  background-color: var(--color-deep-brown);
  padding: 6rem 2rem;
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark p {
  color: var(--color-cream);
}

/* Section heading */
.section-heading {
  margin-bottom: 0.75rem;
  font-family: 'Playfair Display', serif;
  color: var(--color-deep-brown);
}

/* Eyebrow text — gold/sepia uppercase label */
.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 0.875rem;
  font-family: 'Inter', sans-serif;
}

.section-subtext {
  color: var(--color-muted);
  font-size: 1rem;
  max-width: 480px;
  line-height: 1.65;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

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

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1280px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

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

/* ============================================
   BADGE & LABELS — Antique-toned
   ============================================ */

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 0.125rem;
  background-color: var(--color-parchment-border);
  color: var(--color-deep-brown);
  border: 1px solid var(--color-parchment-border);
}

.badge-success {
  background-color: #D1FAE5;
  color: #065F46;
  border-color: #A7F3D0;
}

.badge-warning {
  background-color: #FEF3C7;
  color: #92400E;
  border-color: #FDE68A;
}

.badge-danger {
  background-color: #FEE2E2;
  color: #991B1B;
  border-color: #FECACA;
}

/* ============================================
   UTILITY
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none; }
.opacity-50 { opacity: 0.5; }

.out-of-stock {
  opacity: 0.55;
  filter: grayscale(60%);
}

/* ============================================
   MOBILE CART RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
  .cart-drawer {
    width: 100%;
    right: -100%;
  }
}

/* ============================================
   FOOTER — Deep brown leather with gold accents
   ============================================ */

.site-footer {
  background-color: var(--color-dark-brown);
  color: rgba(255, 248, 231, 0.70);
}

.site-footer a:hover {
  color: var(--color-gold);
}

/* ============================================
   ANTIQUE DECORATIVE ELEMENTS
   ============================================ */

/* Gold rule / divider */
.gold-rule {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-gold), transparent);
  opacity: 0.5;
  margin: 2rem 0;
}

/* Parchment panel — like an aged book page insert */
.parchment-panel {
  background-color: var(--color-parchment);
  border: 1px solid var(--color-parchment-border);
  border-left: 3px solid var(--color-gold);
  padding: 1.5rem;
}

/* Pull quote style */
.pull-quote {
  border-left: 2px solid var(--color-gold);
  padding: 0.75rem 1.5rem;
  margin: 2rem 0;
  background-color: var(--color-parchment);
}

.pull-quote p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--color-deep-brown);
}

/* ============================================
   LOGO STYLES
   ============================================ */

/* Navbar logo image */
.nav-logo-img {
  height: 46px;
  width: auto;
  object-fit: contain;
  display: block;
  /* Preserve transparent PNG background */
  background: transparent;
}

/* Footer logo image (slightly smaller) */
.footer-logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
  background: transparent;
}

/* Responsive: scale down on small screens */
@media (max-width: 640px) {
  .nav-logo-img {
    height: 38px;
  }
  .footer-logo-img {
    height: 34px;
  }
}


/* ============================================
   TOUCH DEVICE: always show card overlay
   ============================================ */
@media (hover: none) {
  .card-action-overlay {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    display: flex !important;
  }
}

.wishlist-btn {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  background: rgba(255, 254, 245, 0.92);
  border: 1px solid #E8D9C0;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background 0.15s ease;
}
.wishlist-btn:hover {
  background: #FFF8E7;
}
