/* === Main Layout with Full Height Sidebar === */
.main-layout-wrapper {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

/* === Sidebar Styling - Sticky Positioning === */
.category-sidebar {
  flex: 0 0 25%;
  max-width: 25%;
  position: sticky;
  top: 1rem;
  align-self: flex-start;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  margin-bottom: 2rem;
}

.sidebar-content {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f8f9fa;
  overflow: hidden;
  margin-bottom: 1rem;
}

.sidebar-content .widget {
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
  margin: 0;
}

.sidebar-content .widget:last-child {
  border-bottom: none;
}

.sidebar-content .widget-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.sidebar-content .widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-content .widget li {
  margin-bottom: 0.5rem;
}

.sidebar-content .widget li a {
  color: #555;
  text-decoration: none;
  padding: 0.5rem 0;
  display: block;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.sidebar-content .widget li a:hover {
  color: #007cba;
  border-bottom-color: #007cba;
  padding-left: 0.5rem;
}

.sidebar-content .widget li.current-menu-item > a,
.sidebar-content .widget li.current-cat > a {
  color: #007cba;
  font-weight: 600;
  background: rgba(0, 124, 186, 0.1);
  padding-left: 0.5rem;
  border-radius: 4px;
}

/* Sidebar placeholder styling */
.sidebar-placeholder {
  padding: 1.5rem;
  text-align: center;
  color: #666;
}

.sidebar-placeholder h4 {
  margin-bottom: 1rem;
  color: #333;
}

/* === Main Content Area === */
.main-content-area {
  flex: 1 1 75%;
  max-width: 75%;
}

/* === Section 1: Category Header Layout === */
.category-header {
  display: flex;
  flex-wrap: nowrap;
  gap: 5rem;
  align-items: flex-start;
  margin-bottom: 3rem;
}

.category-header__image {
  flex: 1 1 50%;
  max-width: 50%;
}

.category-header__image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.category-header__content {
  flex: 1 1 50%;
  max-width: 50%;
}

.category-header__content .woocommerce-breadcrumb {
  margin-bottom: 1rem;
}

.category-header__content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.category-header__content .text-muted {
  font-size: 1rem;
  line-height: 1.6;
  color: #555;
}

/* === Section 2: Product Grid === */
.product-grid-container {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.product-grid-wrapper {
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  font-size: 1rem;
}

.product-grid-row {
  display: grid;
  grid-template-columns: 3fr 1.75fr 1fr 1fr 0.6fr;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid #eee;
  align-items: center;
}

.product-grid-header {
  background: #f8f9fa;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.product-grid-item {
  transition: background-color 0.2s ease;
}

.product-grid-item:hover {
  background: #f9f9f9;
}

.product-grid-item .quantity {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  max-width: 120px;
  margin: 0 auto;
}

.product-grid-item .quantity .btn {
  background-color: #f1f1f1;
  border: none;
}

.product-grid-item .quantity input {
  width: 50px;
  text-align: center;
  border: none;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  outline: none;
}

.product-grid-item .quantity .plus,
.product-grid-item .quantity .minus {
  background: #eee;
  padding: 6px 10px;
  cursor: pointer;
  user-select: none;
  font-weight: bold;
  border: none;
}

.product-short-description {
  margin-top: 20px;
  font-size: 14px;
  font-weight: 400;
  color: #666;
}
.product-short-description p:last-child { margin-bottom: 0; }

.woocommerce.archive .site-content { padding-bottom: 0 !important; }

/* === Responsive === */
@media (max-width: 991.98px) {
  .category-header {
    gap: 1.5rem;
  }

  .category-header__content h1 {
    font-size: 1.75rem;
  }
  
  /* Adjust sidebar and content for tablets */
  .main-layout-wrapper {
    gap: 1.5rem;
  }
  
  .category-sidebar {
    flex: 0 0 30%;
    max-width: 30%;
  }
  
  .main-content-area {
    flex: 1 1 70%;
    max-width: 70%;
  }
}

@media (max-width: 767.98px) {
  /* Section 1 responsive */
  .category-header {
    flex-direction: column;
  }

  .category-header__image,
  .category-header__content {
    flex: 1 1 100%;
    max-width: 100%;
  }

  /* Hide sidebar completely on mobile and stack content */
  .main-layout-wrapper {
    flex-direction: column;
    gap: 0;
  }
  
  .category-sidebar {
    display: none;
  }
  
  .main-content-area {
    flex: 1 1 100%;
    max-width: 100%;
  }

  /* Adjust product grid spacing for mobile */
  .product-grid-container {
    margin-top: 2rem;
  }

  /* Section 2 responsive */
  .product-grid-row {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid #eee;
  }

  .product-grid-header {
    display: none;
  }

  .product-grid-item > div {
    padding-bottom: 0.5rem;
  }

  .product-grid-item > div:last-child {
    padding-bottom: 0;
  }
}

/* === Additional Styles for Enhanced Product Grid === */

/* Tier Price Styling */
.tier-price {
  font-size: 0.9rem;
  line-height: 1.4;
	text-align: center;
}

.tier-price .tier-label {
  font-size: 0.8rem;
  color: #666;
  font-weight: normal;
  display: inline;
  text-transform: capitalize;
}

.tier-price.active-tier {
  background-color: #e8f5e8;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #28a745;
  font-weight: 600;
}

.tier-1-price.active-tier,
.tier-2-price.active-tier {
  color: #155724;
}

/* Enhanced Quantity Controls */
.quantity-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-grid-item .quantity {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  width: fit-content;
  max-width: 140px;
  margin: 0 auto;
  background: #fff;
}

.product-grid-item .quantity button {
  background: #f8f9fa;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  min-width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #495057;
  transition: background-color 0.2s ease;
}

.product-grid-item .quantity button:hover {
  background: #e9ecef;
  color: #212529;
}

.product-grid-item .quantity button:active {
  background: #dee2e6;
}

.product-grid-item .quantity input.qty {
  border: none;
  text-align: center;
  width: 60px;
  height: 35px;
  outline: none;
  font-size: 0.9rem;
  background: #fff;
  color: #495057;
}

.product-grid-item .quantity input.qty:focus {
  background: #f8f9fa;
}

/* Add to Cart Form Styling */
.add-to-cart-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.add-to-cart-wrapper form.cart {
  margin: 0;
  width: 100%;
}

.single_add_to_cart_button {
  padding: 0;
  font-size: 1rem;
  white-space: nowrap;
  border: none;
  border-radius: 4px;
  background-color: #007cba;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease;
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
  text-indent: -9999px;
  overflow: hidden;
}

.single_add_to_cart_button:before {
  content: "+";
  font-size: 1.4rem;
  font-weight: bold;
  line-height: 1;
  text-indent: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff !important;
}

.single_add_to_cart_button:hover {
  background-color: #005a87;
}

.single_add_to_cart_button:active {
  background-color: #004666;
}

/* Product Name Styling */
.product-name {
  font-weight: 500;
  color: #333;
  line-height: 1.3;
  position: relative;
}

/* Most Popular Badge Styling */
.most-popular-badge {
  display: block;
  width: fit-content;
  background-color: #ee2262;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(238, 34, 98, 0.2);
  line-height: 1;
}

/* Grid Item Data Attributes for Mobile */
.product-grid-item[data-product-id] {
  position: relative;
}

/* Enhanced Mobile Responsive Styles */
@media (max-width: 767.98px) {
  /* Mobile tier price styling */
  .tier-price {
    margin-bottom: 0.25rem;
  }
  
  .tier-price .tier-label {
    display: inline;
    margin-left: 0.25rem;
  }
  
  /* Mobile quantity controls */
  .quantity-wrapper {
    justify-content: flex-start;
    margin-bottom: 0.5rem;
  }
  
  .product-grid-item .quantity {
    margin: 0;
    max-width: 120px;
  }
  
  /* Mobile add to cart */
  .add-to-cart-wrapper {
    justify-content: flex-start;
    margin-top: 0.5rem;
  }
  
  .single_add_to_cart_button {
    width: 35px;
    height: 35px;
    min-width: 35px;
    font-size: 0.9rem;
    padding: 0;
  }
  
  .single_add_to_cart_button:before {
    font-size: 1.2rem;
  }
  
  /* Mobile labels for data - Dynamic product label */
/*   .product-grid-item > div:before {
    content: attr(data-label);
    font-weight: bold;
    display: inline-block;
    width: 100px;
    margin-right: 0.5rem;
    color: #555;
    font-size: 0.85rem;
  } */
  
/*   .product-name:before { 
    content: var(--product-column-label, "Product") ": "; 
  } */
  
  /* Mobile styling for Most Popular badge */
  .most-popular-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    margin-top: 0.4rem;
    border-radius: 10px;
  }
  
  .tier-1-price:before { 
    content: "Standard Rate: "; 
  }
  
  .tier-2-price:before { 
    content: "Bulk Rate: "; 
  }
  
/*   .quantity-wrapper:before { 
    content: "Quantity: "; 
  } */
  
  .add-to-cart-wrapper:before { 
    content: ""; 
  }
  
  /* Remove mobile labels for active tiers to prevent duplication */
  .tier-price.active-tier:before {
    /* content: "Item: "; */
    color: #155724;
  }
}

/* Loading and Interaction States */
.product-grid-item.updating {
  opacity: 0.7;
  pointer-events: none;
}

.product-grid-item.updating::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 1;
}

/* Accessibility Improvements */
.quantity button:focus,
.single_add_to_cart_button:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

.tier-price.active-tier {
  animation: highlight 0.3s ease-in-out;
}

@keyframes highlight {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Error States */
.quantity input.qty.error {
  border-color: #dc3545;
  background-color: #f8d7da;
}

.single_add_to_cart_button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Success Feedback */
.add-to-cart-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Additional utility classes */
.text-success { color: #28a745 !important; }
.text-danger { color: #dc3545 !important; }
.text-warning { color: #ffc107 !important; }
.text-info { color: #17a2b8 !important; }

/* === Quantity Unit Label Styling === */
.quantity-unit-label {
  font-size: 0.75rem;
  color: #666;
  text-align: center;
  margin-top: 0.25rem;
  font-style: italic;
  line-height: 1.2;
}

/* Enhanced quantity wrapper to accommodate label */
.quantity-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
}

/* Mobile responsive for quantity unit label */
@media (max-width: 767.98px) {
  .quantity-wrapper {
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 0.5rem;
  }
  
  .quantity-unit-label {
    text-align: left;
    margin-top: 0.25rem;
    margin-left: 0;
  }
  
/*   .quantity-wrapper:before { 
    content: "Quantity: "; 
    margin-bottom: 0.25rem;
  } */
}

/* Fix for quantity buttons - ensure both buttons have same styling */
.product-grid-item .quantity button.plus,
.product-grid-item .quantity button.minus {
  background: #f8f9fa !important;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  min-width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #495057 !important;
  transition: background-color 0.2s ease;
}

.product-grid-item .quantity button.plus:hover,
.product-grid-item .quantity button.minus:hover {
  background: #333 !important;
  color: #fff !important;
}

.product-grid-item .quantity button.plus:active,
.product-grid-item .quantity button.minus:active {
  background: #000;
  color: #fff;
}

/* === Enhanced Sidebar Menu Styling === */

/* Style for navigation menus in sidebar */
.sidebar-content .widget_nav_menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-content .widget_nav_menu li {
  border-bottom: 1px solid #eee;
  margin-bottom: 0;
  position: relative;
}

.sidebar-content .widget_nav_menu li:last-child {
  border-bottom: none;
}

/* Parent menu items */
.sidebar-content .widget_nav_menu li a {
  display: block;
  padding: 0.75rem 0;
  color: #333;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: none !important;
  border-bottom: none !important;
}

.sidebar-content .widget_nav_menu li a:hover {
  color: #007cba !important;
  background: none !important;
  border-bottom: none !important;
  padding-left: 0 !important;
}

/* Child menu items */
.sidebar-content .widget_nav_menu .sub-menu {
  padding-left: 0;
  margin-top: 0.5rem;
  border-top: 1px solid #f0f0f0;
  padding-top: 0.5rem;
}

.sidebar-content .widget_nav_menu .sub-menu li {
  border-bottom: none;
  margin-bottom: 0.25rem;
}

.sidebar-content .widget_nav_menu .sub-menu li:last-child {
  margin-bottom: 0;
}

.sidebar-content .widget_nav_menu .sub-menu li a {
  padding: 0.5rem 0 0.5rem 1.5rem;
  color: #666;
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  position: relative;
  background: none !important;
  border-bottom: none !important;
}

.sidebar-content .widget_nav_menu .sub-menu li a:before {
  content: "▸";
  position: absolute;
  left: 0.5rem;
  color: #999;
  font-size: 0.7rem;
  transition: color 0.2s ease;
}

.sidebar-content .widget_nav_menu .sub-menu li a:hover {
  color: #007cba !important;
  background: none !important;
  border-bottom: none !important;
  padding-left: 1.5rem !important;
}

.sidebar-content .widget_nav_menu .sub-menu li a:hover:before {
  color: #007cba;
}

/* Active/Current menu items - NO BACKGROUND, NO PADDING CHANGES */
.sidebar-content .widget_nav_menu li.current-menu-item > a,
.sidebar-content .widget_nav_menu li.current-menu-ancestor > a {
  color: #007cba !important;
  background: none !important;
  border-bottom: none !important;
  padding-left: 0 !important;
}

.sidebar-content .widget_nav_menu .sub-menu li.current-menu-item > a {
  color: #007cba !important;
  font-weight: 600;
  background: none !important;
  border-bottom: none !important;
  padding-left: 1.5rem !important;
}

/* Style for category widgets */
.sidebar-content .widget_categories ul,
.sidebar-content .widget_product_categories ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-content .widget_categories li,
.sidebar-content .widget_product_categories li {
  border-bottom: 1px solid #eee;
  margin-bottom: 0;
  position: relative;
}

.sidebar-content .widget_categories li:last-child,
.sidebar-content .widget_product_categories li:last-child {
  border-bottom: none;
}

/* Parent category items */
.sidebar-content .widget_categories li a,
.sidebar-content .widget_product_categories li a {
  display: block;
  padding: 0.75rem 0;
  color: #333;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s ease;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: none !important;
  border-bottom: none !important;
}

.sidebar-content .widget_categories li a:hover,
.sidebar-content .widget_product_categories li a:hover {
  color: #007cba !important;
  background: none !important;
  border-bottom: none !important;
  padding-left: 0 !important;
}

/* Child category items */
.sidebar-content .widget_categories .children,
.sidebar-content .widget_product_categories .children {
  padding-left: 0;
  margin-top: 0.5rem;
  border-top: 1px solid #f0f0f0;
  padding-top: 0.5rem;
}

.sidebar-content .widget_categories .children li,
.sidebar-content .widget_product_categories .children li {
  border-bottom: none;
  margin-bottom: 0.25rem;
}

.sidebar-content .widget_categories .children li:last-child,
.sidebar-content .widget_product_categories .children li:last-child {
  margin-bottom: 0;
}

.sidebar-content .widget_categories .children li a,
.sidebar-content .widget_product_categories .children li a {
  padding: 0.5rem 0 0.5rem 1.5rem;
  color: #666;
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  position: relative;
  background: none !important;
  border-bottom: none !important;
}

.sidebar-content .widget_categories .children li a:before,
.sidebar-content .widget_product_categories .children li a:before {
  content: "▸";
  position: absolute;
  left: 0.5rem;
  color: #999;
  font-size: 0.7rem;
  transition: color 0.2s ease;
}

.sidebar-content .widget_categories .children li a:hover,
.sidebar-content .widget_product_categories .children li a:hover {
  color: #007cba !important;
  background: none !important;
  border-bottom: none !important;
  padding-left: 1.5rem !important;
}

.sidebar-content .widget_categories .children li a:hover:before,
.sidebar-content .widget_product_categories .children li a:hover:before {
  color: #007cba;
}

/* Active/Current category items - NO BACKGROUND, NO PADDING CHANGES */
.sidebar-content .widget_categories li.current-cat > a,
.sidebar-content .widget_categories li.current-cat-parent > a,
.sidebar-content .widget_product_categories li.current-cat > a,
.sidebar-content .widget_product_categories li.current-cat-parent > a {
  color: #007cba !important;
  background: none !important;
  border-bottom: none !important;
  padding-left: 0 !important;
}

.sidebar-content .widget_categories .children li.current-cat > a,
.sidebar-content .widget_product_categories .children li.current-cat > a {
  color: #007cba !important;
  font-weight: 600;
  background: none !important;
  border-bottom: none !important;
  padding-left: 1.5rem !important;
}

/* Override any default widget styles */
.sidebar-content .widget li a,
.sidebar-content .widget li.current-menu-item > a,
.sidebar-content .widget li.current-cat > a {
  background: none !important;
  background-color: transparent !important;
  border-bottom: none !important;
}

.sidebar-content .widget li a:hover,
.sidebar-content .widget li a:focus,
.sidebar-content .widget li a:active {
  background: none !important;
  background-color: transparent !important;
  border-bottom: none !important;
  padding-left: 0 !important;
}

/* Remove any general widget link styles that add padding */
.sidebar-content .widget li a {
  border-bottom: none !important;
}

.sidebar-content .widget li a:hover {
  border-bottom-color: transparent !important;
  padding-left: 0 !important;
}

/* Count styling for categories */
.sidebar-content .widget_categories .count,
.sidebar-content .widget_product_categories .count {
  background: #e9ecef;
  color: #495057;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  float: right;
  margin-top: 0.1rem;
}

/* Style for search widget in sidebar */
.sidebar-content .widget_search {
  padding: 1.5rem;
}

.sidebar-content .widget_search .search-form {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.sidebar-content .widget_search .search-field {
  flex: 1;
  border: none;
  padding: 0.5rem;
  outline: none;
  font-size: 0.9rem;
}

.sidebar-content .widget_search .search-submit {
  background: #007cba;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.sidebar-content .widget_search .search-submit:hover {
  background: #005a87;
}

/* Custom widget styling */
.sidebar-content .widget_text {
  padding: 1.5rem;
}

.sidebar-content .widget_text p {
  margin-bottom: 1rem;
  line-height: 1.5;
  color: #555;
}

.sidebar-content .widget_text p:last-child {
  margin-bottom: 0;
}

/* Sticky sidebar positioning - Enhanced */
@media (min-width: 768px) {
  .category-sidebar {
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    margin-bottom: 2rem;
  }
  
  /* Custom scrollbar for sidebar when content overflows */
  .category-sidebar::-webkit-scrollbar {
    width: 6px;
  }
  
  .category-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }
  
  .category-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
  }
  
  .category-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
  }
  
  /* Smooth scrolling for sidebar */
  .category-sidebar {
    scroll-behavior: smooth;
  }
  
  /* Additional spacing for sidebar content */
  .sidebar-content {
    margin-bottom: 1rem;
  }
}