/* Modern Categories Design - Inspired by fiveten.shop */

/* Categories Grid (Mobile-Only Style) */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.7rem 0;
}

.category-item {
  position: relative;
}

.category-link {
  display: block;
  text-decoration: none;
  color: inherit;
  text-align: center;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.category-image-wrapper {
  position: relative;
  width: 100%;
  height: 130px;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  background: transparent;
}

.category-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.5rem;
}

.featured-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(45deg, #ffc107, #ff8f00);
  color: #000;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3);
}

.category-name {
  margin: 0;
  padding: 0.7rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  background: transparent;
  border-radius: 0 0 10px 10px;
  text-align: center;
  position: relative;
  top: -7px;
  margin-bottom: -7px;
}

/* Mobile Categories Grid */
.mobile-categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  padding: 0.7rem 0;
}

.mobile-category-item {
  position: relative;
}

.mobile-category-link {
  display: block;
  text-decoration: none;
  color: inherit;
  text-align: center;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.mobile-category-image-wrapper {
  position: relative;
  width: 100%;
  height: 100px;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  background: transparent;
}

.mobile-category-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-category-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
}

.mobile-featured-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(45deg, #ffc107, #ff8f00);
  color: #000;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.mobile-category-name {
  margin: 0;
  padding: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #333;
  background: transparent;
  border-radius: 0 0 8px 8px;
  line-height: 1.2;
  text-align: center;
  position: relative;
  top: -6px;
  margin-bottom: -6px;
}

/* Horizontal Subcategories Carousel */
.subcategories-section {
  margin-bottom: 2rem;
  position: relative;
}

.subcategories-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e9ecef;
}

.subcategories-carousel-container {
  position: relative;
  overflow: hidden;
  padding: 1rem 0;
}

.subcategories-carousel {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE 10+ */
  scroll-behavior: smooth;
  padding: 0.5rem;
  gap: 1rem;
}

.subcategories-carousel::-webkit-scrollbar {
  display: none;
  /* Chrome Safari */
}

.subcategory-item {
  flex: 0 0 auto;
  width: 120px;
  text-align: center;
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
}

.subcategory-image-wrapper {
  width: 60px;
  height: 60px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.subcategory-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.subcategory-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.subcategory-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subcategory-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Navigation Arrows */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.carousel-nav.prev {
  left: 10px;
}

.carousel-nav.next {
  right: 10px;
}

.carousel-nav i {
  font-size: 1.2rem;
  color: #6c757d;
}

/* Mobile-only design: Media queries removed or simplified */
.categories-loading {
  text-align: center;
  padding: 2rem;
}

.categories-loading .spinner-border {
  color: #667eea;
}