#main-content {
  position: relative;
  padding: 100px 0 50px 0;
  overflow: hidden;
}
#main-content h2.title {
  text-align: center;
  font-size: 50px;
  font-weight: bold;
  color: #1b3668;
  line-height: 100%;
  margin: 0 0 70px 0;
}
#main-content .main-text p {
  font-size: 24px;
  color: #587c7f;
  margin: 0 0 20px 0;
  text-align: justify;
}
#main-content .main-text p:last-of-type {
  margin: 0 0 40px 0;
}

/* Filter Section Container */
.filters-section {
  position: relative;
  background: linear-gradient(to right, #ffffff 0%, #f8faff 100%);
  padding: 2rem 0;
  border-bottom: 1px solid rgba(113, 133, 185, 0.1);
}

/* Filter Wrapper Base Styles */
.filter-wrapper {
  position: relative;
  display: flex;
  margin: 0 auto;
  padding: 1rem;
  overflow-x: auto;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  max-width: 1200px;
  
  /* Enhanced Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #7185b9 transparent;
  -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
  
  &::-webkit-scrollbar {
    height: 4px;
  }
  
  &::-webkit-scrollbar-track {
    background: rgba(113, 133, 185, 0.1);
    border-radius: 2px;
  }
  
  &::-webkit-scrollbar-thumb {
    background-color: #7185b9;
    border-radius: 2px;
  }
  
  /* Fade edges on overflow */
  &::after,
  &::before {
    content: '';
    position: absolute;
    top: 0;
    width: 3rem;
    height: 100%;
    pointer-events: none;
    z-index: 1;
  }
  
  &::before {
    left: 0;
    background: linear-gradient(to right, #ffffff 0%, transparent 100%);
  }
  
  &::after {
    right: 0;
    background: linear-gradient(to left, #ffffff 0%, transparent 100%);
  }
}

/* Filter Item Styles */
.filter-item {
  text-align: center;
  font-size: 0.9375rem;
  color: #7185b9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  padding: 0.75rem 1rem;
  background: transparent;
  font-weight: 500;
  
  /* Hover Effects */
  &:hover {
    color: #1b3668;
    background: rgba(113, 133, 185, 0.05);
    transform: translateY(-1px);
  }
  
  /* Active State */
  &.active {
    color: #1b3668;
    background: rgba(27, 54, 104, 0.05);
    box-shadow: 0 2px 8px rgba(27, 54, 104, 0.05);
    
    &::after {
      content: '';
      position: absolute;
      bottom: 0.5rem;
      left: 50%;
      width: 1.5rem;
      height: 2px;
      background-color: #1b3668;
      transform: translateX(-50%) scaleX(1);
      transition: transform 0.3s ease;
      border-radius: 1px;
    }
  }
  
  /* Loading State (optional) */
  &.loading {
    animation: pulse 2s infinite;
    pointer-events: none;
    opacity: 0.7;
  }
}

/* Hide Uncategorized Items */
.filter-item-uncategorized {
  display: none;
}


/* Responsive Adjustments */
@media (max-width: 1200px) {
  .filter-wrapper {
    padding: 1rem 2rem;
    justify-content: flex-start;
  }
}

@media (max-width: 992px) {
  .filter-wrapper {
    gap: 0.75rem 1rem;
    padding: 1rem 1.5rem;
  }
  
  .filter-item {
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
  }
}

@media (max-width: 768px) {
  .filters-section {
    padding: 1rem;
  }
  
  .filter-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    padding: 0;
    width: 100%;
  }
  
  .filter-item {
    width: 100%;
    font-size: 0.75rem;
    padding: 0.5rem;
    white-space: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 40px;
    margin: 0;
    
    /* Remove hover transform on mobile */
    &:hover {
      transform: none;
    }
  
  }
}

/* Touch Device Optimizations */
@media (hover: none) {
  .filter-item {
    padding: 0.75rem 1rem; /* Larger touch target */
    
    &:hover {
      transform: none; /* Remove hover effects on touch devices */
    }
  }
}

/* Animation Keyframes */
@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 0.5; }
  100% { opacity: 0.7; }
}

/* Optional: Add smooth scroll behavior */
.smooth-scroll {
  scroll-behavior: smooth;
}
#brands-archive .prev {
  position: absolute;
  left: -50px;
  top: -22px;
  cursor: pointer;
  transition: 0.2s linear all;
}
#brands-archive .prev:hover {
  fill: #1b3668;
}
#brands-archive .next {
  position: absolute;
  right: -50px;
  top: -22px;
  cursor: pointer;
  transition: 0.2s linear all;
}
#brands-archive .next:hover {
  fill: #1b3668;
}

#brands-archive {
  padding: 0 0 100px 0;
  min-height: 80vh;
}
#brands-archive .brand-box-wrapper {
  position: static;
  margin: 0 0 20px 0;
  flex-basis: calc(100% / 5);
  display: flex;
  padding: 0;
}
#brands-archive .brand-image-box {
  text-align: center;
  cursor: pointer;
}
#brands-archive .brand-image-box img {
  transition: 0.2s linear all;
}
#brands-archive .brand-image-box:hover img {
  scale: 1.1;
}
/* ---- modal ---- */
#brands-archive .brand-modal-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(255,255,255,0.4);
  z-index: 10;
}
#brands-archive .brand-modal-holder {
  position: relative;
}
#brands-archive .brand-modal-box {
  display: flex;
  background-color: #FFF;
  padding: 50px 100px;
  border: 2px solid #bbbfd8;
}
#brands-archive .brand-modal-box .brand-info {
  flex: 1;
}
#brands-archive .brand-modal-box .brand-info img {
  margin: 0 0 20px 0;
}
#brands-archive .brand-modal-box .brand-info p {
  font-size: 18px;
  color: #1b3668;
  margin: 0 0 20px 0;
}
#brands-archive .brand-modal-box .brand-info a {
  font-size: 14px;
  margin: 0 0 0 0;
  padding: 18px 25px;
}
#brands-archive .brand-modal-box .brand-image {
  text-align: right;
  flex: 1;
}
#brands-archive .brand-modal-box .brand-image img {
  max-width: 80%;
  width: 100%;
  height: auto;
}
#brands-archive .close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background-color: #7185ba;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s linear all;
}
#brands-archive .close-modal:hover {
  background-color: #1a3668;
}

@media only screen and (max-width: 768px) {
  #main-content {
    padding: 50px 0 25px 0;
  }
  #main-content h2.title {
    font-size: 32px;
    margin: 0 0 30px 0;
  }
  #main-content .main-text p {
    font-size: 16px;
  }
  #main-content .main-text p:last-of-type {
    margin: 0;
  }

  #brands-archive {
    padding: 25px 0 50px 0;
  }
  #brands-archive .brand-box-wrapper {
    flex-basis: calc(100% / 3);
  }
  #brands-archive .next {
    width: 30px;
    right: 0;
  }
  #brands-archive .prev {
    width: 30px;
    left: 0;
  }
  #brands-archive .brand-modal-box {
    display: block;
    text-align: center;
    padding: 20px;
  }
  #brands-archive .brand-modal-box .brand-image {
    display: none;
  }
  #brands-archive .brand-modal-box .brand-info p {
    margin: 0 0 40px 0;
  }
  #brands-archive .brand-modal-box .brand-info a {
    margin: 0 auto;
  }
  #brands-archive .brand-image-box img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 150px;
  }
  .filter-wrapper .filter-item {
    margin: 10px 15px 10px 0;
    padding-right: 15px;
  }
}
