/* Haven Product Loop - Black & White Theme */

.haven-product-loop-container {
  display: flex;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Filters Sidebar */
.haven-filters-sidebar {
  width: 280px;
  background: #ffffff;
  border-left: 2px solid #666666;
  padding: 25px;
  height: fit-content;
  position: sticky;
  top: 20px;
}

.haven-filter-section {
  margin-bottom: 30px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 20px;
}

.haven-filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.haven-filter-section h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Search Input */
#haven-search {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #000000;
  background: #ffffff;
  color: #000000;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

#haven-search:focus {
  border-color: #333333;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

#haven-search::placeholder {
  color: #666666;
}

/* Price Slider */
.haven-price-slider {
  position: relative;
  margin: 20px 0;
}

.haven-range-container {
  position: relative;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  margin: 20px 0;
}

.haven-price-slider input[type="range"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: transparent;
  outline: none;
  -webkit-appearance: none;
  margin: 0;
  pointer-events: none;
}

.haven-price-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #000000;
  cursor: pointer;
  border-radius: 50%;
  pointer-events: all;
  position: relative;
  z-index: 3;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.haven-price-slider input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #000000;
  cursor: pointer;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  pointer-events: all;
  position: relative;
  z-index: 3;
}

.haven-price-slider input[type="range"]::-webkit-slider-track {
  background: transparent;
  height: 6px;
}

.haven-price-slider input[type="range"]::-moz-range-track {
  background: transparent;
  height: 6px;
}

/* Ensure both sliders are visible */
.haven-price-slider input[type="range"]:first-of-type {
  z-index: 2;
}

.haven-price-slider input[type="range"]:last-of-type {
  z-index: 1;
}

.haven-price-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-weight: 600;
  color: #000000;
}

/* Category Filters */
.haven-category-filters {
  max-height: 200px;
  overflow-y: auto;
}

.haven-category-checkbox {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #000000;
}

.haven-category-checkbox input[type="checkbox"] {
  margin-right: 10px;
  width: 16px;
  height: 16px;
  accent-color: #000000;
}

.haven-category-checkbox span {
  flex: 1;
}

/* Load More Button */
.haven-btn {
  padding: 12px 20px;
  border: 2px solid #000000;
  background: #ffffff;
  color: #000000;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.haven-btn:hover {
  background: #000000;
  color: #ffffff;
}

.haven-btn-primary {
  background: #000000;
  color: #ffffff;
}

.haven-btn-primary:hover {
  background: #ffffff;
  color: #000000;
}

/* Products Grid */
.haven-products-grid {
  flex: 1;
}

.haven-products-wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

/* Product Items */
.haven-product-item {
  background: #ffffff;
  transition: all 0.3s ease;
}

.haven-product-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.haven-product-featured {
  grid-column: span 2;
}

/* Featured Product Layout */
.haven-featured-layout {
  height: auto;
}

.haven-featured-content {
  display: flex;
  gap: 20px;
  height: 100%;
}

.haven-featured-image {
  flex: 0 0 40%;
  height: 250px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.haven-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.haven-featured-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.haven-featured-badge {
  background: #000000;
  color: #ffffff;
  padding: 5px;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
  display: inline-block;
  width: fit-content;
}

.haven-product-excerpt {
  font-size: 14px;
  color: #666666;
  line-height: 1.4;
  margin-bottom: 10px;
}

/* Mobile Responsive for Featured Products */
@media (max-width: 768px) {
  .haven-product-featured {
    grid-column: span 1;
  }

  .haven-featured-content {
    flex-direction: column;
    gap: 15px;
  }

  .haven-featured-image {
    flex: none;
    height: 200px;
  }

  .haven-featured-info {
    flex: none;
  }
}

.haven-product-card {
  padding: 10px;
  height: 100%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.3s ease;
}

.haven-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.haven-product-image {
  width: 100%;
  height: auto;
  overflow: hidden;
  margin-bottom: 15px;
}

.haven-product-featured .haven-product-image {
  height: 300px;
}

.haven-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.haven-product-item:hover .haven-product-image img {
  transform: scale(1.05);
}

.haven-product-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.haven-product-title {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 600;
  color: #000000;
  line-height: 1.4;
  text-decoration: none;
}

.haven-product-featured .haven-product-title {
  font-size: 20px;
}

.haven-product-price {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #000000;
}

.haven-product-featured .haven-product-price {
  font-size: 24px;
}

/* Buy Now Button */
.haven-product-actions {
  margin-top: 10px;
  width: 100%;
}

.haven-buy-now-btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: #000000;
  color: #ffffff;
  border: 2px solid #000000;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
  position: relative;
  z-index: 10;
}

.haven-buy-now-btn:hover {
  background: #ffffff;
  color: #000000;
  text-decoration: none;
}

/* Load More Button */
.haven-load-more-container {
  text-align: center;
  margin-top: 30px;
}

#haven-load-more {
  padding: 15px 40px;
  font-size: 16px;
}

/* No Products Message */
.haven-no-products {
  text-align: center;
  padding: 60px 20px;
  font-size: 18px;
  color: #666666;
  background: #ffffff;
  border: 2px solid #e0e0e0;
}

/* Loading State */
.haven-loading {
  text-align: center;
  padding: 40px;
  color: #666666;
}

.haven-loading::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #e0e0e0;
  border-top: 2px solid #000000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Filters Toggle Button (hidden on desktop, shown on mobile) */
.haven-filters-toggle {
  display: none; /* Hidden by default on desktop */
  width: 100%;
  padding: 15px 20px;
  background: #000000;
  color: #ffffff;
  border: none;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 0;
}

.haven-filters-toggle:hover {
  background: #333333;
}

.haven-filters-toggle-text {
  flex: 1;
}

.haven-filters-toggle-icon {
  float: right;
  transition: transform 0.3s ease;
}

.haven-filters-toggle[aria-expanded="true"] .haven-filters-toggle-icon {
  transform: rotate(180deg);
}

/* Filters content always visible on desktop */
.haven-filters-content {
  display: block;
}

/* Ensure toggle button is hidden on desktop/tablet */
@media (min-width: 769px) {
  .haven-filters-toggle {
    display: none !important;
  }
}

/* Responsive Design - Mobile only */
@media (max-width: 768px) {
  .haven-product-loop-container {
    flex-direction: column;
    gap: 15px;
    padding: 10px;
  }

  .haven-filters-sidebar {
    width: 100%;
    position: static;
    padding: 0;
    border-left: none;
    background: transparent;
  }

  /* Show toggle button on mobile only */
  .haven-filters-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
  }

  /* Hide filters content by default on mobile */
  .haven-filters-content {
    display: none;
    padding: 15px;
    background: #ffffff;
    border: 2px solid #000000;
    margin-top: 0;
  }

  /* Show filters content when expanded - using class for better JS control */
  .haven-filters-content.active {
    display: block;
  }

  /* Force 2 columns on mobile - IMPORTANT */
  .haven-products-wrapper {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
    width: 100%;
  }

  /* All product items should take exactly 1 column (not span 2) */
  .haven-product-item,
  .haven-product-featured {
    grid-column: span 1 !important;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  /* Change featured product layout on mobile - stack vertically like normal products */
  .haven-featured-content {
    flex-direction: column;
    width: 100%;
  }

  .haven-featured-image {
    width: 100%;
    height: auto;
    min-width: 0;
  }

  .haven-featured-image img {
    height: auto !important;
    width: 100% !important;
    object-fit: contain !important;
  }

  .haven-featured-info {
    width: 100%;
    min-width: 0;
  }

  /* Hide featured product excerpt on mobile */
  .haven-featured-excerpt {
    display: none;
  }

  /* Hide featured badge on mobile to save space */
  .haven-featured-badge {
    display: none;
  }

  .haven-btn {
    width: 100%;
    padding: 10px 20px;
    font-size: 14px;
  }

  /* Product card sizing for mobile - applies to ALL products */
  .haven-product-card {
    padding: 6px;
  }

  /* All product titles - featured and normal */
  .haven-product-title,
  .haven-featured-title,
  .haven-normal-title {
    font-size: 10px !important;
    margin-bottom: 4px;
    line-height: 1.2;
  }

  /* All product prices - featured and normal */
  .haven-product-price,
  .haven-featured-price,
  .haven-normal-price {
    font-size: 11px !important;
    margin-bottom: 4px;
  }

  /* All buy now buttons */
  .haven-buy-now-btn {
    padding: 8px 12px;
    font-size: 10px !important;
  }

  /* Remove fixed heights for images - let them display full */
  .haven-product-image {
    height: auto;
  }

  .haven-product-featured .haven-product-image {
    height: auto;
  }

  .haven-product-image img {
    height: auto;
    object-fit: contain;
  }
}

/* WooCommerce Star Rating Override */
.haven-product-rating .star-rating {
  font-size: 14px;
}

.haven-product-rating .star-rating:before {
  color: #e0e0e0;
}

.haven-product-rating .star-rating span:before {
  color: #000000;
}

/* Focus States for Accessibility */
.haven-btn:focus,
#haven-search:focus,
.haven-category-checkbox input:focus {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

/* Shortcode Category Styling */
.haven-shortcode-category {
  background: #f8f8f8;
  border: 1px solid #cccccc;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
}

.haven-shortcode-category input[type="checkbox"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.haven-shortcode-category-note {
  display: block;
  font-size: 11px;
  color: #666666;
  font-style: italic;
  margin-top: 2px;
}

.haven-shortcode-category span {
  font-weight: 600;
  color: #333333;
}

/* Print Styles */
@media print {
  .haven-filters-sidebar,
  .haven-load-more-container {
    display: none;
  }

  .haven-product-loop-container {
    display: block;
  }

  .haven-products-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}
