html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(180deg, #f7faff 0%, #eef4ff 100%);
}

/* HERO */
.hero-wrapper {
  min-height: 380px;
  position: relative;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  overflow: hidden;
}

.hero-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(7, 24, 56, 0.86) 0%,
    rgba(7, 24, 56, 0.45) 52%,
    rgba(7, 24, 56, 0.28) 100%
  );
  z-index: 0;
}

.hero {
  position: relative;
  z-index: 1;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 20px;
}

.hero-text {
  max-width: 760px;
  padding: 28px 32px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.hero-text h1 {
  font-size: clamp(30px, 4vw, 48px);
  color: #fff;
  margin-bottom: 10px;
}

.hero-text p {
  color: #f2f6ff;
  font-size: 16px;
}

/* SEARCH FIX */
.header-right input {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.header-right input::placeholder {
  color: #ddd;
}
.hidden {
  display: none;
}
.category-card .color-select {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.category-card {
  overflow: hidden;
}
.color-select label {
  font-size: 12px;
}
.color-select label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.color-select img.color-thumb {
  width: 30px;
  height: 30px;
  border: 2px solid #ccc;
  border-radius: 50%;
  object-fit: cover;
  transition: 0.3s;
}
.section-title {
  display: flex;
  align-items: center; /* ✅ vertical center fix */
  gap: 12px;
}

.section-title h2 {
  margin: 0; /* ❗ extra space remove */
  line-height: 1; /* ❗ text center align */
}

.section-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
  display: block; /* ✅ image baseline issue fix */
}

.color-select input[type="radio"]:checked + img.color-thumb {
  border-color: #0b2c5f;
  transform: scale(1.1);
}

.category-hero .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 80px;
  color: white;
}

.category-hero h1 {
  font-size: 40px;
}

.category-hero p {
  margin-top: 10px;
  color: #ddd;
}

/* SECTION */
.category-section {
  padding: 50px 50px;
  border-radius: 28px;
  margin: 36px 20px;
  color: white;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

.category-section h2 {
  margin-bottom: 20px;
}

/* GRID */
.category-grid {
  display: grid;
  gap: 22px;
  justify-items: center;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* FIX ONLY ELECTRONICS (where issue is) */
.electronics .category-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
/* Show only first 4 cards in Electronics */
.hidden {
  display: none;
}

.bg-slider {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow: hidden;
  z-index: -1;
}

.bg-slider img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;

  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.bg-slider img.active {
  opacity: 1;
}

/* WEIGHT DROPDOWN */
.weight-select {
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 13px;
}

/* CARD */
.category-card {
  width: 100%;
  max-width: 240px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
  padding: 16px;
  border-radius: 20px;
  box-shadow: 0 12px 26px rgba(7, 24, 56, 0.12);
  transition: 0.3s;
  text-align: center;
  border: 1px solid rgba(11, 44, 95, 0.08);
}

.price {
  font-size: 16px;
  font-weight: bold;
  color: #0b2c5f;
  margin-top: 5px;
}

.category-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 14px;
  background: #f5f5f5;
  padding: 8px;
}

.category-card h3 {
  margin: 10px 0;
}

.category-card p {
  color: #555;
}

/* BUTTON */
.category-card button {
  margin-top: 12px;
  padding: 10px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0b2c5f 0%, #3a6fd8 100%);
  color: white;
  cursor: pointer;
  transition: 0.3s;
  width: 100%;
  font-weight: 700;
}

.category-card button:hover {
  background: linear-gradient(135deg, #081f45 0%, #2f56a8 100%);
  transform: translateY(-2px) scale(1.01);
}

/* HOVER EFFECT */
.category-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 18px 36px rgba(7, 24, 56, 0.16);
}

/* SECTION GRADIENT BACKGROUNDS */
.category-section {
  padding: 50px 50px;
  border-radius: 20px;
  margin: 40px 20px;
  color: white;
}

/* Fashion */
.fashion {
  background: linear-gradient(135deg, #0b2c5f, #1e3c72, #2a5298);
}

/* Home Essentials */
.home-essentials {
  background: linear-gradient(135deg, #8e0e00, #1f1c18);
}

/* Electronics */
.electronics {
  background: linear-gradient(135deg, #42275a, #734b6d, #c79081);
}

/* Snacks */
.snacks {
  background: linear-gradient(135deg, #1f4037, #99f2c8);
}

/* Make cards pop on dark background */
.category-card {
  background: rgba(255, 255, 255, 0.95);
  color: #000;
}

/* Section header alignment */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

/* View button premium look */
.view-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff 0%, #f2f7ff 100%);
  color: #0b2c5f;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 8px 18px rgba(255, 255, 255, 0.2);
}

.view-btn:hover {
  background: #eef4ff;
  transform: translateY(-2px);
}

.fashion {
  background: linear-gradient(135deg, #0b2c5f 0%, #45a7e6 100%);
}

.electronics {
  background: linear-gradient(135deg, #42275a, #734b6d);
}

.snacks {
  background: linear-gradient(135deg, #1f4037, #99f2c8);
}

/* OVERLAY BACKGROUND */
#subscribePopup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(0, 0, 0, 0.5);

  display: none; /* hidden by default */
  justify-content: center;
  align-items: center;

  z-index: 9999;
}

/* POPUP BOX */
#subscribePopup .popup-content {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  width: 320px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: popupFade 0.3s ease;
}

/* TEXT */
#subscribePopup h3 {
  margin-bottom: 10px;
  color: #0a7b6c;
}

#subscribePopup p {
  font-size: 14px;
  color: #555;
}

/* BUTTON */
#subscribePopup button {
  margin-top: 15px;
  padding: 10px 20px;
  background: #0a7b6c;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.social-icons a {
  color: inherit;
  text-decoration: none;
}

.social-icons a:hover i {
  transform: scale(1.2);
  color: #0b2c5f;
}

/* ANIMATION */
@keyframes popupFade {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 768px) {
  .hero-wrapper {
    min-height: 320px;
  }

  .hero {
    min-height: 320px;
  }

  .category-section {
    padding: 28px 15px;
    margin: 20px 10px;
    border-radius: 18px;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 15px;
  }

  .category-card {
    width: 100% !important;
    padding: 12px;
  }

  .category-card img {
    height: 140px;
  }

  .section-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .section-title h2 {
    font-size: 20px;
  }

  .section-icon {
    width: 40px;
    height: 40px;
  }
}

.category-card .view-cart {
  display: block;
  width: 100%;
  margin: 8px 0 0 0;
  padding: 6px 0;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.3s;
  text-align: center;
}

.category-card .view-cart:hover {
  background: #1e7e34;
  transform: scale(1.05);
}

/* CATEGORY GRID FIX */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* TABLET */
@media (max-width: 992px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* MOBILE */
@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .category-card {
    padding: 10px;
  }

  .category-card img {
    height: 210px;
    object-fit: cover;
  }

  .category-card h3 {
    font-size: 14px;
  }

  .price {
    font-size: 14px;
  }

  .add-cart {
    font-size: 12px;
    padding: 6px;
  }
}

/* SMALL MOBILE */
@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}
