/* ===== Custom WooCommerce Archive Styles ===== */

/* Reset WooCommerce default styles */
.woocommerce-page .woocommerce,
.woocommerce .woocommerce {
  max-width: 100%;
}

.woocommerce ul.products {
  margin: 0;
  padding: 0;
}

.wc-custom-archive-wrapper {
  background-color: #f9fafb;
  padding: 40px 0; /* Remove horizontal padding */
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.wc-archive-container {
  max-width: 80%; /* Changed from 1400px to 80% */
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px; /* Reduced gap between sidebar and content */
  position: relative;
  align-items: start;
}

/* ===== Filter Sidebar ===== */
.wc-filter-sidebar {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  height: fit-content;
  position: sticky;
  top: 100px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.wc-filter-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wc-filter-close {
  display: none;
  background: transparent;
  border: none;
  font-size: 28px;
  color: #6b7280;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
}

.wc-filter-close:hover {
  color: #1f2937;
}

.wc-filter-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.wc-filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.wc-filter-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Search in Sidebar */
.wc-filter-section .wc-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.wc-filter-section .wc-search-input {
  width: 100%;
  padding: 10px 40px 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.wc-filter-section .wc-search-input:focus {
  border-color: #5CB3C4;
  box-shadow: 0 0 0 3px rgba(92, 179, 196, 0.1);
}

.wc-search-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.wc-search-btn:hover {
  color: #5CB3C4;
}

/* Category List */
.wc-category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wc-category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  color: #374151;
}

.wc-category-item:hover {
  background-color: #f3f4f6;
}

.wc-category-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #5CB3C4;
}

.wc-category-item span {
  flex: 1;
  user-select: none;
}

.wc-category-item input:checked + span {
  color: #5CB3C4;
  font-weight: 600;
}

/* Parent Category with Toggle */
.wc-parent-category {
  position: relative;
  padding-right: 35px !important;
}

.wc-toggle-subcategories {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  transition: all 0.2s;
}

.wc-toggle-subcategories:hover {
  background-color: #f3f4f6;
  color: #5CB3C4;
}

.wc-toggle-subcategories svg {
  transition: transform 0.2s;
}

.wc-toggle-subcategories.wc-expanded svg {
  transform: rotate(180deg);
}

/* Subcategory List */
.wc-subcategory-list {
  display: none;
  padding-left: 24px;
  margin-top: 4px;
  margin-bottom: 8px;
  border-left: 2px solid #e5e7eb;
  margin-left: 18px;
}

.wc-subcategory-list.wc-expanded {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wc-subcategory-item {
  font-size: 13px;
  padding: 6px 10px !important;
}

.wc-subcategory-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.wc-subcategory-item span {
  color: #6b7280;
}

.wc-subcategory-item:hover span {
  color: #374151;
}

.wc-subcategory-item input:checked + span {
  color: #5CB3C4;
  font-weight: 600;
}

/* Animation for expanding subcategories */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wc-subcategory-list.wc-expanded {
  animation: slideDown 0.3s ease;
}

/* Active parent category indicator */
.wc-parent-category input:checked ~ .wc-toggle-subcategories {
  color: #5CB3C4;
}

/* Price Filter */
.wc-price-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.wc-price-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.wc-price-input:focus {
  border-color: #5CB3C4;
}

.wc-price-filter span {
  color: #6b7280;
  font-weight: 500;
}

.wc-apply-price-btn,
.wc-reset-filters {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-apply-price-btn {
  background-color: #5CB3C4;
  color: white;
}

.wc-apply-price-btn:hover {
  background-color: #4a9aa9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(92, 179, 196, 0.3);
}

.wc-reset-filters {
  background-color: transparent;
  color: #6b7280;
  border: 2px solid #d1d5db;
}

.wc-reset-filters:hover {
  border-color: #9ca3af;
  color: #374151;
  transform: translateY(-2px);
}

/* Mobile Filter Toggle */
.wc-filter-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #5CB3C4;
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(92, 179, 196, 0.4);
  z-index: 999;
  gap: 8px;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-filter-toggle:hover {
  background-color: #4a9aa9;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(92, 179, 196, 0.5);
}

/* ===== Main Content Area ===== */
.wc-products-main {
  min-height: 500px;
}

.wc-archive-header {
  margin-bottom: 20px; /* Reduced margin */
  text-align: center;
}

.wc-archive-title {
  font-size: 36px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 12px 0;
}

.wc-archive-header .term-description {
  font-size: 16px;
  color: #6b7280;
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
}

/* Toolbar */
.wc-products-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px; /* Reduced margin */
  padding: 12px 16px; /* Reduced padding */
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
  gap: 16px;
}

/* Hide the VIEW filter */
.woocommerce .woocommerce-result-count-filter,
.woocommerce-result-count-filter,
.products-per-page,
.gridlist-toggle,
.woocommerce-viewing {
  display: none !important;
}

.wc-result-count {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.wc-ordering select {
  padding: 8px 32px 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  background-color: white;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 16px;
  cursor: pointer;
  outline: none;
  appearance: none;
  transition: border-color 0.2s;
}

.wc-ordering select:hover {
  border-color: #5CB3C4;
}

/* Products Grid */
.wc-products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Changed to 4 columns */
  gap: 2px; /* Minimal gap */
  margin-bottom: 40px;
}

/* Override WooCommerce default product list styles - LAYOUT ONLY */
.woocommerce ul.products,
.woocommerce-page ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important; /* Changed to 4 columns */
  gap: 2px !important; /* Minimal gap */
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  clear: both;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important; /* Remove borders */
  box-shadow: none !important; /* Remove shadows if any */
}

/* Remove default WooCommerce product borders and styling */
.woocommerce ul.products li.product img,
.woocommerce-page ul.products li.product img {
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .price,
.woocommerce ul.products li.product .button {
  border: none !important;
}

/* No Products Found */
.wc-no-products {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.wc-no-products .woocommerce-info {
  font-size: 18px;
  color: #6b7280;
  margin: 0;
}

/* Pagination */
.woocommerce-pagination {
  margin-top: 40px;
  text-align: center;
}

.woocommerce-pagination ul {
  display: inline-flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.woocommerce-pagination ul li {
  display: inline-block;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  background: white;
  border: 1px solid #d1d5db;
  text-decoration: none;
  transition: all 0.2s;
}

.woocommerce-pagination ul li a:hover {
  background-color: #5CB3C4;
  color: white;
  border-color: #5CB3C4;
}

.woocommerce-pagination ul li span.current {
  background-color: #5CB3C4;
  color: white;
  border-color: #5CB3C4;
}

/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
  .wc-archive-container {
    max-width: 90%; /* Adjust for medium screens */
    grid-template-columns: 240px 1fr;
    gap: 18px; /* Reduced gap */
  }

  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2px !important; /* Minimal gap */
  }

  .wc-archive-title {
    font-size: 30px;
  }
}

@media (max-width: 1024px) {
  .wc-archive-container {
    max-width: 95%; /* Adjust for smaller screens */
    grid-template-columns: 220px 1fr;
    gap: 15px; /* Reduced gap */
  }

  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2px !important; /* Minimal gap */
  }
}

@media (max-width: 768px) {
  .wc-custom-archive-wrapper {
    padding: 20px 12px;
  }

  .wc-archive-container {
    max-width: 100%; /* Full width on mobile */
    grid-template-columns: 1fr;
    gap: 0;
  }

  .wc-filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    overflow-y: auto;
    border-radius: 0;
  }

  .wc-filter-sidebar.wc-active {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }

  .wc-filter-close {
    display: flex;
  }

  .wc-filter-toggle {
    display: flex;
  }

  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2px !important; /* Minimal gap for mobile */
  }

  .wc-products-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .wc-archive-title {
    font-size: 26px;
  }
}

@media (max-width: 576px) {
  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2px !important; /* Minimal gap for small mobile */
  }

  .wc-archive-title {
    font-size: 22px;
  }
}

/* Overlay for mobile menu */
.wc-filter-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.wc-filter-overlay.wc-active {
  display: block;
  opacity: 1;
}

.woocommerce .oceanwp-toolbar{ 
  display:none !important; 
}