/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Mulish', sans-serif;
  background-color: #f6f6f6;
  color: #1a1a1a;
  overflow-x: hidden;
  padding-top: 72px;
}

/* Navigation */
.top-nav {
  background-color: white;
  padding: 16px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: bold;
  font-size: 1.5rem;
}

nav {
  display: flex;
  align-items: center;
  flex: 1;
  margin: 0 20px;
}

.main-nav {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  color: #1a1a1a;
  font-weight: 500;
}

/* Search bar */
.nav-search-wrapper {
  position: relative;
  flex: 1;
  max-width: 800px;
  margin: 0 2rem;
}

.nav-search {
  padding: 12px 45px;
  font-size: 0.9rem;
  width: 100%;
  border-radius: 30px;
  background: #f0f0f0 url('https://cdn-icons-png.flaticon.com/512/622/622669.png') no-repeat 15px center;
  background-size: 20px;
  border: none;
  transition: all 0.3s ease;
  outline: none;
}

.nav-search:focus {
  background-color: #e6e6e6;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.nav-search-clear {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 2rem;
  padding: 0 8px;
  cursor: pointer;
  color: #999;
  display: none;
}

/* Ensure the search suggestions match the width of the search bar */
.nav-search-wrapper {
  position: relative;
}

.nav-search-wrapper .search-arrow {
  position: absolute;
  right: 10px; /* Fixed position on the right */
  top: 50%;
  transform: translateY(-50%);
  background-color: black;
  color: white;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  display: none;
}

.search-arrow {
  background-color: black;
  color: white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

#searchSuggestions {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 100%; /* Ensure it matches the width of the search bar */
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  z-index: 10;
  list-style: none;
  padding: 0;
  margin: 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Limit top search bar suggestions to 4 lines */
#searchSuggestions li .suggestion-text strong {
  display: -webkit-box;
  -webkit-line-clamp: 4; /* Limit to 4 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  font-size: 0.95rem;
  font-weight: 600;
  color: #000;
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Break long words if necessary */
}

#searchSuggestions li .suggestion-text span {
  color: #666;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Search suggestions */
.search-suggestions {
  position: absolute;
  background: white;
  width: 100%;
  max-width: 400px;
  top: 100%;
  left: 0;
  z-index: 10;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  border-radius: 6px;
  margin-top: 4px;
  padding: 8px 0;
  overflow: hidden;
}

.search-suggestions li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #ddd;
  overflow: hidden;
}

.suggestion-left {
  display: flex;
  align-items: center;
  flex: 1;
  overflow: hidden;
}

.suggestion-left img {
  width: 48px;
  height: 48px;
  margin-right: 8px;
  flex-shrink: 0;
}

.suggestion-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.suggestion-text strong {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-text span {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-price {
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
  margin-left: 8px;
  flex-shrink: 0;
}

/* Hero suggestions specific styles - only override what's different */
.hero-suggestions.search-suggestions {
  max-width: none;
  width: 100%;
  text-align: left;
}

.hero-suggestions li {
  text-align: left;
}

.hero-suggestions .suggestion-text strong {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  line-height: 1.2;
  color: #000;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  margin-bottom: 4px;
  max-height: 4.8em; /* 4 lines * 1.2 line-height */
  overflow: hidden;
}

.hero-suggestions .suggestion-text span {
  color: #666;
  font-size: 0.85rem;
  text-align: left;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.hero-suggestions .suggestion-price {
  color: #111;
  font-weight: bold;
  font-size: 0.85rem;
  text-align: right;
}

/* Hamburger menu */
.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #1a1a1a;
  transition: all 0.3s ease;
}

/* Login button */
.login-btn {
  background-color: #f1f1f1;
  color: #1a1a1a;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.login-btn:hover {
  background-color: #e5e5e5;
}

.mobile-only {
  display: none;
}

.login-item {
  margin-left: auto;
}

/* Mobile styles */
@media (max-width: 1024px) {
  body {
    padding-top: 133px;
  }

  .nav-container {
    flex-wrap: wrap;
    padding: 8px;
  }

  .top-row {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 8px;
  }

  .hamburger-menu {
    display: flex !important;
  }

  .logo {
    flex: 1;
    text-align: center;
  }

  nav {
    width: 100%;
    position: relative;
  }

  .nav-search-wrapper {
    width: 90;
    max-width: 600px;
    margin: 0 auto;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    padding: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  .main-nav.active {
    display: flex;
  }

  .main-nav li {
    margin: 8px 0;
  }

  .main-nav .mobile-only {
    margin-top: 16px;
  }

  .main-nav .login-btn {
    width: 100%;
    padding: 12px;
  }

  .hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  /* Mobile product grid */
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .product-carousel .product-card {
    min-width: 150px;
  }

  .mobile-only {
    display: block;
  }
  
  .desktop-only {
    display: none;
  }

  .hero-suggestions img,
  .search-suggestions img {
    width: 32px;
    height: 32px;
  }

  .hero-suggestions .suggestion-left,
  .search-suggestions .suggestion-left {
    max-width: calc(100% - 70px);
  }

  .hero-suggestions .suggestion-price,
  .search-suggestions .suggestion-price {
    min-width: 60px;
  }

  .hero-suggestions .suggestion-text strong {
    margin-bottom: 2px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .hero-suggestions img,
  .search-suggestions img {
    width: 32px;
    height: 32px;
  }
}

/* Hero section */
.hero {
  background: #70939f;
  color: white;
  text-align: center;
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
  border-radius: 16px;
  margin-top: 20px;
}

@media (max-width: 1200px) {
  .hero {
    margin: 20px 16px 0;
    border-radius: 12px;
  }
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border-radius: 10px;
  padding: 10px;
  margin: 0 auto;
  width: 90%;
  max-width: 600px;
}

.search-wrapper input[type="text"] {
  border: none;
  outline: none;
  flex: 1;
  font-size: 1.2rem;
  padding: 10px 40px 10px 15px; /* Add padding to account for icons */
  background: transparent;
}

.search-wrapper .search-clear {
  position: absolute;
  right: 50px; /* Position it to the left of the search-arrow */
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 2rem;
  padding: 0 8px;
  cursor: pointer;
  color: #999;
  display: none; /* Initially hidden */
}

.search-wrapper .search-clear.visible {
  display: block; /* Show when needed */
}

.search-wrapper .search-arrow {
  position: absolute;
  right: 10px; /* Fixed position on the right */
  top: 50%;
  transform: translateY(-50%);
  background-color: black;
  color: white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}


/* Product section */
.popular-products, .trending-products, .product-listing {
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.popular-products h2, .trending-products h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
}

.product-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  max-width: 205px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: transform 0.2s ease;
  cursor: pointer;
  overflow: hidden;

  position: relative;
  background-color: #fff;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px; /* Add spacing below the header */
}

.discount-badge {
  background-color: #ff9999; /* Pale red */
  color: #333; /* Darker text for better readability */
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  }

.wishlist-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.product-image {
  width: 100%;
  height: auto;
  margin: 16px 0;
}

.product-name {
  margin-top: 16px; /* Add spacing between the header and the product name */
  font-size: 16px;
  font-weight: bold;
}

.product-category {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.product-price {
  font-size: 16px;
  margin: 8px 0;
}

.new-price {
  color: #000;
  font-weight: bold;
}

.old-price {
  text-decoration: line-through;
  color: #999;
  margin-left: 8px;
}

.product-stores {
  font-size: 14px;
  color: #666;
  margin: 8px 0;
}

.product-rating {
  font-size: 14px;
  color: #ffcc00;
}

/* Specific style for the main heading in the product listing section */
.product-listing-heading {
  font-size: 2rem; 
  font-weight: bold;
  margin-bottom: 20px;
  padding: 10px 0;
  color: #333;
}

/* Category icons */
.category-icons {
  background-color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.icon-row {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1000px;
}

.icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.9rem;
  color: #333;
  cursor: pointer;
}

.icon-item img {
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
}

/* Footer */
.site-footer {
  background-color: #000;
  color: #fff;
  padding: 40px 20px 20px;
  font-size: 0.95rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
}

.footer-column h4 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: #fff;
}

.footer-column ul {
  list-style: none;
  padding: 0;
}

.footer-column ul li {
  margin-bottom: 8px;
}

.footer-column ul li a {
  text-decoration: none;
  color: #ccc;
  transition: color 0.2s;
}

.footer-column ul li a:hover {
  color: #fff;
}

.footer-bottom {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #333;
  font-size: 0.85rem;
  color: #aaa;
}

/* Sorting bar */
.sorting-bar {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 20px;
  display: flex;
  justify-content: flex-end;
}

.sort-dropdown {
  position: relative;
}

#sort-toggle {
  background: none;
  border: none;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.95rem;
}

#sort-options {
  position: absolute;
  top: 110%;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  list-style: none;
  padding: 8px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 100;
}

#sort-options li {
  padding: 8px 16px;
  cursor: pointer;
}

#sort-options li:hover {
  background-color: #f1f1f1;
}

.hidden {
  display: none;
}

/* Product carousel */
.product-carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  margin: 0 -20px;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* Show scrollbar only when content overflows */
.product-carousel::-webkit-scrollbar {
  height: 8px;
  display: block;
}

.product-carousel::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.product-carousel::-webkit-scrollbar-track {
  background: transparent;
}

/* Hide scrollbar when not needed */
.product-carousel:not(:hover)::-webkit-scrollbar-thumb {
  background: transparent;
}

/* Mobile styles */
@media (max-width: 768px) {
  .product-carousel::-webkit-scrollbar {
    height: 8px;
  }

  .product-carousel::-webkit-scrollbar-thumb {
    background: #ccc;
  }
}

.product-carousel .product-card {
  min-width: 180px;
  scroll-snap-align: start;
  flex: 0 0 auto;
  margin: 0;
}

/* Responsive styles */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .product-carousel .product-card {
    min-width: 150px;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr 1fr;
  }

  .product-carousel .product-card {
    min-width: 140px;
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  .search-wrapper input[type="text"] {
    font-size: 1rem;
    padding: 10px;
  }

  .search-wrapper .search-clear {
    font-size: 2rem;
    padding: 0 8px;
  }
}

/* Even smaller screens */
@media (max-width: 480px) {
  .search-wrapper input[type="text"] {
    font-size: 0.95rem;
    padding: 10px;
  }

}

/* End of file */



