/**
 * Advanced Product Catalog Styles
 */

/* General Styles */
.float-left {
  float: left;
}

.w-100 {
  width: 100%;
}

.w-50 {
  width: 50%;
}

.mt-5 {
  margin-top: 3rem;
}

.mt-3 {
  margin-top: 1rem;
}

.mt-0 {
  margin-top: 0;
}

.mt-md-4 {
  margin-top: 1.5rem;
}

.mb-3 {
  margin-bottom: 1rem;
}

.mb-md-0 {
  margin-bottom: 0;
}

.d-flex {
  display: flex;
}

.d-none {
  display: none;
}

.align-items-center {
  align-items: center;
}

.text-md-right {
  text-align: right;
}

/* Grid Layout */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col-lg-3,
.col-md-4,
.col-sm-6,
.col-md-8,
.col-lg-9 {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

@media (min-width: 576px) {
  .col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (min-width: 768px) {
  .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  .col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
  }
  .text-md-right {
    text-align: right;
  }
  .mt-md-4 {
    margin-top: 1.5rem;
  }
  .mb-md-0 {
    margin-bottom: 0;
  }
}

@media (min-width: 992px) {
  .col-lg-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
  .col-lg-9 {
    flex: 0 0 75%;
    max-width: 75%;
  }
}

/* Product Item Styles */
.product-someone .item {
  position: relative;
  border: 1px solid #eaeaea;
  margin-bottom: 25px;
  transition: all 0.3s ease;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.product-someone .item:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

/* Update colors to be more elegant with softer black tones */
.product-someone .item i {
  background: #000000 !important;
}

.product-someone .item i.top,
.product-someone .item i.bottom {
  height: 1px;
  width: 0;
}

.product-someone .item i.left,
.product-someone .item i.right {
  width: 1px;
  height: 0;
}

.product-someone .item i.top {
  top: 0;
  left: 0;
}

.product-someone .item i.right {
  top: 0;
  right: 0;
}

.product-someone .item i.bottom {
  bottom: 0;
  right: 0;
}

.product-someone .item i.left {
  bottom: 0;
  left: 0;
}

.product-someone .item:hover i.top,
.product-someone .item:hover i.bottom {
  width: 100%;
}

.product-someone .item:hover i.left,
.product-someone .item:hover i.right {
  height: 100%;
}

.product-someone .item a {
  text-decoration: none;
  color: inherit;
  display: block;
  flex: 1;
}

.product-someone .item .images {
  width: 100%;
  height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  padding: 10px;
}

.product-someone .item .images img {
  max-width: 100%;
  max-height: 100%;
  transition: all 0.3s ease;
  object-fit: contain;
}

.product-someone .item:hover .images img {
  transform: scale(1.05);
}

.product-someone .item .text {
  padding: 12px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
}

/* Add these styles for the vertical feature list */
.product-someone .item .text .features {
  margin-top: 8px;
}

.product-someone .item .text .feature-item {
  font-size: 12px;
  color: #888;
  line-height: 1.4;
  margin-bottom: 4px;
  display: block;
}

/* Update the product name styling */
.product-someone .item .text .name {
  display: block;
  margin-bottom: 8px;
  width: 100%;
}

.product-someone .item .text .name strong {
  color: #222222;
  font-size: 14px;
  font-weight: 500;
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ensure the product details text starts from the left */
.product-someone .item .text span {
  font-size: 12px;
  color: #888;
  display: block;
  line-height: 1.4;
  margin-top: 5px;
  text-align: left; /* Ensure text starts from left */
}

.product-someone .item .bt {
  text-align: center;
  padding: 8px 0;
  border-top: 1px solid #f0f0f0;
  background: #fff;
  margin-top: auto;
}

.product-someone .item .bt .more {
  background: #000000 !important;
  color: #333333;
  border-radius: 2px;
  border: 1px solid #dddddd;
  display: inline-block;
  padding: 4px 12px;
  color: white;
  border-radius: 3px;
  text-decoration: none;
  font-size: 12px;
  transition: all 0.3s ease;
  border: 1px solid #eaeaea;
}

.product-someone .item .bt .more:hover {
  background: #eeeeee;
}

/* Product Item Equal Height */
.product-item {
  display: flex;
  margin-bottom: 30px;
}

.product-item .item {
  width: 100%;
}

/* Filter Sidebar Styles */
.filtre_sidebar {
  background: #ffffff;
  padding: 20px;
  border-radius: 5px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.filtre_sidebar .head {
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eeeeee;
  color: #333333;
  font-size: 13px;
}

.filtre_sidebar .item {
  margin-bottom: 20px;
}

.filtre_sidebar .scroll {
  max-height: 500px !important; /* Increased from 180px */
  overflow-y: auto;
  margin-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f5f5f5;
}

.filtre_sidebar .scroll::-webkit-scrollbar {
  width: 4px;
}

.filtre_sidebar .scroll::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.filtre_sidebar .scroll::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}

/* Update the checkbox styling to make it flat and square */
.filtre_sidebar .checkbox {
  margin-bottom: 4px;
  width: 50%; /* Make each checkbox container take 50% width for 2 columns */
  float: left; /* Float left to create columns */
  box-sizing: border-box;
  padding-right: 10px;
}

.filtre_sidebar .checkbox label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 12px;
  color: #555555;
  position: relative;
  padding-left: 24px; /* Space for custom checkbox */
}

/* Hide the default checkbox */
.filtre_sidebar .checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Create a custom square checkbox */
.filtre_sidebar .checkbox label:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  border: 1px solid #ccc;
  background-color: #fff;
  transition: all 0.2s ease;
}

/* Style for checked state */
.filtre_sidebar .checkbox input:checked + span:before {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid #333;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Clear floats after each filter group */
.filtre_sidebar .scroll:after {
  content: "";
  display: table;
  clear: both;
}

/* Make sure the filter title is full width */
.filtre_sidebar .head {
  width: 100%;
  float: none;
  clear: both;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .filtre_sidebar .checkbox {
    width: 100%; /* Full width on very small screens */
  }
}

/* Since we're removing the filter button, we can remove or comment out these styles: */

/* Add some bottom padding to the filter sidebar to replace the space from the removed button */
.filtre_sidebar {
  padding-bottom: 15px;
}

/* Add this CSS to hide the mobile filter button on desktop */
.mobil_filtre {
  display: none; /* Hidden by default on desktop */
}

/* Update the mobile filter styles to create an angled, nicer looking structure */
@media (max-width: 991px) {
  .mobil_filtre {
    display: block; /* Show on mobile */
    background: #000000;
    color: #ffffff;
    padding: 12px 15px;
    text-align: center;
    margin-bottom: 0;
    cursor: pointer;
    border-radius: 2px 2px 0 0;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1001;
  }

  /* Add an angled element to the filter button */
  .mobil_filtre:before {
    content: "";
    position: absolute;
    top: 0;
    right: -15px;
    width: 30px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: skewX(-20deg);
  }

  .filtre_sidebar {
    display: none; /* Hidden by default */
    position: absolute; /* Changed from relative to absolute */
    top: 100%; /* Position right below the filter button */
    left: 0;
    right: 0;
    width: 100%; /* Full width */
    max-width: none;
    height: auto; /* Auto height */
    z-index: 1000; /* Lower z-index since it's not overlaying the whole page */
    overflow-y: auto;
    padding: 15px;
    background: #fff !important; /* Force white background */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 2px 2px; /* Rounded only at bottom */
    margin-bottom: 15px; /* Add margin below */
    border: 1px solid #eee;
    border-top: none; /* No border at top to connect with button */
  }

  /* Style the close button */
  .filtre_sidebar .closes {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 1001;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
  }

  .filtre_sidebar .closes:before,
  .filtre_sidebar .closes:after {
    content: "";
    position: absolute;
    width: 14px;
    height: 2px;
    background: #333; /* Changed from white to dark */
  }

  .filtre_sidebar .closes:before {
    transform: rotate(45deg);
  }

  .filtre_sidebar .closes:after {
    transform: rotate(-45deg);
  }

  /* Add padding to the filter content */
  .filtre_sidebar .scroll {
    padding: 0;
    background: #fff !important; /* Ensure white background for content */
    max-height: 400px !important; /* Limit height for very long filters */
  }

  /* Make sure all filter items have proper colors */
  .filtre_sidebar .item {
    background: #fff !important;
  }

  .filtre_sidebar .head {
    color: #333 !important;
    background: #fff !important;
  }

  .filtre_sidebar .checkbox label {
    color: #555 !important;
  }

  /* Remove overlay when filter is active */
  .filter-overlay {
    display: none !important; /* Hide the overlay completely */
  }
}

/* Slider Styles */
/* Make the slider handles smaller */
.ui-slider {
  position: relative;
  height: 3px;
  background: #eeeeee;
  margin: 12px 0;
  border-radius: 2px;
}

.ui-slider .ui-slider-range {
  position: absolute;
  height: 100%;
  background: #888888;
  border-radius: 2px;
}

.ui-slider .ui-slider-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 1px solid #888888;
  border-radius: 50%;
  top: -5px;
  margin-left: -6px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.ui-slider .ui-slider-handle:focus {
  outline: none;
}

.priceLabels {
  display: flex;
  align-items: center;
  margin-right: 10px;
}

/* Make the volume range inputs smaller */
.priceLabels input {
  width: 50px;
  padding: 3px;
  border: 1px solid #ddd;
  border-radius: 3px;
  text-align: center;
  font-size: 11px;
}

/* Filter List */
.filtre-liste {
  background: #fff;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 3px;
  border: 1px solid #eeeeee;
}

.filtre-liste .listes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filtre-liste .filter-item {
  background: #f8f8f8;
  padding: 3px 8px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  border: 1px solid #eeeeee;
  font-size: 12px;
}

.filtre-liste .filter-item span {
  margin-right: 6px;
}

.filtre-liste .filter-item a {
  color: #888888;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
}

.filtre-liste .not {
  text-align: right;
  margin-top: 8px;
}

.filtre-liste .not a {
  color: #666666;
  text-decoration: none;
  font-size: 12px;
}

.filtre-liste .not a:hover {
  text-decoration: underline;
}

/* Product Count */
.productCount {
  font-weight: bold;
}

/* Not Found Message */
.notFoundProduct {
  padding: 20px;
  background: #f9f9f9;
  border: 1px solid #eeeeee;
  border-radius: 2px;
  border: 1px solid #e5e5e5;
}

/* Description Text */
.not p {
  margin-top: 30px;
  font-size: 14px;
  line-height: 1.6;
  color: #555555;
}

/* Loading State */
#product-grid.loading {
  position: relative;
  min-height: 300px;
}

#product-grid.loading:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 2;
}

#product-grid.loading:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid #f5f5f5;
  border-top: 3px solid #444444;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 3;
}

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

/* Product Grid Styles */
.product-someone .item {
  position: relative;
  border: 1px solid #eee;
  border-radius: 5px;
  margin-bottom: 20px;
  transition: all 0.3s;
  overflow: hidden;
}

.product-someone .item:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-someone .item i {
  position: absolute;
  background: #007bff;
  transition: all 0.3s;
}

.product-someone .item i.top,
.product-someone .item i.bottom {
  height: 1px;
  width: 0;
}

.product-someone .item i.left,
.product-someone .item i.right {
  width: 1px;
  height: 0;
}

.product-someone .item i.top {
  top: 0;
  left: 0;
}

.product-someone .item i.right {
  top: 0;
  right: 0;
}

.product-someone .item i.bottom {
  bottom: 0;
  right: 0;
}

.product-someone .item i.left {
  bottom: 0;
  left: 0;
}

.product-someone .item:hover i.top,
.product-someone .item:hover i.bottom {
  width: 100%;
}

.product-someone .item:hover i.left,
.product-someone .item:hover i.right {
  height: 100%;
}

.product-someone .item .images {
  padding: 10px;
  text-align: center;
}

.product-someone .item .images img {
  max-width: 100%;
  height: auto;
  transition: all 0.3s;
}

.product-someone .item:hover .images img {
  transform: scale(1.05);
}

.product-someone .item .text {
  padding: 10px 15px;
  border-top: 1px solid #eee;
}

/* Improve mobile product grid */
@media (max-width: 576px) {
  .product-someone .item .images {
    height: 150px; /* Smaller height on mobile */
  }

  .product-someone .item .text {
    padding: 10px;
  }
}

.filtre-liste .not a:hover {
  text-decoration: underline;
}

/* Loading State */
.products-container.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Not Found Message */
.notFoundProduct {
  padding: 20px;
  background: #f8d7da;
  color: #721c24;
  border-radius: 5px;
  text-align: center;
  margin-bottom: 20px;
}

/* Volume Slider Styles */
.ui-slider {
  height: 5px;
  background: #ddd;
  margin: 15px 0;
  position: relative;
}

.ui-slider .ui-slider-range {
  background: #007bff;
  height: 100%;
  position: absolute;
}

.ui-slider .ui-slider-handle {
  width: 15px;
  height: 15px;
  background: #fff;
  border: 2px solid #007bff;
  border-radius: 50%;
  position: absolute;
  top: -5px;
  margin-left: -7px;
  cursor: pointer;
}

.priceLabels {
  margin: 0 10px 0 0;
}

.priceLabels input {
  width: 60px;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 3px;
  text-align: center;
}

/* Add these styles to fix the desktop filter */
.desktop-filter {
  display: block !important;
}

@media (max-width: 991px) {
  .desktop-filter {
    display: none !important;
  }
}

/* Update the mobile filter styles to remove overlay references */
@media (max-width: 991px) {
  .mobil_filtre {
    display: block;
    background: #000000;
    color: #ffffff;
    padding: 12px 15px;
    text-align: center;
    margin-bottom: 0; /* Changed from 15px to connect with filter */
    cursor: pointer;
    border-radius: 2px 2px 0 0; /* Rounded only at top */
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1001; /* Ensure it's above the filter */
  }

  /* Add an angled element to the filter button */
  .mobil_filtre:before {
    content: "";
    position: absolute;
    top: 0;
    right: -15px;
    width: 30px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: skewX(-20deg);
  }

  .filtre_sidebar:not(.desktop-filter) {
    display: none; /* Hidden by default */
    position: absolute; /* Changed from relative to absolute */
    top: 100%; /* Position right below the filter button */
    left: 0;
    right: 0;
    width: 100%; /* Full width */
    max-width: none;
    height: auto; /* Auto height */
    z-index: 1000; /* Lower z-index since it's not overlaying the whole page */
    overflow-y: auto;
    padding: 15px;
    background: #fff !important; /* Force white background */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 2px 2px; /* Rounded only at bottom */
    margin-bottom: 15px; /* Add margin below */
    border: 1px solid #eee;
    border-top: none; /* No border at top to connect with button */
  }

  /* Style the close button */
  .filtre_sidebar:not(.desktop-filter) .closes {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 1001;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
  }

  .filtre_sidebar:not(.desktop-filter) .closes:before,
  .filtre_sidebar:not(.desktop-filter) .closes:after {
    content: "";
    position: absolute;
    width: 14px;
    height: 2px;
    background: #333; /* Changed from white to dark */
  }

  .filtre_sidebar:not(.desktop-filter) .closes:before {
    transform: rotate(45deg);
  }

  .filtre_sidebar:not(.desktop-filter) .closes:after {
    transform: rotate(-45deg);
  }
}

/* Volume Slider Styles */
.volume-slider-container {
  padding: 0 15px;
  margin-bottom: 20px;
}

.volume-slider-container .head {
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eeeeee;
  color: #333333;
  font-size: 13px;
}

.volume-range-inputs {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.volume-range-inputs input {
  width: 60px;
  padding: 5px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 3px;
}

.volume-range-inputs span {
  margin: 0 10px;
}

/* Categories section styling */
.categories-section {
  margin-bottom: 20px;
}

.categories-section .head {
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eeeeee;
  color: #333333;
  font-size: 13px;
}

.categories-section .scroll {
  max-height: 200px;
  overflow-y: auto;
}

.categories-section .checkbox {
  margin-bottom: 8px;
  width: 100%;
}

/* Add these styles to ensure proper spacing between filter and content */
@media (min-width: 992px) {
  .col-lg-3 .desktop-filter {
    margin-right: 15px;
  }

  /* Add some right margin to the filter sidebar */
  .filtre_sidebar.desktop-filter {
    margin-right: 15px;
  }
}

/* Ensure mobile filter button is properly positioned */
@media (max-width: 991px) {
  .mobil_filtre {
    margin-bottom: 15px;
  }
}
