* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
}

body {
  background: #f8fafc;
  color: #0f172a;
}

/* HEADER */
:root {
  --primary: #4f46e5;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

.smart-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrolled state via JS */
.smart-header.shrink {
  box-shadow: var(--shadow);
  transform: translateY(-5px);
  /* Moves up slightly to hide top padding */
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.header-main {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

/* LOGO */
.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  /* Space between SVG and Text */
}

.logo-svg {
  width: 32px;
  /* Control size here */
  height: 32px;
  color: var(--primary);
  /* Inherits your brand blue */
  transition: transform 0.3s ease;
}

/* Subtle hover effect for the logo specifically */
.logo:hover .logo-svg {
  transform: rotate(-5deg) scale(1.1);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
  line-height: 1;
}

.text-accent {
  color: var(--primary);
}

/* SEARCH BAR REDESIGN */
.search-container {
  flex: 1;
  max-width: 600px;
  position: relative;
}

.search-bar {
  display: flex;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 4px;
  transition: all 0.2s;
}

.search-bar:focus-within {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.search-bar input {
  border: none;
  background: transparent;
  padding: 10px 16px;
  flex: 1;
  outline: none;
  font-size: 0.95rem;
}

.category-dropdown {
  border-right: 1px solid #e2e8f0;
  padding-right: 8px;
}

.category-dropdown select {
  border: none;
  background: transparent;
  padding: 10px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  outline: none;
}

.search-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 0.2s;
}

.search-btn:hover {
  opacity: 0.9;
}

/* ACTIONS */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-link,
.cart-btn {
  color: var(--text-dark);
  padding: 10px;
  border-radius: 50%;
  transition: background 0.2s;
  position: relative;
  text-decoration: none;
}

.action-link:hover,
.cart-btn:hover {
  background: #f1f5f9;
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

/* NAVIGATION */
.nav-bar {
  border-top: 1px solid rgba(0, 0, 0, 0.03);
}

.nav-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  gap: 32px;
}

.nav-content a {
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-content a:hover {
  color: var(--primary);
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 1024px) {
  .search-container {
    display: none;
  }

  .hide-mobile {
    display: none;
  }
}


/* HERO */
.hero-classic {
  padding: 100px 20px;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
}

.hero-inner {
  max-width: 1200px;
  margin: auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: #e0e7ff;
  padding: 6px 16px;
  border-radius: 20px;
  color: #1e40af;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-content h1 {
  font-size: 48px;
  margin-bottom: 20px;
}

.hero-content span {
  color: #2563eb;
}

.hero-content p {
  font-size: 18px;
  color: #475569;
  margin-bottom: 30px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.btn-primary {
  background: #2563eb;
  color: white;
  padding: 14px 34px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
}

.btn-outline {
  border: 2px solid #2563eb;
  color: #2563eb;
  padding: 14px 34px;
  border-radius: 15px;
  text-decoration: none;
  font-weight: 700;
}

.hero-visual img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.2);
}

/* SECTION TITLE */


/* CATEGORIES */
.category-section {
  padding: 80px 20px;
  background: white;
}

.category-grid {
  max-width: 1200px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
}

.category-card {
  padding: 40px;
  background: #eef2ff;
  border-radius: 16px;
  text-align: center;
  font-weight: 700;
}


:root {
  --primary-blue: #2563eb;
  --accent-red: #ef4444;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --bg-card: #ffffff;
}

.books-gallery {
  padding: 100px 0;
  background-color: #fcfcfd;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-header {
  margin-bottom: 50px;
}

.gallery-title {
  font-size: clamp(24px, 4vw, 32px);
  color: var(--text-main);
  font-weight: 800;
  margin-bottom: 8px;
}

.gallery-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* GRID SYSTEM */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 40px 30px;
}

/* CARD ARCHITECTURE */
.book-card {
  background: var(--bg-card);
  border-radius: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  /* Remove any "hidden" or "transform" entry states */
  opacity: 1;
  transform: none;
  border: 1px solid #f1f5f9;
  transition: all 0.3s ease;
  /* Global transition for hover smoothness */
}

.book-card:hover {
  transform: translateY(-10px);
}

/* MEDIA & OVERLAYS */
.book-media {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  border-radius: 16px;
  background: #f1f5f9;
  padding: 10px;
}

.book-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.book-card:hover .book-media img {
  transform: scale(1.08);
}

.wishlist-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  background: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 5;
  color: #cbd5e1;
  transition: all 0.3s;
}

.wishlist-toggle:hover {
  color: var(--accent-red);
  transform: scale(1.1);
}

.badge-discount {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent-red);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  z-index: 5;
}

/* INFO BLOCK */
.book-info {
  padding: 20px 5px;
}

.category-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-blue);
  font-weight: 700;
}

.book-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 6px 0 2px;
  color: var(--text-main);
}

.book-writer {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.price-wrapper {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.current-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.strike-price {
  color: var(--text-muted);
  text-decoration: line-through;
  font-size: 0.9rem;
}

/* BUTTONS */
.add-to-cart-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.book-card:hover .add-to-cart-btn {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

/* PAGINATION AREA */
.pagination-area {
  margin-top: 60px;
  text-align: center;
}

.btn-show-more {
  background: white;
  color: var(--text-main);
  border: 2px solid #e2e8f0;
  padding: 16px 40px;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s;
}

.btn-show-more:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background: #eff6ff;
}

/* FOOTER */
/* ================= FOOTER ================= */
.site-footer {
  background: #0f172a;
  color: #e5e7eb;
  margin-top: 10px;
}

.footer-container {
  max-width: 1300px;
  margin: auto;
  padding: 30px 24px 30px;
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 50px;
}

/* Brand */
.footer-logo {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
}

.footer-logo span { color: #4f46e5; }

.footer-desc {
  color: #9ca3af;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 14px 0 20px;
  max-width: 340px;
}

/* Newsletter */
.newsletter-form {
  display: flex;
  margin-bottom: 18px;
}

.newsletter-form input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  outline: none;
  border-radius: 8px 0 0 8px;
}

.newsletter-form button {
  background: #4f46e5;
  color: white;
  border: none;
  padding: 0 18px;
  border-radius: 0 8px 8px 0;
  font-weight: 700;
  cursor: pointer;
}

/* Social Icons */
.social-icons {
  display: flex;
  gap: 14px;
}

.social-icons a {
  width: 40px;
  height: 40px;
  background: #1e293b;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: transform 0.3s, background 0.3s;
}

.social-icons svg {
  width: 18px;
  height: 18px;
  fill: #e5e7eb;
}

.social-icons a:hover {
  background: #4f46e5;
  transform: translateY(-3px);
}

/* Links */
.footer-col h4 {
  margin-bottom: 16px;
  color: #fff;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-col ul li a:hover {
  color: #fff;
}

/* Bottom */
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  padding: 18px;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Responsive */
@media (max-width: 900px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form input,
  .newsletter-form button {
    border-radius: 8px;
  }

  .newsletter-form button {
    margin-top: 10px;
  }

  .social-icons {
    justify-content: center;
  }
}


/* ========================end================ */


/* RESPONSIVE */
@media (max-width: 992px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }
}


/* ============= function ==============*/

/* ===== LIVE SEARCH SUGGESTIONS ===== */
.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  list-style: none;
  padding: 8px 0;
  margin: 0;
  display: none;
  z-index: 2000;
  max-height: 320px;
  overflow-y: auto;
}

.search-suggestions li {
  padding: 12px 18px;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.search-suggestions li:hover {
  background: #f1f5f9;
}

.search-suggestions .title {
  font-weight: 600;
  color: #0f172a;
}

.search-suggestions .category {
  font-size: 0.75rem;
  background: #e0e7ff;
  color: #3730a3;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.search-suggestions li {
  cursor: pointer;
  user-select: none;
}


/* ===== CART PAGE STYLES ===== */

.cart-item {
  display: flex;
  gap: 20px;
  background: white;
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 20px;
  border: 1px solid #e5e7eb;
  align-items: center;
}

.cart-item-img {
  width: 110px;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  background: #f1f5f9;
}

.cart-item-details {
  flex: 1;
}

.cart-item-details h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.cart-price {
  font-weight: 700;
  margin-bottom: 12px;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cart-qty button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 18px;
  cursor: pointer;
}

.cart-qty span {
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

.remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.remove-btn:hover {
  text-decoration: underline;
}

/* Total section polish */
#cartSummary h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}


/* ===== BEST SELLERS HERO ===== */
.best-hero {
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  padding: 30px 20px 30px;
}

.best-hero-inner {
  max-width: 900px;
  margin: auto;
  text-align: center;
}

.best-hero-inner h1 {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 800;
  margin: 20px 0 14px;
  color: #0f172a;
}

.best-hero-inner p {
  font-size: 18px;
  color: #475569;
  max-width: 700px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.best-hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.best-hero-stats div {
  background: white;
  padding: 18px 26px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  min-width: 140px;
}

.best-hero-stats strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #2563eb;
}

.best-hero-stats span {
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
}


@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.text-accent {
  color: #2563eb; /* or your accent color */
}


.book-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.book-info .add-to-cart-btn {
  margin-top: auto;
}
