/* === GLOBAL STYLES === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Arial', sans-serif;
}

body {
  color: #000;
  height: 100%;
}

/* === NAVBAR === */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0c0e13;
  padding: 15px 40px;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 999;
}

.logo { font-size: 24px; font-weight: bold; }
.logo span { color: #ccccff; }

.navbar nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}
.navbar nav ul li a {
  text-decoration: none;
  color: #fff;
  font-size: 16px;
  transition: color .3s;
}
.navbar nav ul li a:hover { color: #ccccff; }

.nav-buttons { display: flex; align-items: center; gap: 15px; }
.nav-buttons i { font-size: 20px; cursor: pointer; }

.sign-in, .sign-up, .sign-out {
  background: #6a0dad;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
}
.menu-icon { font-size: 26px; cursor: pointer; display: none; }

/* === HERO SECTION === */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 60px 4%;
  border-radius: 15px;
  margin: 0 auto;
  max-width: 1200px;
  flex-wrap: wrap;
}

.hero-text {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeInUp .8s ease-in-out;
}

.hero-text .discount {
  color: #6a0dad;
  font-weight: 600;
  font-size: 18px;
}

.hero-text h1 {
  font-size: 40px;
  line-height: 1.3;
}

.hero-text .highlight {
  background: linear-gradient(90deg, #6a0dad, #9b4dff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text .description {
  color: #555;
  font-size: 16px;
  margin-bottom: 6px;
}

/* Search Bar (desktop) */
.search-bar {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 8px;
  border-radius: 999px;
  box-shadow: 0 4px 15px rgba(0,0,0,.08);
  width: 100%;
  max-width: 560px;
  margin-top: 8px;

  /* push to right on large screens */
  align-self: flex-end;
  margin-left: auto;
  order: 2;
}

.search-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-size: 16px;
  border-radius: 999px;
}

.search-bar button {
  border: none;
  background: linear-gradient(90deg, #6a0dad, #9b4dff);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
  padding: 12px 16px;
  max-width: 55px;
}
.search-bar button:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 10px rgba(106,13,173,.5);
}

/* Hero Image + Slideshow */
.hero-image {
  flex: 1;
  min-width: 280px;
  display: flex;
  justify-content: center;
}

.slideshow-container {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 18px;
  position: relative;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.2);
}

.mySlides { display: none; width: 100%; height: 100%; }
.mySlides img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
}
.mySlides .text {
  position: absolute;
  bottom: 10px; left: 0; width: 100%;
  text-align: center; color: #fff; font-weight: bold;
  background: rgba(0,0,0,.4);
  padding: 8px 0; font-size: 14px;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}
.fade { animation: fadeEffect 1.5s; }
@keyframes fadeEffect { from {opacity:.4} to {opacity:1} }

@keyframes fadeInUp { from {opacity:0; transform: translateY(12px);} to {opacity:1; transform: translateY(0);} }

/* === TRENDING CATEGORIES === */
.trending { text-align: center; padding: 30px; font-size: 22px; }

.trending-categories {
  text-align: center; padding: 50px 0; background-color: #ffffff;
  margin: 0 30px; border-radius: 20px; box-shadow: 0 4px 10px rgba(0,0,0,.2);
}
.trending-categories h2 { font-size: 24px; font-weight: 700; margin-bottom: 20px; }
.emoji { font-size: 22px; }

.categories-container {
  display: flex; justify-content: center; gap: 30px;
  flex-wrap: wrap; padding: 20px;
}

.category img {
  width: 80px; height: 80px; border-radius: 50%;
  object-fit: cover; border: 2px solid #ddd; padding: 5px;
  transition: transform .3s, border-color .3s;
}
.category p {
  margin-top: 8px; font-size: 16px; font-weight: 700; color: #333; text-align: center;
}
.category img:hover { transform: scale(1.1); border-color: #6a0dad; }

/* === PRODUCTS SECTION === */
.products { text-align: center; padding: 40px 20px; }
.products h2 { font-size: 24px; font-weight: 700; }

.product-grid {
  display: flex; justify-content: center; gap: 20px;
  flex-wrap: wrap; margin-top: 20px;
}

.product-card {
  background: #fff; border-radius: 12px; padding: 20px;
  width: 250px; box-shadow: 0 4px 10px rgba(0,0,0,.1);
  text-align: center; padding-bottom: 0; display: flex; flex-direction: column; justify-content: space-between;
}
.product-card img { width: 100%; height: auto; border-radius: 5px; }

.name { margin: 4px; text-align: left; padding-left: 5px; }
.price { font-size: 18px; font-weight: 700; color: #000; margin: 8px 4px; text-align: left; }

.add-to-cart {
  background: #6a0dad; color: #fff; padding: 10px 25px;
  border: none; border-radius: 6px; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; gap: 5px;
}
.add-to-cart:hover { background: #563cd6; }

.wishlist {
  background: none; border: none; font-size: 25px; color: #000; cursor: pointer;
  position: relative; left: 70px; bottom: 30px;
}
.wishlist:hover { color: red; }

.stars { text-align: left; padding-left: 9px; color: rgb(255, 196, 0); }

/* === RESPONSIVE === */

/* Tablet */
@media (max-width: 992px) {
  .hero { padding: 40px 24px; gap: 24px; }
  .hero-text h1 { font-size: 2rem; line-height: 1.25; }
  .hero-text .discount { font-size: 1rem; }
  .hero-text .description { font-size: 1rem; }
  .slideshow-container { max-width: 360px; }
}

/* ===== MOBILE (≤768px): search → slideshow → hero text ===== */
/* ===== MOBILE (≤768px): search → slideshow → hero text ===== */
@media (max-width: 768px) {
  :root { --gutter: 16px; }

  /* Stack hero vertically */
  .hero {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px var(--gutter) 0;
  }

  /* Hero text before slideshow, search bar first inside hero text */
  .hero-text {
    order: -1;
    margin: 8px auto;
    max-width: 100%;
    text-align: center;
    padding: 0;
  }
  .search-bar {
    order: -2; /* FIRST item */
    width: 100%;
    margin: 6px 0 10px;
    padding: 10px 12px;
    border: 1px solid #ececf3;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    align-self: center;
  }
  .search-bar input {
    width: auto !important;
    flex: 1;
    min-width: 0;
    font-size: 15px;
    padding: 10px 12px;
  }
  .search-bar button { padding: 10px 14px; }

  /* Slideshow comes after hero text */
  .hero-image {
    order: 0;
    width: 100%;
    justify-content: center;
  }
  .slideshow-container {
    width: 100%;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
  }
  .mySlides, .mySlides img { height: 100%; }
  .mySlides .text { font-size: 14px; padding: 6px 0; }

  /* Hero text sizing */
  .hero-text h1 {
    font-size: 1.2rem;
    line-height: 1.4;
    margin-bottom: 6px;
  }
  .hero-text .description { font-size: .95rem; }
  .hero-text p { font-size: 0.95rem; line-height: 1.5; }

  /* Categories: smaller icons, 3 per row */
  .trending-categories {
    background: transparent;
    box-shadow: none;
    margin: 10px 0 0;
    padding: 10px 0 0;
  }
  .categories-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 8px;
    padding: 10px var(--gutter) 16px;
  }
  .category { text-align: center; }
  .category img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid #ececf3;
    padding: 5px;
  }
  .category p { font-size: 11px; margin-top: 5px; }

  /* Products: exactly 3 per row */
  .products { padding: 16px var(--gutter) 32px; }
  .product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
  }
  .product-card {
    width: auto;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
  }
  .product-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 8px;
  }
  .name { font-size: 12px; margin: 4px 0; padding-left: 0; }
  .price { font-size: 13px; margin: 4px 0; text-align: left; }
  .stars { font-size: 9px; padding-left: 0; }
  .add-to-cart { font-size: 12px; padding: 8px 10px; justify-content: center; }
  .wishlist { left: auto; bottom: auto; font-size: 18px; }


  .categories-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 8px;
    padding: 10px 16px 16px;
  }
  .category img {
    width: 52px;
    height: 52px;
    padding: 4px;
    border-radius: 50%;
    border: 1px solid #ececf3;
  }
  .category p {
    font-size: 11px;
    margin-top: 5px;
  }

  /* Products: 2–3 per row depending on space */
  .products {
    padding: 16px 12px 32px;
  }
  .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 12px;
  }
  .product-card {
    width: auto;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
  }
  .product-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 8px;
  }
  .name { font-size: 12px; margin: 4px 0; padding-left: 0; }
  .price { font-size: 13px; margin: 4px 0; text-align: left; }
  .stars { font-size: 9px; padding-left: 0; }
  .add-to-cart { font-size: 12px; padding: 8px 10px; justify-content: center; }
  .wishlist { left: auto; bottom: auto; font-size: 18px; }
}

/* --- Mobile tweaks only: smaller categories + 2-up products --- */
@media (max-width: 768px) {
  /* Categories: smaller icons (Flipkart-ish) */
   /* Categories: smaller icons in more compact grid */
  .categories-container {
    grid-template-columns: repeat(4, 1fr) !important; /* fit more in a row */
    gap: 10px 8px !important;
  }
  .category img {
    width: 44px !important;
    height: 44px !important;
    padding: 4px !important;
    border-radius: 50%;
    border: 1px solid #ececf3;
  }
  .category p {
    font-size: 11px !important;
    margin-top: 4px !important;
  }

  /* Products: fixed at 2 per row */
  .product-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
  .product-card {
    padding: 10px !important;
    border-radius: 10px !important;
  }
  .product-card img {
    width: 100% !important;
    aspect-ratio: 3 / 4 !important;
    object-fit: cover !important;
    border-radius: 8px !important;
  }

  /* Smaller category icons */
.trending-categories .category img {
  width: 50px !important;
  height: 50px !important;
}

/* Force 2 products per row on mobile */
.product-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}

.product-card img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  width: 100%;
  height: auto;
}

/* Slightly smaller card padding for mobile */
.product-card {
  padding: 8px !important;
}

}

/* --- Mobile: make product cards smaller (2 per row) --- */
@media (max-width: 768px) {
  /* keep 2-up grid */
  .product-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* tighter card */
  .product-card {
    width: auto !important;
    padding: 8px !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.06) !important;
  }

  /* CONTROL THE VISUAL SIZE: cap image height */
  .imgb {
    height: 150px;                /* ↓ change this number to make tiles smaller/larger */
    overflow: hidden;
    border-radius: 10px;
  }
  .product-card img {
    width: 100% !important;
    height: 100% !important;      /* fill the .imgb box */
    object-fit: cover !important; /* crop nicely */
    border-radius: 10px !important;
  }

  /* compact text + buttons */
  .details { padding: 6px 4px 8px; }
  .name a { font-size: 13px !important; line-height: 1.25; }
  .price { font-size: 14px !important; margin: 2px 0 6px !important; }
  .stars { font-size: 10px !important; }
  .add-to-cart { font-size: 12px !important; padding: 6px 8px !important; width: 100%; }
  .wishlist { font-size: 16px !important; left: auto; bottom: auto; }
}

/* super-narrow phones: make them even smaller */
@media (max-width: 360px) {
  .imgb { height: 130px; }
}
@media (min-width: 992px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}


/* Guest links styled like the real buttons, but with different classes */
.add-to-cart-guest {
  background: #6a0dad; color: #fff; padding: 10px 25px;
  border: none; border-radius: 6px; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; gap: 5px; text-decoration: none;
}
.add-to-cart-guest:hover { background: #563cd6; }

.wishlist-btn-guest {
  background: none; border: none; font-size: 25px; color: #000; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center;
}
.wishlist-btn-guest:hover { color: red; }

/* === ANIMATIONS FOR SECTIONS === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}
