/* ============================================================
   PerfectNotebook — style.css
   Palette:
     --ink         #1a2340   deep navy — headings, nav, footer
     --page-bg     #f5f7fc   cool off-white — page background
     --blue        #2563eb   rich blue — primary CTA, links, hover
     --blue-dark   #1a4fc7   blue hover/active state
     --blue-light  #dbeafe   blue tint — badges, pill bg
     --sapphire    #1e3a8a   deep blue — footer, dark sections
     --amber       #d97706   warm amber — prices, star ratings
     --amber-light #fef3c7   amber tint — sale badge bg
     --slate       #64748b   body text
     --silver      #e2e8f0   borders, dividers
     --cloud       #f1f5f9   card bg, section bg
     --muted       #94a3b8   secondary text, captions
============================================================ */

/* ── GOOGLE FONTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@400;500;600;700&display=swap');

/* ── TOKENS ───────────────────────────────────────────────── */
:root {
  --ink:          #1a2340;
  --parchment:    #f5f7fc;
  --blue:         #2563eb;
  --blue-dark:    #1a4fc7;
  --blue-light:   #dbeafe;
  --sapphire:     #1e3a8a;
  --amber:        #d97706;
  --amber-dark:   #b45309;
  --amber-light:  #fef3c7;
  --slate:        #475569;
  --silver:       #e2e8f0;
  --cloud:        #f1f5f9;
  --muted:        #94a3b8;
  --white:        #ffffff;
  /* legacy aliases so every old var() still resolves */
  --gold:         #d97706;
  --gold-dark:    #b45309;
  --walnut:       #2563eb;
  --forest:       #16a34a;
  --stone:        #e2e8f0;
  --cream:        #f1f5f9;
  --body-text:    #475569;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 2px 16px rgba(26,35,64,.07);
  --shadow-md:    0 8px 32px rgba(26,35,64,.13);
}

/* ── BASE ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--parchment);
  color: var(--slate);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--ink);
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── NAVBAR ───────────────────────────────────────────────── */
.navbar {
  background: var(--white) !important;
  border-bottom: 1px solid var(--silver);
  box-shadow: 0 1px 12px rgba(26, 35, 64, .07);
}

.navbar-brand {
  font-family: 'Source Serif 4', serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink) !important;
}

.nav-link {
  font-weight: 500;
  color: var(--body-text) !important;
  font-size: .92rem;
  transition: color .18s;
}

.nav-link:hover {
  color: var(--blue) !important;
}

.navbar .btn-outline-dark {
  border-color: var(--silver);
  color: var(--ink);
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 600;
  transition: all .2s;
}

.navbar .btn-outline-dark:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

/* Cart badge */
.cart-count {
  font-size: .65rem;
  background: var(--blue);
  color: var(--white);
  border-radius: 50px;
  padding: 1px 5px;
  margin-left: -6px;
  margin-top: -10px;
  vertical-align: top;
  display: inline-block;
  position: relative;
  top: -10px;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn-primary-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue);
  color: var(--white);
  font-weight: 700;
  font-size: .92rem;
  padding: 12px 28px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all .22s;
  letter-spacing: .01em;
}

.btn-primary-gold:hover {
  background: var(--blue-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, .32);
}

.btn-outline-ink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: .92rem;
  padding: 12px 28px;
  border-radius: 50px;
  border: 1.5px solid var(--ink);
  cursor: pointer;
  transition: all .22s;
}

.btn-outline-ink:hover {
  background: var(--ink);
  color: var(--white);
}

.btn-lg-cta {
  font-size: 1rem;
  padding: 14px 36px;
}

/* ── SECTION UTILITY ──────────────────────────────────────── */
.sec-head {
  text-align: center;
  margin-bottom: 48px;
}

.sec-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--blue);
  background: var(--blue-light);
  border: 1px solid #bfdbfe;
  padding: 5px 16px;
  border-radius: 50px;
  margin-bottom: 14px;
}

.sec-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
  text-align: center;
}

.gold-span {
  color: var(--blue);
  font-style: italic;
}

.sec-sub {
  color: var(--muted);
  font-size: .97rem;
  max-width: 520px;
  margin: 0 auto;
}

/* ── HERO SECTION ─────────────────────────────────────────── */
.hero-section {
  background: var(--white);
  padding: 80px 0 72px;
  border-bottom: 1px solid var(--silver);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--blue);
  background: var(--blue-light);
  border: 1px solid #bfdbfe;
  padding: 6px 16px;
  border-radius: 50px;
  margin-bottom: 20px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  display: inline-block;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 18px;
}

.hero-accent {
  font-style: italic;
  color: var(--blue);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 460px;
  margin-bottom: 30px;
  line-height: 1.75;
}

.hero-btns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid #bfdbfe;
  padding: 5px 14px;
  border-radius: 50px;
}

.trust-pill-green {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.hero-img-wrap {
  position: relative;
}

.hero-img {
  width: 100%;
  border-radius: 20px;
  object-fit: cover;
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-md);
}

.hero-img-badge {
  position: absolute;
  bottom: 20px;
  left: -16px;
  background: var(--white);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 50px;
  box-shadow: 0 4px 16px rgba(28, 25, 23, .14);
  border: 1px solid var(--silver);
}

.hero-img-badge strong {
  color: var(--blue);
  font-weight: 700;
}

/* ── CATEGORIES ───────────────────────────────────────────── */
.categories-section {
  background: var(--white);
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--silver);
}

.cat-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.cat-pill {
  display: inline-block;
  font-size: .84rem;
  font-weight: 600;
  color: var(--body-text);
  background: var(--parchment);
  border: 1.5px solid var(--silver);
  padding: 8px 20px;
  border-radius: 50px;
  transition: all .2s;
}

.cat-pill:hover,
.cat-pill.active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

/* ── FEATURED PRODUCTS ────────────────────────────────────── */
.featured-section {
  padding: 80px 0;
  background: var(--parchment);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--silver);
  overflow: hidden;
  transition: all .24s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue);
}

.product-card-img-link {
  display: block;
  position: relative;
  overflow: hidden;
}

.product-card-img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  transition: transform .35s;
  display: block;
}

.product-card:hover .product-card-img {
  transform: scale(1.04);
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 12px;
  border-radius: 50px;
}

.product-badge-new {
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid #bfdbfe;
}

.product-badge-sale {
  background: var(--amber-light);
  color: var(--amber);
  border: 1px solid #fde68a;
}

.product-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.product-title a {
  color: var(--ink);
}

.product-title a:hover {
  color: var(--blue);
}

.product-desc {
  font-size: .84rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 14px;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price-current {
  font-size: 1rem;
  font-weight: 700;
  color: var(--amber);
}

.price-old {
  font-size: .84rem;
  color: var(--muted);
  text-decoration: line-through;
}

.btn-card-view {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--silver);
  padding: 7px 16px;
  border-radius: 50px;
  transition: all .2s;
  white-space: nowrap;
}

.btn-card-view:hover {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}

/* ── STORY SECTION ────────────────────────────────────────── */
.story-section {
  padding: 88px 0;
  background: var(--cream);
  border-top: 1px solid var(--silver);
  border-bottom: 1px solid var(--silver);
}

.story-img-wrap {
  position: relative;
}

.story-img {
  width: 100%;
  border-radius: 20px;
  object-fit: cover;
  aspect-ratio: 5/4;
  box-shadow: var(--shadow-md);
}

.story-img-tag {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: var(--white);
  color: var(--blue);
  font-size: .75rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid #bfdbfe;
}

.story-content {
  padding-left: 8px;
}

.story-body {
  font-size: .98rem;
  color: var(--body-text);
  line-height: 1.82;
  margin-bottom: 18px;
}

.story-stats {
  display: flex;
  gap: 28px;
  padding: 20px 0;
  margin-bottom: 24px;
  border-top: 1px solid var(--silver);
  border-bottom: 1px solid var(--silver);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-item strong {
  font-family: 'Source Serif 4', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
}

.stat-item span {
  font-size: .8rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── NEWSLETTER ───────────────────────────────────────────── */
.newsletter-section {
  background: var(--sapphire);
  padding: 72px 0;
}

.newsletter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  flex-wrap: wrap;
}

.newsletter-text h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  color: var(--white);
  margin-bottom: 6px;
}

.newsletter-text p {
  color: rgba(255, 255, 255, .55);
  font-size: .92rem;
  margin: 0;
}

.newsletter-form {
  flex: 1;
  max-width: 460px;
}

.nl-field-wrap {
  display: flex;
  gap: 0;
  border: 1.5px solid rgba(255, 255, 255, .15);
  border-radius: 50px;
  overflow: hidden;
  background: rgba(255, 255, 255, .07);
  margin-bottom: 8px;
}

.nl-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 20px;
  color: var(--white);
  font-size: .92rem;
  font-family: 'Inter', sans-serif;
}

.nl-input::placeholder {
  color: rgba(255, 255, 255, .38);
}

.nl-input:focus {
  box-shadow: none;
}

.nl-btn {
  background: var(--amber);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  transition: background .2s;
  border-radius: 0 50px 50px 0;
  white-space: nowrap;
}

.nl-btn:hover {
  background: var(--amber-dark);
}

.nl-note {
  font-size: .74rem;
  color: rgba(255, 255, 255, .3);
  margin: 0;
  padding-left: 4px;
}

/* ── CARDS (Bootstrap override) ───────────────────────────── */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--silver);
  background: var(--white);
  transition: transform .22s, box-shadow .22s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-img-top {
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

/* ── FOOTER ───────────────────────────────────────────────── */
footer {
  background: var(--sapphire);
  color: rgba(255, 255, 255, .55);
  padding: 52px 0 32px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

footer h5,
footer h6 {
  color: var(--white);
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  margin-bottom: 14px;
}

footer a {
  color: rgba(255, 255, 255, .55);
  transition: color .18s;
}

footer a:hover {
  color: var(--amber);
}

footer hr {
  border-color: rgba(255, 255, 255, .08);
}

footer .small {
  font-size: .8rem;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 991px) {
  .hero-section {
    padding: 56px 0 52px;
  }
  
  .hero-img-badge {
    left: 0;
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .story-content {
    padding-left: 0;
  }
  
  .newsletter-inner {
    flex-direction: column;
    text-align: center;
  }
  
  .newsletter-form {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }
  
  .story-stats {
    gap: 18px;
    flex-wrap: wrap;
  }
  
  .stat-item {
    flex: 1;
    min-width: 100px;
  }
}

@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-btns {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .hero-section {
    padding: 40px 0 36px;
  }
  
  .nl-field-wrap {
    flex-direction: column;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .07);
  }
  
  .nl-input {
    padding: 14px 18px;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }
  
  .nl-btn {
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 14px 24px;
  }
  
  .footer .col-md-4 {
    margin-bottom: 24px;
  }
}

/* ── UTILITY OVERRIDES ────────────────────────────────────── */
.btn-primary-custom {
  background: var(--blue);
  color: var(--white);
  border: none;
}

.btn-primary-custom:hover {
  background: var(--blue-dark);
  color: var(--white);
}

/* ── ADDITIONAL FIXES ────────────────────────────────────── */
/* Fix for any missing hover states */
.btn-primary-gold:focus,
.btn-primary-custom:focus {
  outline: 2px solid var(--blue-light);
  outline-offset: 2px;
}

/* Ensure images don't break layout */
img {
  height: auto;
}

/* Fix for empty state spacing */
.empty-state + .empty-state {
  margin-top: 0;
}