/* ============================================================ 
   SAGA STORIES — Shop Section (Optimized and Tightened)
   ============================================================ */

/* --- Section Background (Reduced Padding) --- */
.shop-section {
  padding: 50px 0; /* was 80px */
  background: linear-gradient(180deg, #f9f2ff 0%, #ffffff 100%);
  display: flex;
  justify-content: center;
}

@media (max-width: 600px) {
  .shop-section {
    padding: 35px 0; /* tighter mobile spacing */
  }
}

.shop-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px; /* reduced from 32px */
}

/* ============================================================
   Homepage Shop Section Title (Matches Featured Comics)
   ============================================================ */

#shop-section.shop-section h2,
#shop-section.shop-section .section-title,
.homepage-shop .section-title {
  font-size: 2.1rem;
  font-weight: 800;
  margin-bottom: 25px;
  color: #7c27ff; /* Saga Violet */
  position: relative;
  z-index: 1;
  letter-spacing: 0.6px;
  text-shadow: 0 0 20px rgba(200, 160, 255, 0.4);
  animation: titleFadeIn 1.4s ease forwards;
  text-align: center;
}

/* underline accent */
#shop-section.shop-section h2::after,
.homepage-shop .section-title::after {
  content: "";
  display: block;
  width: 70px;
  height: 3px;
  background: linear-gradient(90deg, #d28aff, #ff7ce5); /* violet → pink */
  margin: 12px auto 0;
  border-radius: 4px;
  opacity: 0.9;
  box-shadow: 0 0 12px rgba(210, 160, 255, 0.6);
}

/* Show All button (homepage only) */
.homepage-shop-show-all {
  text-align: center;
  margin-top: 22px; /* tighter */
}

.show-all-btn {
  display: inline-block;
  padding: 12px 28px;
  background: linear-gradient(90deg, #b000ff, #ff00b8);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: 30px;
  text-decoration: none;
  box-shadow: 0 6px 22px rgba(176, 0, 255, 0.24);
  transition: 0.3s ease;
}

.show-all-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(176, 0, 255, 0.34);
  color: #fff0f5;
}

/* ============================================================
   Product Card (Image on Top Layout)
   ============================================================ */

.product-card {
  display: flex;
  flex-direction: column !important;
  gap: 0;
  background: #ffffff;
  border-radius: 20px;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 0;
}

/* Glow Border */
.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 2px;
  background: linear-gradient(135deg, #ae00ff, #ff00c8);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.32;
  pointer-events: none;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(160, 0, 255, 0.16);
}

.product-card:hover::before {
  opacity: 0.75;
}

/* --- Thumbnail (Reduced Height) --- */
.product-thumb {
  width: 100% !important;
  padding: 12px;
  height: 220px; /* was 260px */
  border-radius: 16px;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 16px;
  transition: 0.4s ease;
}

/* Meta (Tighter Paddings) */
.product-meta {
  width: 100% !important;
  padding: 22px 24px 28px !important; /* tighter */
}

/* Title */
.product-title {
  font-size: 1.25rem;
  margin-bottom: 8px;
  line-height: 1.26;
  color: #0a002b;
}

/* Description */
.product-desc {
  font-size: 0.92rem;
  color: #6b5f7f;
  margin-bottom: 12px;
  line-height: 1.45;
}

/* Price */
.product-price {
  margin: 8px 0 16px;
  color: #8a2cff;
  font-weight: 700;
  font-size: 1rem;
}

/* Button Box */
.product-actions {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* ============================================================
   FIX — Perfect Centered Buy Now Button
   ============================================================ */

.buy-now {
  width: 75%;
  margin: 0 auto;
  display: flex;                   /* center text horizontally + vertically */
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 0 !important;
  background: linear-gradient(90deg, #b000ff, #ff00b8);
  border-radius: 26px;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.buy-now:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 26px rgba(255, 0, 200, 0.34);
  color:#fff0f5;
}

/* ============================================================
   FIX: Homepage shop should behave like Shop Page on mobile
   ============================================================ */

/* Force proper stacking on mobile */
@media (max-width: 780px) {
  .homepage-shop .shop-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    overflow-x: unset !important;
    white-space: normal !important;
  }

  /* Make product card full-width and center */
  .homepage-shop .product-card {
    width: 100% !important;
    margin: 0 auto !important;
  }
}

/* Optional: Make mobile layout identical even on small screens */
@media (max-width: 480px) {
  .homepage-shop .shop-container {
    grid-template-columns: 1fr !important;
  }
}


/* ============================================================
   FIX: Remove underline from Buy Now button text
   ============================================================ */
.buy-now,
.buy-now:hover,
.buy-now:focus,
.buy-now:active {
  text-decoration: none !important;
}


/* ============================================================
   FIX: Improve mobile spacing for homepage shop
   ============================================================ */

@media (max-width: 780px) {
  .homepage-shop {
    padding: 30px 0 !important; /* reduce mobile space */
  }

  .homepage-shop .section-title {
    margin-bottom: 18px !important;
  }

  .homepage-shop-show-all {
    margin-top: 20px !important;
  }
}
