/* css/style.css */

/* --- Swiper Slider --- */
.hero-slider {
  position: relative;
  overflow: hidden;
}
.hero-slider .swiper-pagination {
  bottom: 10px !important;
}
.hero-slider .swiper-button-next,
.hero-slider .swiper-button-prev {
  top: 54% !important;
  transform: translateY(-50%) !important;
  width: 48px;
  height: 48px;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  color: #fff !important;
  transition: background-color 0.3s;
  z-index: 10;
}
.hero-slider .swiper-button-next:hover,
.hero-slider .swiper-button-prev:hover {
  background-color: rgba(0, 0, 0, 0.6);
}
.hero-slider .swiper-button-next::after,
.hero-slider .swiper-button-prev::after {
  font-size: 20px !important;
}
.hero-slider .swiper-button-prev {
  left: 0 !important;
}
.hero-slider .swiper-button-next {
  right: 0 !important;
}

.swiper-button-next,
.swiper-button-prev {
  color: #84cc16 !important;
}
.swiper-pagination-bullet-active {
  background: #84cc16 !important;
}
.trending-products-slider .swiper-slide {
  width: auto;
  flex-shrink: 0;
  display: block;
}

/* --- Desktop Styles --- */
@media (min-width: 1024px) {
  #nav-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-item-wrapper {
    /* This allows the absolute panel to be positioned relative to the <nav> tag */
    position: static;
  }
  .mega-menu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%; /* This makes the panel span the full width of the nav */
    z-index: 50;
    background-color: white;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transition: all 0.3s ease-in-out;
    transform: translateY(-0.75rem);
    opacity: 0;
    visibility: hidden;
  }
  .mega-menu-panel ul li a:hover {
    color: #7fbc36;
  }

  .mega-menu-panel.is-active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .mobile-accordion-trigger::after {
    display: none;
  }
  .mobile-accordion-content {
    /* On desktop, the nested content should be part of the grid */
    display: grid !important;
  }
}

/* --- Mobile Styles --- */
@media (max-width: 1023px) {
  #nav-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    z-index: 100;
    flex-direction: column;
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  }

  .nav-item-wrapper {
    width: 100%;
    position: relative;
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #f3f4f6;
  }

  .nav-item-wrapper:last-child .nav-link {
    border-bottom: none;
  }

  .mega-menu-panel {
    display: none;
    overflow: hidden;
    transition: height 0.3s ease-in-out, padding 0.3s ease-in-out;
    padding: 0 0.5rem;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
  }

  .mega-menu-panel.is-active {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .mega-menu-panel .grid {
    /* display: flex !important;
     */
    flex-direction: column !important;
  }

  .mega-menu-panel ul li a {
    display: block;
    padding: 0.3rem 0;
  }

  .mega-menu-panel .lg\:col-span-1,
  .mega-menu-panel .lg\:col-span-3 {
    grid-column: span 1 / span 1 !important;
  }

  .mega-menu-panel .border-r {
    border-right: none !important;
    padding-right: 0 !important;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }

  .mega-menu-panel h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem !important;
  }

  .mega-menu-panel ul {
    display: flex;
    flex-direction: column;
  }

  .nav-link.is-active > i[data-lucide="chevron-down"] {
    transform: rotate(180deg);
    transition: transform 0.3s;
  }

  .mobile-accordion-trigger {
    cursor: pointer;
    position: relative;
    padding-right: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .mobile-accordion-trigger::after {
    content: "+";
    font-weight: bold;
    font-size: 1.2rem;
    color: #7fbc36;
  }

  .mobile-accordion-trigger.is-active::after {
    content: "¡Ý";
  }

  .mobile-accordion-content {
    display: none;
    padding-left: 1rem;
    overflow: hidden;
    transition: height 0.3s ease-in-out;
    background-color: #ffffff;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
  }
}

/* --- suggest search styles --- */
#suggestionsContainer {
  position: absolute;
  z-index: 100;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.suggestion-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}
.suggestion-item:hover,
.suggestion-item.active {
  background-color: #e2e8f0;
}
