/* ======== Base Reset ======== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', sans-serif;
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ======== Navigation ======== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  height: 70px;
}

#logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.search-bar {
  flex: 1;
  max-width: 500px;
  margin: 0 1rem;
  display: flex;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.search-bar input {
  width: 100%;
  padding: 0.8rem;
  border: none;
  outline: none;
  font-size: 0.9rem;
}

.search-bar button {
  padding: 0 1rem;
  background: #f8f8f8;
  border: none;
  cursor: pointer;
}

.search-bar button img {
  width: 18px;
  height: 18px;
}

#menu {
  display: flex;
  gap: 0.5rem;
}

#menu a {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #333;
}

#menu a img {
  width: 24px;
  height: 24px;
}

.custom-tooltip::after {
  content: attr(data-title);
  font-size: 0.7rem;
  margin-top: 0.3rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.custom-tooltip:hover::after {
  opacity: 1;
}

/* ======== Main Slider ======== */
.slider-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 40%; 
  overflow: hidden;
  margin: 0.1rem 0;
}

.slider-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform 0.5s ease;
}

.slide {
  min-width: 100%;
  height: 100%;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prev {
  left: 10px;
}
.next {
  right: 10px;
}

/* ======== Categories Sections ======== */
.top_cate {
  padding: 1rem;
  text-align: center;
  background: #ffffff;
  margin: 1rem 0;
}

.top_cate h2 {
  font-size: 1.5rem;
  color: #333;
}

.category {
  padding: 0 1rem;
  margin-bottom: 2rem;
}

/* Offer Sliders */
.slider_offer_1, .gro_slide {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.slider_offer_1 img, .gro_slide img {
  scroll-snap-align: start;
  min-width: 100%;
  max-height: 150px;
  object-fit: contain;
}

/* Grid Layouts */
#cate_1, #cate_2, #cate_3 {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

#cate_1 {
  grid-template-columns: repeat(2, 1fr);
}

#cate_2 {
  grid-template-columns: 1fr;
  padding: 2rem;
}

#cate_3 {
  grid-template-columns: repeat(2, 1fr);
  padding: 2rem;
}

.category img {
  width: 100%;
  height: auto;
  border-radius: 70px;
  transition: transform 0.3s;
}

.category img:hover {
  transform: scale(1.02);
}

/* ======== Footer ======== */
footer {
  background: #003152;
  color: white;
  padding: 2rem 1rem;
  margin-top: auto;
}

.main_brands {
  margin-bottom: 1.5rem;
}

#brands {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

#faq {
  margin: 1.5rem 0;
}

#faq p {
  font-size: 0.9rem;
  margin: 1rem 0;
  line-height: 1.6;
}

.user_support {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 1.5rem 0;
}

.user_support h5 {
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
}

.user_support ul {
  list-style: none;
}

.user_support li {
  margin-bottom: 0.5rem;
}

.user_support a {
  color: #ddd;
  text-decoration: none;
  font-size: 0.9rem;
}

.user_support a:hover {
  text-decoration: underline;
}

.pay_support {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.payment_icons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}

.payment_icons img {
  height: 30px;
  width: auto;
}

/* ======== Back to Top Button ======== */
#app_top {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 50px;
  height: 50px;
  background: #58b5e8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
}

#app_top img {
  width: 24px;
  height: 24px;
}

/* ======== Responsive Adjustments ======== */
@media (max-width: 768px) {
  /* Navigation */
  nav {
    flex-wrap: wrap;
    height: auto;
    padding: 0.5rem;
  }

  #logo {
    order: 1;
    margin-right: auto;
  }

  .search-bar {
    display: none;
  }

  #menu {
    order: 2;
    gap: 0.3rem;
  }

  #menu a {
    padding: 0.3rem;
  }

  #menu a img {
    width: 20px;
    height: 20px;
  }

  /* Sliders */
  .slider-container {
    padding-bottom: 60%;
  }

  .nav {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  /* Categories */
  #cate_1,#cate_2, #cate_3 {
    grid-template-columns: 1fr;

  }

  /* Footer */
  .user_support {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .payment_icons {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  /* Navigation */
  nav {
    padding: 0.3rem;
  }

  #logo img {
    height: 35px;
  }

  .search-bar input {
    padding: 0.6rem;
    font-size: 0.8rem;
  }

  /* Sliders */
  .slider-container {
    padding-bottom: 70%;
  }

  /* Footer */
  #faq p {
    font-size: 0.8rem;
  }

  .user_support h5 {
    font-size: 1rem;
  }

  .user_support a {
    font-size: 0.8rem;
  }

  .payment_icons img {
    height: 25px;
  }
}

@media (min-width:768px){
  #cate_2{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
 #cate_2 img:nth-child(3),#cate_2 img:nth-child(4){
  height: 25rem;
  width: 25rem;
 }
  #cate_3 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;

 }
 #cate_3 img {
  height: 20rem;
  width: clamp(15rem, 30vw, 25rem);
    /* ensures image is cropped nicely */
 /* optional: spacing between images */
}

footer{
  padding: 3rem;
}

}
