/* Product Brand Styles */
.product-brand {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.product-brand a {
  color: #007cba;
  text-decoration: none;
  font-weight: 600;
}

.product-brand a:hover {
  color: #005a87;
  text-decoration: underline;
}

/* Product Tags Styles */
.product-tags {
  margin-top: 10px;
}

.sidebar-widget.product-tag {
  display: block;

  color: #495057;

  font-size: 12px;
  text-decoration: none;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
  margin-bottom: 30px;
}

.product-tag a {
  color: #495057;
  text-decoration: none;
}

/* Brand Archive Page */
.brand-archive .brand-description {
  margin-bottom: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.brand-products {
  margin-top: 30px;
}

/* Brand Filter Widget */
.widget_brand_filter ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget_brand_filter li {
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.widget_brand_filter li:last-child {
  border-bottom: none;
}

.widget_brand_filter a {
  color: #333;
  text-decoration: none;
}

.widget_brand_filter a:hover {
  color: #007cba;
}

.widget_brand_filter .count {
  float: right;
  color: #999;
  font-size: 12px;
}

/* Brand Slider Styles */
.brand-active {
  position: relative;
  overflow: hidden;
  padding-left: 60px;
  padding-right: 60px;
}

.brand-active .brand-item {
  display: inline-block;
  vertical-align: middle;
  margin: 0 10px;
  transition: transform 0.3s ease;
  aspect-ratio: 1;
  max-height: 100px;
  min-height: 100x;
}

.brand-active .brand-item:hover {
  transform: scale(1.05);
}

.brand-active .brand-item a {
  display: block;
  text-decoration: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.brand-active .brand-item a:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.brand-active .brand-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  margin: 0 10px;
}

.brand-active .brand-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
  background-color: #fff; /* White background for the container */
  cursor: pointer;
}

.brand-active .brand-item img {
  max-width: 100px; /* Slightly smaller than container for padding effect */
  max-height: 100px; /* Slightly smaller than container for padding effect */
  width: auto;
  height: auto;
  object-fit: contain; /* Maintain aspect ratio while fitting in container */
  display: block;
  transition: transform 0.3s ease;
  background-color: transparent; /* Transparent background for the image */
}

.brand-active .brand-item a:hover img {
  transform: scale(1.05);
}

.brand-active .brand-item a:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Slick Slider Overrides */
.brand-active .slick-track {
  display: flex;
  align-items: center;
}

.brand-active .slick-slide {
  height: auto;
}

.brand-active .slick-prev,
.brand-active .slick-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 18px;
  transition: all 0.3s ease;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer !important;
  outline: none;
}

.brand-active .slick-prev:hover,
.brand-active .slick-next:hover {
  background: #007cba;
  border-color: #007cba;
  box-shadow: 0 4px 20px rgba(0, 124, 186, 0.3);
  color: #fff;
  transform: translateY(-50%) scale(1.05);
}

.brand-active .slick-prev:active,
.brand-active .slick-next:active {
  transform: translateY(-50%) scale(0.95);
}

.brand-active .slick-prev:focus,
.brand-active .slick-next:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

.brand-active .slick-prev {
  left: 10px;
}

.brand-active .slick-next {
  right: 10px;
}

/* Ensure arrows are always visible */
.brand-active:hover .slick-prev,
.brand-active:hover .slick-next {
  opacity: 1;
  visibility: visible;
}
.brand-active .slick-prev,
.brand-active .slick-next {
  opacity: 0;
  visibility: hidden;
}
.brand-active:hover .slick-prev,
.brand-active:hover .slick-next {
  opacity: 1;
  visibility: visible;
}
.brand-active .slick-prev::before,
.brand-active .slick-next::before {
  display: none !important;
}
/* Adjust padding for mobile */
@media (max-width: 768px) {
  .brand-active {
    padding-left: 50px;
    padding-right: 50px;
  }
}

@media (max-width: 480px) {
  .brand-active {
    padding-left: 40px;
    padding-right: 40px;
  }
}

/* Fallback styles when Slick fails */
.brand-active:not(.slick-initialized) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.brand-active:not(.slick-initialized) .brand-item {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .brand-active .slick-prev {
    left: 5px;
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .brand-active .slick-next {
    right: 5px;
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .brand-active:not(.slick-initialized) {
    gap: 15px;
  }

  .brand-active .brand-item {
    width: 80px;
    height: 80px;
    margin: 0 8px;
  }

  .brand-active .brand-item img {
    max-width: 70px;
    max-height: 70px;
  }
}

@media (max-width: 480px) {
  .brand-active .slick-prev,
  .brand-active .slick-next {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .brand-active .slick-prev {
    left: 2px;
  }

  .brand-active .slick-next {
    right: 2px;
  }

  .brand-active .brand-item {
    width: 60px;
    height: 60px;
    margin: 0 5px;
  }

  .brand-active .brand-item img {
    max-width: 50px;
    max-height: 50px;
  }

  .brand-active:not(.slick-initialized) {
    gap: 10px;
  }
}

/* Visual Color Swatches for Product Edit Page */
.ecom-visual-color-swatches {
  font-size: 12px;
}

.ecom-color-swatches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 8px;
  margin-top: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fafafa;
}

.ecom-color-swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  background: white;
  border: 2px solid transparent;
  position: relative;
}

.ecom-color-swatch-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ecom-color-swatch-item.selected {
  border-color: #007cba;
  background: #f0f8ff;
}

.ecom-color-swatch-item.selected::after {
  content: "✓";
  position: absolute;
  top: -5px;
  right: -5px;
  background: #007cba;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
}

.ecom-color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #e0e0e0;
  margin-bottom: 4px;
  transition: all 0.2s ease;
  position: relative;
}

.ecom-color-swatch-item:hover .ecom-color-swatch {
  border-color: #007cba;
  transform: scale(1.1);
}

.ecom-color-swatch-item.selected .ecom-color-swatch {
  border-color: #007cba;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
}

.ecom-color-name {
  font-size: 10px;
  text-align: center;
  color: #666;
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecom-color-swatch-item.selected .ecom-color-name {
  color: #007cba;
  font-weight: 600;
}

.ecom-selected-colors-info {
  margin-top: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.ecom-selected-colors-info strong {
  color: #495057;
}

.selected-count {
  color: #007cba;
  font-weight: bold;
}

/* Responsive adjustments for color swatches */
@media (max-width: 1200px) {
  .ecom-color-swatches-grid {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  }
}

@media (max-width: 768px) {
  .ecom-color-swatches-grid {
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 6px;
    padding: 8px;
  }

  .ecom-color-swatch-item {
    padding: 6px;
  }

  .ecom-color-swatch {
    width: 25px;
    height: 25px;
  }

  .ecom-color-name {
    font-size: 9px;
  }
}

/* Loading state for color swatches */
.ecom-color-swatch-item.loading {
  opacity: 0.6;
  pointer-events: none;
}

.ecom-color-swatch-item.loading .ecom-color-swatch {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Enhanced visual feedback */
.ecom-color-swatch-item.selected .ecom-color-swatch::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E")
    no-repeat center;
  background-size: contain;
  pointer-events: none;
}

/* Color Filtering Styles */
.color-filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.color-filter-list li {
  margin-bottom: 8px;
}

.color-filter-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #333;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.color-filter-link:hover {
  background-color: #f8f9fa;
  border-color: #007cba;
  color: #007cba;
}

.color-filter-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ddd;
  margin-right: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.color-filter-link:hover .color-filter-swatch {
  border-color: #007cba;
  transform: scale(1.1);
}

.color-filter-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.color-filter-link .count {
  font-size: 12px;
  color: #666;
  margin-left: 8px;
}

.color-filter-list li.chosen .color-filter-link {
  background-color: #007cba;
  color: #fff;
  border-color: #007cba;
}

.color-filter-list li.chosen .color-filter-link .color-filter-swatch {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.color-filter-list li.chosen .color-filter-link .count {
  color: #fff;
}

/* Responsive color filtering */
@media (max-width: 768px) {
  .color-filter-link {
    padding: 10px 15px;
  }

  .color-filter-swatch {
    width: 28px;
    height: 28px;
    margin-right: 15px;
  }

  .color-filter-name {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .color-filter-link {
    padding: 12px 16px;
  }

  .color-filter-swatch {
    width: 32px;
    height: 32px;
    margin-right: 16px;
  }

  .color-filter-name {
    font-size: 16px;
  }
}
