/* --- START: CONSOLIDATED GLOBAL STYLES & VARIABLES --- */
:root {
  /* Colors */
  --primary-blue: #019afe;
  --background-color: #fafafa;
  --card-background: #ffffff;
  --card-glass-bg: rgba(255, 255, 255, 0.6);
  --card-border-color: rgba(255, 255, 255, 0.9);
  --text-dark: #1a1a1a;
  --text-light: #6c757d;
  --star-color: #facc15; /* Using the yellow from Explore Collection */

  /* Fonts */
  --font-family: "Montserrat", sans-serif;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  background-color: var(--background-color) !important;
  color: var(--text-dark);
  line-height: 1.6;
  /* --- FIX: Added overflow-x: hidden and width: 100% to prevent any horizontal scroll on the body --- */
  width: 100%;
  overflow-x: hidden;
}
/* --- END: CONSOLIDATED GLOBAL STYLES & VARIABLES --- */
:root {
  --primary-color: #019afe;
  --header-height: 70px;
  --header-height-mobile: 55px;
}

/* 
  IMPORTANT: This pushes the main page content down so it isn't
  hidden behind the fixed header. The padding-top value
  should match the --header-height variable.
*/
body {
  padding-top: var(--header-height);
  font-family: "Montserrat", sans-serif; /* Example font */
}
/* --- START: Header --- */
header {
  background-color: white;
  height: 70px;
  padding: 0 40px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07),
    0 2px 4px -2px rgba(0, 0, 0, 0.05);

  /* NEW: Add a transition for the justify-content property */
  transition: justify-content 0.4s ease;
}

/* --- START: Header Elements Styling --- */

/* Container for the logo */
.header-logo-container {
  display: flex;
  align-items: center;
  /* NEW: Add transition for a smooth fade out */
  transition: opacity 0.3s ease-in-out;
}

.header-logo {
  height: 45px;
  width: auto;
  display: block;
}

/* Styling for the "Sign In" button */
.header-cta-button {
  background-color: #019afe;
  color: white;
  padding: 10px 22px;
  border-radius: 6px;
  text-decoration: none;
  font-family: "Montserrat", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;

  /* NEW: Add transition for opacity as well for a smooth fade out */
  transition: opacity 0.3s ease-in-out, background-color 0.3s ease,
    transform 0.3s ease;
}

.header-cta-button:hover {
  background-color: #007bc7;
  transform: translateY(-2px);
  box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* --- NEW: STYLES FOR SCROLLED STATE --- */

/* 1. Style the video element that will appear on scroll */

/* 1. Style the video element that will appear on scroll */
.header-video {
  height: 50px;
  width: auto;
  /* CHANGED: The video is now hidden with 'display: none' instead of 'opacity: 0'. */
  display: none;
}

/* 2. This is the magic class added by JavaScript when you scroll */
header.scrolled {
  /* When scrolled, change the flexbox alignment to center everything */
  justify-content: center;
}

/* 3. Hide the original logo and button when the header has the .scrolled class */
header.scrolled .header-logo-container,
header.scrolled .header-cta-button {
  /* CHANGED: Completely hide the elements instead of fading them out. */
  display: none;
}

/* 4. Show the video when the header has the .scrolled class */
header.scrolled .header-video {
  /* CHANGED: Instantly show the video by changing its display property. */
  display: block;
}

/* --- START: Responsive Design --- */
@media (max-width: 768px) {
  header {
    height: 65px; /* Smaller height for mobile */
    padding: 0 20px; /* Less padding on smaller screens */
  }

  .header-logo {
    height: 40px; /* Slightly smaller logo */
  }

  .header-cta-button {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}
/* --- END: Header --- */

/* --- START: Quick Nav Section CSS --- */
/*
  ================================================
  Independent Quick Navigation Component Styles
  ================================================
  - All styles are self-contained.
  - Added margin for breathable space on all sides.
*/

/* --- Main Navigation Container --- */

/* --- Main Navigation Container (A transparent flex wrapper) --- */
.quick-nav-section {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

/* --- Search Bar --- */
.search-bar-container {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background-color: #ffffff;
  border-radius: 50px;
  padding: 12px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  border: 1px solid transparent; /* For smooth transition */
}

.search-icon {
  font-size: 1.2rem;
  color: #019afe; /* NEW COLOR */
  margin-right: 10px;
}

.search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  width: 100%;
  color: #333;
}
.search-input::placeholder {
  color: #aaa;
}

.search-text-mobile {
  display: none;
}

/* --- Vertical Divider --- */
.vertical-divider {
  width: 1px;
  height: 30px;
  background-color: #e0e0e0;
  flex-shrink: 0;
}

/* --- Category Slider (Swiper) --- */
.category-slider {
  flex-grow: 1;
  min-width: 0;
  cursor: grab;
}

.genre-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #ffffff;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #333;
  width: auto !important;
  white-space: nowrap;
  transition: all 0.3s;
}

.genre-tag:hover {
  background-color: #019afe; /* NEW COLOR */
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(1, 154, 254, 0.3); /* NEW COLOR shadow */
}

.genre-tag i {
  font-size: 1.1rem;
  color: #019afe;
  transition: color 0.3s;
}

/* ✅ This ensures icon turns white when parent is hovered */
.genre-tag:hover i {
  color: white;
}

/* ========================================= */
/* --- Desktop Specific Styles (Default) --- */
/* ========================================= */
.search-bar-container {
  width: 40vw;
  max-width: 450px;
}

/* ========================================== */
/* --- Mobile Specific Styles (under 768px) --- */
/* ========================================== */
@media (max-width: 768px) {
  .quick-nav-section {
    padding: 15px;
    gap: 15px;
  }

  /* Shrunken mobile state: Icon + "Search" text */
  .search-bar-container {
    width: auto;
    padding: 10px 16px;
    border-radius: 30px;
    cursor: pointer;
  }
  .search-icon {
    margin-right: 8px;
  }
  .search-text-mobile {
    display: inline;
    font-size: 0.9rem;
    color: #019afe; /* NEW COLOR */
    font-weight: 500;
    white-space: nowrap;
  }
  .search-input {
    width: 0;
    opacity: 0;
    padding: 0;
    pointer-events: none;
  }

  /* Expanded state on mobile */
  .search-bar-container.expanded {
    width: 100%;
    border: 1px solid #019afe; /* NEW COLOR */
    padding: 12px 20px;
  }
  .search-bar-container.expanded .search-icon {
    margin-right: 10px;
  }
  .search-bar-container.expanded .search-text-mobile {
    display: none;
  }
  .search-bar-container.expanded .search-input {
    width: 100%;
    opacity: 1;
    pointer-events: auto;
  }
  .vertical-divider {
    display: none;
  }
}

/* --- END: Quick Nav Section CSS --- */

/* --- START: Collage Section --- */
.trending-section {
  width: 100%;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* This new class will wrap the tag and the first card */
.trending-slot {
  display: flex;
  flex-direction: column;
  gap: 0.8rem; /* This creates the space between the tag and the card */
}

/* Make one small change to the existing trending-tag rule */
.trending-tag {
  width: 100%;
  background-color: #019afe;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 9px;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
  text-align: center;
}

.book-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.book-row {
  display: grid;
  gap: 2rem;
}

.top-row {
  grid-template-columns: repeat(4, 1fr);
}
.bottom-row {
  grid-template-columns: repeat(5, 1fr);
}

.card-container {
  background: var(--card-glass-bg);
  border: 1px solid var(--card-border-color);
  border-radius: 16px;
  padding: 0.75rem;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
}

.book-card {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.book-cover-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}
.book-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-details {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.book-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2rem;
}
.book-author {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}
.book-info-footer {
  margin-top: auto;
  padding-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.book-pricing {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: bold;
}
.current-price,
.original-price {
  white-space: nowrap;
}
.current-price {
  font-size: 1.1rem;
  color: var(--text-dark);
}
.original-price {
  font-size: 0.85rem;
  color: var(--text-light);
  text-decoration: line-through;
}
.book-rating {
  color: #ffc107; /* Using specific star color for this section */
  font-size: 1rem;
  flex-shrink: 0;
}
.book-rating i {
  vertical-align: middle;
}

@media (max-width: 1024px) {
  .top-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .bottom-row {
    grid-template-columns: repeat(4, 1fr);
  }
  .top-row .card-container:nth-child(n + 4) {
    display: none;
  }
  .bottom-row .card-container:nth-child(n + 5) {
    display: none;
  }
}

@media (max-width: 767px) {
  html {
    font-size: 14px;
  }
  .trending-section {
    padding: 0 0.75rem;
  }
  .book-grid {
    gap: 1.5rem;
  }
  .card-container {
    padding: 0.5rem;
  }
  .book-details {
    padding: 0.5rem;
  }
  .book-title {
    font-size: 0.9rem;
    min-height: 2.2em;
  }
  .top-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .bottom-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
  .top-row .card-container:nth-child(n + 3) {
    display: none;
  }
  .bottom-row .card-container:nth-child(n + 4) {
    display: none;
  }
  .bottom-row .card-container {
    padding: 0.4rem;
  }
  .top-row .card-container {
    max-width: 45vw;
  }
  .bottom-row .book-details {
    padding: 0.4rem;
  }
  .bottom-row .book-title {
    font-size: 0.8rem;
    min-height: 2em;
    -webkit-line-clamp: 1;
  }
  .bottom-row .book-author {
    font-size: 0.7rem;
  }
  .bottom-row .book-info-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
  .bottom-row .current-price {
    font-size: 0.9rem;
  }
  .bottom-row .original-price {
    font-size: 0.75rem;
  }
  .bottom-row .book-rating {
    font-size: 0.85rem;
  }
}

@keyframes subtleFlashOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes subtleFlashIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.is-updating > .book-card {
  animation: subtleFlashOut 0.3s ease-out forwards;
}
.was-updated > .book-card {
  animation: subtleFlashIn 0.4s ease-in forwards;
}

/* Add this new rule to your CSS file */
.top-row .book-info-footer {
  flex-direction: column; /* This stacks the items vertically */
  align-items: flex-start; /* This aligns them to the left */
  gap: 0.2rem; /* This reduces the space between the price and stars */
}

/* Add this new rule to increase the height of specific top-row cards */
/* Add this new rule to increase the height of the specific book cover images */
.top-row > .card-container .book-cover-wrapper {
  aspect-ratio: auto; /* Override the original fixed aspect ratio */
  min-height: calc(
    8vw + 60%
  ); /* Set your desired image height here. Adjust as needed. */
}
/* --- END: Collage Section --- */

/* --- START: Subscription Section --- */
.sub-promo {
  background: linear-gradient(to right, #54a374 50%, #323232 50%);
  padding: 100px 40px;
  overflow: hidden;
  position: relative;
}

.sub-promo__content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  position: relative;
  z-index: 2;
}

.sub-promo__header {
  color: #ffffff;
  max-width: 660px;
  width: 100%;
  text-align: left;
  margin-bottom: 25px;
}

.sub-promo__header .sub-promo__tag {
  background-color: var(--primary-blue);
  color: #ffffff;
  padding: 8px 24px;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-block;
}

.sub-promo__header .sub-promo__intro-text {
  margin-top: 25px;
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: 1px;
}

.sub-promo__header .sub-promo__price {
  font-size: 3.8rem;
  font-weight: 800;
  margin-top: 5px;
  letter-spacing: 1px;
}

.sub-promo__book-display {
  display: flex;
  gap: 30px;
  justify-content: center;
  align-items: center;
  margin-top: 1.5rem;
}

.sub-promo__book-card {
  width: 200px;
  height: 300px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.sub-promo__book-card:hover {
  transform: translateY(-10px);
}
.sub-promo__book-card:nth-child(2) {
  transform: translateY(-20px);
}
.sub-promo__book-card:nth-child(2):hover {
  transform: translateY(-30px);
}

.sub-promo__book-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.sub-promo__benefits-grid {
  width: 100%;
  max-width: 700px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 60px;
  color: #ffffff;
  margin-top: 40px;
}

.sub-promo__benefit-item {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
}

.sub-promo__benefit-item i {
  font-size: 2.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sub-promo__benefits-grid .sub-promo__benefit-item:nth-child(even) i {
  color: #54a374;
}
.sub-promo__benefits-grid .sub-promo__benefit-item:nth-child(odd) i {
  color: #323232;
}
.sub-promo__benefit-item span {
  font-size: 1.1rem;
  font-weight: 500;
}

@media (max-width: 992px) {
  .sub-promo {
    padding: 80px 30px;
  }
  .sub-promo__header,
  .sub-promo__book-display {
    transform: translateX(0);
  }

  .sub-promo__book-display {
    margin-top: 3rem;
  }
  .sub-promo__header {
    text-align: center;
    max-width: 540px;
  }
  .sub-promo__book-card {
    width: 160px;
    height: 240px;
  }
  .sub-promo__header .sub-promo__intro-text {
    font-size: 1.3rem;
  }
  .sub-promo__header .sub-promo__price {
    font-size: 3rem;
  }
  .sub-promo__benefits-grid {
    gap: 30px 40px;
    max-width: 600px;
  }
  .sub-promo__benefit-item {
    justify-content: flex-start;
    width: 70vw;
    margin: 0 auto;
  }
  .sub-promo__benefit-item span {
    font-size: 1rem;
  }
  .sub-promo__benefit-item i {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .sub-promo {
    background: linear-gradient(to bottom, #54a374 45%, #323232 45%);
    padding: 60px 20px;
  }
  .sub-promo__content {
    gap: 40px;
  }
  .sub-promo__header {
    margin-bottom: 0;
  }
  .sub-promo__book-display {
    gap: 15px;
  }
  .sub-promo__book-card {
    width: 100px;
    height: 150px;
    padding: 8px;
  }
  .sub-promo__book-card:nth-child(2) {
    transform: translateY(-15px);
  }
  .sub-promo__book-card:nth-child(2):hover {
    transform: translateY(-20px);
  }
  .sub-promo__header .sub-promo__intro-text {
    font-size: 1.8rem;
  }
  .sub-promo__header .sub-promo__price {
    font-size: 3.5rem;
  }
  .sub-promo__benefits-grid {
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 20px;
  }
  .sub-promo__benefit-item {
    gap: 15px;
  }
  .sub-promo__benefits-grid .sub-promo__benefit-item i {
    color: #54a374 !important;
  }
}
/* --- END: Subscription Section --- */

/* --- START: Explore Collection Section --- */
.b-shelf {
  width: 90%;
  max-width: 1400px;
  margin: 40px auto; /* Added some top margin */
  position: relative;
  /* --- FIX: Prevents the decorative title lines from causing horizontal scroll --- */
  overflow-x: hidden;
}

.b-shelf__header {
  text-align: center;
  margin-bottom: 30px;
}

.b-shelf__title {
  text-align: center;
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-dark);
  position: relative;
  display: inline-block;
  padding: 0 20px;
}

.b-shelf__title::before,
.b-shelf__title::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 80px;
  height: 2px;
  background-color: #767676;
  transform: translateY(-50%);
}

.b-shelf__title::before {
  left: -90px;
}

.b-shelf__title::after {
  right: -90px;
}

/* --- Category Carousel Styling --- */
.b-shelf__categories {
  width: 100%;
  margin-bottom: 30px;
  padding: 5px 0;
}

.b-shelf__categories .swiper-slide {
  width: auto; /* This correctly targets only the category slides */
}

.b-shelf__category-btn {
  padding: 10px 25px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary-blue);
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  white-space: nowrap;
}

.b-shelf__category-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.b-shelf__category-btn.active {
  background-color: var(--primary-blue);
  color: #fff;
  border-color: var(--primary-blue);
  box-shadow: 0 4px 15px rgba(1, 154, 254, 0.3);
}

/* --- Books Carousel Styling --- */
.b-shelf__row {
  position: relative;
  margin-bottom: 20px;
}

#b-shelf-row-2 {
  display: none; /* Hidden by default, JS will show it */
}

/* These styles are now safe and won't be affected by other sections */
.b-shelf__carousel {
  padding: 10px 0;
}
.b-shelf__carousel .swiper-wrapper {
  margin-bottom: 2rem;
}

.b-shelf__carousel .swiper-slide {
  height: auto; /* Allow slide to fit content */
}

/* --- Glassmorphism Book Card --- */
.b-shelf__item {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 16px;
  padding: 12px;
  background: var(--card-glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border-color);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.b-shelf__item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
}

.b-shelf__item-cover {
  width: 100%;
  height: 270px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.b-shelf__item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.b-shelf__item:hover .b-shelf__item-cover img {
  transform: scale(1.05);
}

.b-shelf__item-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.b-shelf__item-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  height: 25px;
  margin: 0 0 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.b-shelf__item-author {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0 0 10px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.b-shelf__item-rating {
  margin-bottom: 12px;
  color: var(--star-color);
}

.b-shelf__item-rating .far.fa-star {
  color: #ccc;
}

.b-shelf__item-price {
  margin-top: auto; /* Pushes price to the bottom */
  display: flex;
  align-items: center;
  gap: 10px;
}

.b-shelf__price--discount {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
}

.b-shelf__price--original {
  font-size: 0.9rem;
  color: var(--text-light);
  text-decoration: line-through;
}

/* --- Swiper Navigation Arrows --- */
.swiper-button-next,
.swiper-button-prev {
  color: var(--primary-blue);
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  width: 24px !important;
  height: 24px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}
.swiper-button-next:hover,
.swiper-button-prev:hover {
  background-color: white;
  transform: scale(1.1);
}

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 15px !important;
  font-weight: 900;
}

@media (max-width: 768px) {
  .swiper-button-next,
  .swiper-button-prev {
    width: 38px;
    height: 38px;
  }
  .swiper-button-next:after,
  .swiper-button-prev:after {
    font-size: 16px;
  }
}

/* --- Responsiveness --- */
@media (max-width: 768px) {
  .b-shelf__title {
    font-size: 1.5rem;
  }
  .b-shelf__title::before,
  .b-shelf__title::after {
    width: 40px;
  }
  .b-shelf__title::before {
    left: -50px;
  }
  .b-shelf__title::after {
    right: -50px;
  }
  .b-shelf__category-btn {
    font-size: 0.9rem;
    padding: 8px 20px;
  }
  .b-shelf__item-cover {
    height: 270px;
  }
}

@media (max-width: 480px) {
  .b-shelf {
    width: 95%;
  }
  .b-shelf__title {
    padding: 0 10px;
  }
  .b-shelf__title::before,
  .b-shelf__title::after {
    width: 20px;
  }
  .b-shelf__title::before {
    left: -20px;
  }
  .b-shelf__title::after {
    right: -20px;
  }
  .b-shelf__item-cover {
    height: 250px;
  }
  .b-shelf__item-title {
    font-size: 0.9rem;
    height: 25px;
  } /* Adjust height for smaller font */
  .b-shelf__price--discount {
    font-size: 1.1rem;
  }
}

/* --- NEW: View Full Collection Button Styling --- */
.view-collection-wrapper {
  display: none; /* Hidden by default, JS will show it */
  text-align: center;
  margin-top: 30px; /* Space above the button */
}

.view-collection-btn {
  display: inline-block;
  padding: 14px 40px;
  font-family: var(--font-family);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 12px;

  /* Applying your glassmorphism style */
  background: var(--card-glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border-color);
  box-shadow: 0 8px 24px 0 rgba(31, 38, 135, 0.1);

  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.view-collection-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px 0 rgba(31, 38, 135, 0.15);
  color: var(--primary-blue);
}

/* --- END: Explore Collection Section --- */

/*! Book Course   */
/* --- Page Wrapper for Centering and Background --- */
.dbcs-page-wrapper {
  font-family: "Poppins", sans-serif;
  background-color: #f0f2f5;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- Main Section Styling --- */
.dbcs-book-course-section {
  background-color: #54a374; /* Replaced var(--primary-green) */
  padding: 4rem 2rem;
  color: #ffffff; /* Replaced var(--text-light) */
  width: 100%;
}

/* --- Grid Container for Layout Control --- */
.dbcs-book-course-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "tag   video"
    "text  video";
  gap: 1.25rem 3rem; /* row-gap column-gap */
  align-items: center;
}

/* --- Grid Area Assignments --- */
#courseTag {
  grid-area: tag;
}
#courseTextBlock {
  grid-area: text;
}
#videoCard {
  grid-area: video;
}

/* --- Content Blocks --- */
.dbcs-course-tag {
  background-color: #019afe; /* Replaced var(--primary-blue) */
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 1.3rem;
  font-weight: 600;
  width: fit-content;
}

.dbcs-course-text-block {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dbcs-course-text-block h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.dbcs-course-text-block p {
  font-size: 1rem;
  line-height: 1.6;
  color: #e0e0e0; /* Replaced var(--text-secondary) */
  margin: 0;
  max-width: 500px;
}

.dbcs-pricing-options {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.dbcs-price-button {
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dbcs-price-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dbcs-price-button.dbcs-club-members {
  background-color: #343a40; /* Replaced var(--dark-button) */
  color: #ffffff; /* Replaced var(--text-light) */
}

.dbcs-price-button.dbcs-regular-price {
  background-color: #019afe; /* Replaced var(--primary-blue) */
  color: #ffffff; /* Replaced var(--text-light) */
}

.dbcs-pricing-options .dbcs-separator {
  font-weight: 600;
  color: #e0e0e0; /* Replaced var(--text-secondary) */
}

/* --- Right Column: Video --- */
.dbcs-course-video-card {
  position: relative;
  padding: 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.dbcs-video-thumbnail {
  width: 280px;
  aspect-ratio: 2 / 3;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.dbcs-play-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dbcs-play-button:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.5);
}

.dbcs-play-button i {
  font-size: 3rem;
  color: #ffffff; /* Replaced var(--text-light) */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-left: 5px;
}

/* --- Video Modal --- */
.dbcs-video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dbcs-video-modal.dbcs-active {
  opacity: 1;
  visibility: visible;
}

.dbcs-video-modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
}

.dbcs-video-modal-content video {
  width: 100%;
  height: 100%;
  border-radius: 10px;
}

.dbcs-close-modal {
  position: absolute;
  top: -40px;
  right: 0;
  font-size: 2.5rem;
  color: #ffffff; /* Replaced var(--text-light) */
  cursor: pointer;
  line-height: 1;
}

/* --- Responsive Design (Mobile-First approach with a breakpoint) --- */
@media (max-width: 768px) {
  .dbcs-book-course-container {
    grid-template-columns: 1fr; /* Single column layout */
    grid-template-areas:
      "tag"
      "video"
      "text";
    justify-items: center; /* Center all grid items horizontally */
  }
  .dbcs-course-text-block {
    text-align: center;
    align-items: center; /* Center flex items (like pricing) */
  }
  .dbcs-course-text-block p {
    max-width: 100%;
  }
  #videoCard {
    margin: 1rem 0; /* Add some space around the video card on mobile */
  }
  .dbcs-pricing-options {
    justify-content: center;
    flex-wrap: wrap;
  }
  .dbcs-course-text-block h1 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .dbcs-book-course-section {
    padding: 3rem 1.5rem;
  }
  .dbcs-video-thumbnail {
    width: 250px;
  }
  .dbcs-play-button {
    width: 70px;
    height: 70px;
  }
  .dbcs-play-button i {
    font-size: 2.5rem;
  }
}
/*! Book Course   */

/*! Newsleeter seciton   */
/* --- Page Wrapper for Centering and Background --- */
.bmc-page-wrapper {
  font-family: "Montserrat", sans-serif;
  background-color: #faf8f5; /* A warm, parchment-like background */
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* General Styling for the Section */
.bmc-membership-section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 40px;
  overflow: hidden;
  box-sizing: border-box;
}

.bmc-membership-container {
  display: flex;
  align-items: center;
  gap: 5%;
}

/* Left side: Information and Benefits */
.bmc-membership-info {
  flex: 0 0 40%;
  text-align: left;
}

.bmc-membership-info h2 {
  font-family: "Playfair Display", serif; /* Elegant serif font for the heading */
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1a1a1a;
  margin-bottom: 25px;
}

.bmc-membership-info .bmc-subtitle {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #555555;
  margin-bottom: 40px;
}

.bmc-benefits-list {
  list-style: none;
  padding: 0;
  margin: 0 0 45px 0;
}

.bmc-benefits-list li {
  display: flex;
  align-items: center;
  font-size: 1rem;
  color: #333333;
  margin-bottom: 18px;
  font-weight: 500;
}

.bmc-benefits-list .bmc-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: #019afe;
  margin-right: 15px;
  flex-shrink: 0;
}

.bmc-benefits-list .bmc-icon svg {
  width: 12px;
  height: 12px;
  stroke: #ffffff; /* Replaced 'white' */
  stroke-width: 2.5;
}

.bmc-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background-color: #019afe;
  color: #ffffff; /* Replaced 'white' */
  padding: 16px 32px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bmc-cta-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(1, 154, 254, 0.25); /* Shadow matches accent color */
}

/* Right side: The Carousel */
.bmc-membership-carousel-wrapper {
  flex: 1;
}

.bmc-carousel-container {
  position: relative;
  width: 100%;
  height: 380px;
  perspective: 1800px;
}

.bmc-card-cascade {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.bmc-card {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 220px;
  height: 280px;
  background: #fdfdfd;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 0 10px 25px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  padding: 10px;
  box-sizing: border-box;
  transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1);
  opacity: 0;
  transform: translateY(20px) scale(0.8);
}

.bmc-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  filter: blur(1px) grayscale(60%) brightness(0.95);
  transition: all 0.5s ease;
}

.bmc-card.bmc-active {
  opacity: 1;
  transform: rotateY(0) scale(1.18) translateZ(100px);
  z-index: 10;
}

.bmc-card.bmc-active img {
  filter: blur(0) grayscale(0%) brightness(1);
}

/* --- RESPONSIVE FIXES & ADJUSTMENTS --- */
@media (max-width: 992px) {
  .bmc-membership-container {
    flex-direction: column;
    gap: 60px;
  }
  .bmc-membership-info {
    text-align: center;
    flex-basis: auto;
  }
  .bmc-benefits-list {
    display: inline-block;
    text-align: left;
  }
  .bmc-membership-info h2 {
    font-size: 2.8rem;
  }
  .bmc-membership-carousel-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .bmc-carousel-container {
    width: 100%;
    max-width: 450px;
    height: 300px;
  }
}

@media (max-width: 768px) {
  .bmc-membership-section {
    padding: 80px 20px;
  }
  .bmc-membership-info h2 {
    font-size: 2.5rem;
  }
  .bmc-card {
    width: 180px;
    height: 240px;
  }
  .bmc-carousel-container {
    perspective: 1200px;
  }
}
/*! Newsleeter seciton   */

/* Search results */
/* Import a clean sans-serif font (optional, if not already in your project) */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap");

/* --- Main Search Container --- */
.search-container {
  position: relative; /* Crucial for positioning the results panel */
  font-family: "Inter", sans-serif;
  max-width: 500px; /* Adjust as needed */
  margin: 0 auto;
}

/* --- Results Panel Styling --- */
#search-results-panel {
  display: none; /* Hidden by default */
  position: absolute;
  top: calc(100% + 8px); /* Position below the search bar with a small gap */
  left: 0;
  width: 100%;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
  z-index: 1000;
  max-height: 550px; /* Max height to prevent overly long lists */
  overflow-y: auto; /* Add scroll if content overflows */
  padding: 8px 0; /* Vertical padding */
}

/* --- Individual Result Item Styling --- */
.result-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  text-decoration: none;
  color: #222;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.result-item:last-child {
  border-bottom: none;
}

.result-item:hover {
  background-color: #f5f5f5;
}

/* Book Cover Image */
.result-item-image {
  width: 45px;
  height: 65px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 16px;
  flex-shrink: 0;
  background-color: #e9ecef; /* Placeholder color */
}

/* Book Info Section */
.result-item-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0; /* Prevents text overflow issues in flexbox */
}

.result-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.result-item-author {
  font-size: 0.85rem;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.result-item-price {
  font-size: 0.8rem;
  font-weight: 500;
  color: #1a1a1a;
  margin-top: auto; /* Pushes price to the bottom */
}

/* --- Algolia Highlight Styling --- */
.result-item .ais-Highlight-highlighted,
mark {
  background: none;
  color: #019afe; /* Your primary accent color */
  font-weight: 700;
  font-style: normal;
}

/* --- "No Results" Message Styling --- */
.no-results-message {
  padding: 24px 16px;
  text-align: center;
  color: #777;
  font-style: italic;
}
/* Search results */

/* Header update  */

/* =================================== */
/* === ADD THIS FOR HEADER CART ICON === */
/* =================================== */

/* This container will group the cart icon and sign-in button */
.header-right-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem; /* Adjust spacing between cart and sign-in */
  z-index: 2; /* Ensures it stays above the video on scroll */
}

/* Styling for the cart icon link */
.header-cart-icon {
  position: relative;
  font-size: 1.8rem;
  color: #0b6df0;
  text-decoration: none;
  transition: color 0.3s ease;
}

.header-cart-icon:hover {
  color: #019afe; /* Your primary color on hover */
}

/* This is the red circle with the number of items */
#header-cart-count {
  position: absolute;
  top: -2px;
  right: -8px;
  background-color: #019afe; /* Your primary color */
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid white; /* Matches the header background */
}

/* Utility class to hide the count when the cart is empty */
.hidden {
  display: none !important;
}

/* Ensure the sign-in button also stays on top */
.header-cta-button {
  z-index: 2;
}

/* 
  STEP 2: THE FIX.
  This single rule targets BOTH the original logo on the left 
  AND the new controls on the right, but ONLY when the header 
  has the ".scrolled" class.
*/
.scrolled .header-logo-container,
.scrolled .header-right-controls {
  /* Makes them invisible */
  opacity: 0;

  /* Makes them unclickable while they are invisible */
  pointer-events: none;
}
/* Header update  */

/* trednig Skeletion */

/* --- MODERN & REALISTIC SKELETON LOADER for TRENDING SECTION --- */
/* --- 1. CORE VISIBILITY LOGIC --- */
/* Hide the real content grid when the section is loading */
.trending-section.is-loading .book-grid {
  display: none;
}
/* Hide the skeleton loader when the section is NOT loading */
.trending-section:not(.is-loading) .skeleton-loader {
  display: none;
}

/* --- 2. SKELETON GRID LAYOUT --- */
/* This container mimics the real ".book-grid" flexbox setup */
.trending-section.is-loading .skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 2rem; /* EXACTLY matches your real .book-grid gap */
}

/* These rules mimic the real ".book-row" grid setup */
.skeleton-loader .top-row,
.skeleton-loader .bottom-row {
  display: grid;
  gap: 2rem; /* EXACTLY matches your real .book-row gap */
}

/* These rules mimic the real column counts for each row */
.skeleton-loader .top-row {
  grid-template-columns: repeat(4, 1fr);
}
.skeleton-loader .bottom-row {
  grid-template-columns: repeat(5, 1fr);
}

/* --- 3. THE SKELETON CARD (OUTER WRAPPER) --- */
/* This mimics your ".card-container" and provides a stable, responsive height */
.skeleton-book {
  /* Mimic glassmorphism styles from your .card-container */
  background: var(--card-glass-bg);
  border: 1px solid var(--card-border-color);
  border-radius: 16px;
  padding: 0.75rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  /* Layout and Sizing - THIS IS THE KEY FIX */
  display: flex; /* Allows the inner-skeleton to grow and fill this container */
  aspect-ratio: 2 / 3.2; /* Forces a book-like shape and prevents collapsing. Scales perfectly. */

  /* Shimmer Animation Setup */
  position: relative;
  overflow: hidden;
}

/* --- 4. THE SKELETON CARD (INNER CONTENT) --- */
/* This mimics your ".book-card" and contains the placeholder shapes */
.skeleton-book .inner-skeleton {
  width: 100%;
  flex: 1; /* Makes the inner card grow to fill the parent .skeleton-book */

  /* Mimic styles from your .book-card */
  background-color: #fff;
  border-radius: 8px; /* Matches your .book-card radius */

  /* "Drawing" the placeholders with gradients */
  --placeholder-color: hsl(210, 20%, 94%); /* A modern, light, cool gray */
  background-image:
    /* Image Placeholder */ linear-gradient(
      var(--placeholder-color) 100%,
      transparent 0
    ),
    /* Title Line Placeholder */
      linear-gradient(var(--placeholder-color) 100%, transparent 0),
    /* Author Line Placeholder */
      linear-gradient(var(--placeholder-color) 100%, transparent 0);

  background-repeat: no-repeat;

  /* Sizing each placeholder shape */
  background-size: calc(100% - 1.25rem) 62%,
    /* Image size (width height) */ 75% 1rem, /* Title line size */ 55% 0.75rem; /* Author line size */

  /* Positioning each placeholder shape from the top-left corner */
  background-position: center 0.625rem, /* Image position (X Y) */ 0.625rem 70%,
    /* Title position */ 0.625rem 88%; /* Author position */
}

/* --- 5. THE MODERN SHIMMER EFFECT --- */
.skeleton-book::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* A soft, wide wave of light for a premium feel */
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 80%
  );
  transform: translateX(-100%);
  animation: modern-shimmer 2.5s infinite;
}

@keyframes modern-shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* --- 6. PERFECT RESPONSIVE MIMICRY --- */
/* These media queries ensure the skeleton grid changes exactly like your real grid */
@media (max-width: 1024px) {
  .skeleton-loader .top-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .skeleton-loader .bottom-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 767px) {
  .skeleton-loader {
    gap: 1.5rem;
  }
  .skeleton-book {
    padding: 0.5rem;
  }
  .skeleton-loader .top-row,
  .skeleton-loader .bottom-row {
    gap: 1rem;
  }
  .skeleton-loader .top-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .skeleton-loader .bottom-row {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* trednig Skeletion */
/* === START: Club Offer Feature CSS (REFINED) === */

/* The initial "pop-in with a bounce" animation */
@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  60% {
    opacity: 1;
    transform: scale(1.1); /* Overshoot slightly for the bounce effect */
  }
  100% {
    opacity: 1;
    transform: scale(1); /* Settle at the final size */
  }
}

/* The intermittent "jiggle" to draw attention back */
@keyframes jiggleLoop {
  /* This animation is 5s long, but the action happens only in the first second */
  0%,
  100% {
    transform: rotate(0deg);
  } /* Start and end at rest */

  /* The jiggle sequence */
  5% {
    transform: rotate(-15deg);
  }
  10% {
    transform: rotate(10deg);
  }
  15% {
    transform: rotate(-5deg);
  }
  20% {
    transform: rotate(0deg);
  }

  /* The rest of the time, it sits perfectly still */
  21%,
  99% {
    transform: rotate(0deg);
  }
}

:root {
  --card-color: #ffffff;
  --primary-color: #019afe;
  --text-color: #1a1a1a;
  --text-light: #6b7280;
  --border-color: #e5e7eb;
  --success-color: #22c55e;
}

/* === Premium & Sophisticated Surprise Box === */
.surprise-box {
  position: fixed;
  z-index: 998;
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, #00afff, #0077ff);
  color: white;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 78, 153, 0.15),
    0 8px 16px rgba(0, 119, 255, 0.2), 0 0 0 4px rgba(255, 255, 255, 0.1),
    inset 0 2px 2px rgba(255, 255, 255, 0.4);

  animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s both,
    jiggleLoop 5s ease-in-out 2.5s infinite;

  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
    box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease; /* Add opacity to the transition */

  /* Positioning */
  bottom: 20px;
  right: 20px;
}

/* Enhanced Hover State: The animation will pause on hover for a stable interaction */
.surprise-box:hover {
  animation-play-state: paused;
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 78, 153, 0.1),
    0 15px 30px rgba(0, 119, 255, 0.3), 0 0 0 4px rgba(255, 255, 255, 0.1),
    inset 0 2px 2px rgba(255, 255, 255, 0.4);
}

/* Active (Pressed) State */
.surprise-box:active {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 2px 4px rgba(0, 78, 153, 0.15),
    0 8px 16px rgba(0, 119, 255, 0.25), 0 0 0 4px rgba(255, 255, 255, 0.1),
    inset 0 3px 4px rgba(0, 0, 0, 0.2);
  transition-duration: 0.1s;
}

/* ========================================================= */
/* === THE FIX: Add this rule back into your CSS file. === */
/* ========================================================= */

/* The dismissed state for when the user clicks the 'X' button */
.surprise-box.dismissed {
  opacity: 0.5;
  transform: scale(0.9);
  cursor: default; /* Change cursor to show it's no longer the primary action */
  animation: none; /* IMPORTANT: Stop all animations when it's dismissed */
}
body.on-product-page .surprise-box {
  bottom: 80px; /* FIX: Position above sticky buttons on product page */
}
.surprise-box:hover {
  transform: scale(1.1);
}
.surprise-box.dismissed {
  opacity: 0.5;
  transform: scale(0.9);
}
.surprise-box.hidden {
  display: none;
}

.popup-message {
  position: absolute;
  bottom: 120%;
  right: 0; /* Align to the right of the box */
  left: auto;
  width: 260px;
  background: var(--card-color);
  color: var(--primary-color);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.popup-message.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.popup-message::after {
  content: "";
  position: absolute;
  bottom: -10px;
  right: 20px; /* Aligned to the right */
  left: auto;
  width: 20px;
  height: 20px;
  background: var(--card-color);
  transform: rotate(45deg);
}
.popup-message .close-popup-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-light);
}

/* --- The Progress Tracker --- */
.club-progress-tracker {
  position: fixed;
  z-index: 999;
  /* FIX: Placed at bottom right by default */
  bottom: 20px;
  right: 20px;

  /* NEW: All properties that change are now transitions */
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);

  /* Expanded State (Default) */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: auto;
  height: 58px;
  max-width: 340px;
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  /* FIX: Opaque background color */
  background-color: var(--text-color);
  color: white;
  cursor: default;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
}
body.on-product-page .club-progress-tracker {
  bottom: 80px; /* FIX: Position above sticky buttons only on product page */
}
.club-progress-tracker.visible {
  opacity: 1;
  pointer-events: auto;
}
.club-progress-tracker.unlocked {
  background: linear-gradient(45deg, var(--success-color), #16a34a);
}

.progress-icon-container,
.progress-text {
  /* Animate opacity for smooth appearance/disappearance */
  transition: opacity 0.3s ease;
}

/* Collapsed State */
.club-progress-tracker.collapsed {
  width: 58px;
  height: 58px;
  padding: 0;
  justify-content: center;
  cursor: pointer;
}
.club-progress-tracker.collapsed .progress-text {
  opacity: 0;
  width: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.progress-icon-container {
  flex-shrink: 0;
  position: relative;
  font-size: 1.5rem;
  display: flex;
  align-items: center; /* Vertically centers the bag icon */
  justify-content: center; /* Horizontally centers the bag icon */
  margin-left: 10px;
}
.progress-icon-container .progress-count {
  position: absolute;
  top: -5px;
  right: -8px;
  background-color: var(--primary-color);
  border: 2px solid var(--text-color);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.club-progress-tracker.unlocked .progress-icon-container .progress-count {
  background-color: white;
  color: var(--success-color);
  border-color: #16a34a;
}
.progress-text {
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
}
/* === END: Club Offer Feature CSS === */
