/**
 * cycle-filters.css
 * Specific styles for the cycle listing page with sidebar filters
 * Add this file after templatemo-onix-digital.css
 */

/* ===== LAYOUT STRUCTURE ===== */
.featured-page {
  display: flex;
  gap: 0;
  /* Center the layout */
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 108px !important;
}

/* Sidebar Filter Column */
.filters-sidebar {
  width: 280px;
  min-width: 280px;
  background: #ffffff;
  padding: 20px 20px;
  border-right: 1px solid #e7eef1;
  position: sticky;
  top: 110px !important;
  height: calc(100vh - 110px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Hide scrollbar for Chrome/Safari/Opera */
.filters-sidebar::-webkit-scrollbar {
  display: none;
}

/* Main Content Area (Cycles Grid) */
.cycles-main-content {
  flex: 1;
  padding-left: 20px;
  background: #ffffff;
}

/* .sticky-top {
  position: sticky;
  top: 110px !important;
  z-index: 1000;
  background-color: #ffffff; 
  padding-top: 10px; 
  padding-bottom: 10px;
} */

/* Remove overflow:hidden from container as it breaks sticky or causes layout issues */
.featured.container {
  height: calc(100vh - 220px);
  overflow-y: auto;
  padding-bottom: 20px;
}

.featured.container::-webkit-scrollbar {
  width: 8px;
  display: none;
}

.featured.container::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
  display: none;
}

.featured.container::-webkit-scrollbar-thumb {
  background: #ffffff00;
  border-radius: 4px;
  display: none;
}

/* Top Bar with Title and Filter Chips */
.cycles-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center; /* Align vertically center */
  margin-bottom: 20px;
  margin-top: 30px !important;
  padding: 0 15px;
  flex-wrap: nowrap; /* Prevent title and filters from wrapping rigidly */
  gap: 20px;
}

.cycles-header-bar .section-heading {
  padding-left: 0 !important;
  margin-bottom: 0;
  margin-top: 0px !important;
}

.cycles-header-bar .section-heading h1 {
  font-size: 30px !important;
  line-height: 26px;
  font-weight: 500;
  color: #000000;
  margin-top: 0px !important;
  font-family: "DM Sans", sans-serif;
}

/* Filter Chips Container */
.filter-chips-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 9px 16px;
  border-radius: 100px;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  line-height: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.filter-chip.active {
  background: #00a5f1;
  color: #ffffff;
}

.filter-chip:not(.active) {
  background: #e6f8ff;
  color: #303030;
}

.filter-chip:hover:not(.active) {
  background: #d0e8f7;
}

/* Sort Button */
.sort-button {
  padding: 8px 20px;
  border: 1px solid #00a5f1;
  background: #ffffff;
  border-radius: 100px;
  color: #00a5f1;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-button:hover {
  background: #f0f9ff;
}

/* Active Filter Badges Row */
.active-filters-row {
  padding: 0 15px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.clear-all-btn {
  padding: 7px 10px;
  background: #303030;
  color: #ffffff;
  border-radius: 100px;
  font-size: 11px;
  line-height: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: "DM Sans", sans-serif;
}

.clear-all-btn:hover {
  background: #1a1a1a;
}

.filter-badge {
  padding: 7px 12px;
  background: #eaeef0;
  border-radius: 100px;
  font-size: 11px;
  line-height: 14px;
  color: #303030;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "DM Sans", sans-serif;
}

.filter-badge .remove-icon {
  cursor: pointer;
  font-size: 16px;
  color: #303030;
}

/* Cycles Grid - 2 Column */
.featured.container.no-gutter .row.posts {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 30px;
  padding: 0 15px;
  /* Override bootstrap row standard behavior if needed */
  margin-right: 0;
  margin-left: 0;
}

.row.posts .product-card {
  /* Override Bootstrap col-md-4 */
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  padding: 0;
}

/* ===== SIDEBAR FILTERS ===== */

/* Price Filter */
.filter-section {
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid #e7eef1;
}

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

.filter-section-title {
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  line-height: 20px;
  font-weight: 800;
  color: #303030;
  margin-bottom: 5px;
}

.price-label {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
  color: #303030;
  margin-bottom: 8px;
}

/* Price Range Slider */
.price-range-wrapper {
  position: relative;
}

.price-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 100px;
  background: linear-gradient(
    to right,
    #00a5f1 0%,
    #00a5f1 25%,
    #dbe5e9 25%,
    #dbe5e9 100%
  );
  outline: none;
  margin: 10px 0;
}

.price-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #00a5f1;
  cursor: pointer;
}

.price-range-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #00a5f1;
  cursor: pointer;
  border: none;
}

.price-range-labels {
  display: flex;
  justify-content: space-between;
  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1px;
  font-weight: 700;
  color: #303030;
}

/* Filter Items (Checkboxes/Radios) */
.filter-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-item input[type="radio"],
.filter-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: #ffffff;
  position: relative;
}

.filter-item input[type="radio"]:checked,
.filter-item input[type="checkbox"]:checked {
  background: #00a5f1;
  border-color: #00a5f1;
}

.filter-item input[type="radio"]:checked::after,
.filter-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
}

.filter-item label {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
  color: #303030;
  cursor: pointer;
  margin: 0;
}

/* Show More/Less Links */
.show-more-link {
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: #00a5f1;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 8px;
  display: inline-block;
}

.extra-filters {
  animation: fadeIn 0.3s ease-out;
}

/* Scrollable filter list when "Show more" is expanded */
.filter-items-list.is-expanded {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #c8dfe9 #f0f4f6;
}

.filter-items-list.is-expanded::-webkit-scrollbar {
  width: 4px;
}

.filter-items-list.is-expanded::-webkit-scrollbar-track {
  background: #f0f4f6;
  border-radius: 4px;
}

.filter-items-list.is-expanded::-webkit-scrollbar-thumb {
  background: #c8dfe9;
  border-radius: 4px;
}

.filter-items-list.is-expanded::-webkit-scrollbar-thumb:hover {
  background: #00a5f1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.show-more-link:hover {
  color: #0088cc;
}

/* Scrollbar Styling for Sidebar - Hidden now */
/* Kept clean to avoid conflicts with above rules */

/* ===== SEARCH BOX ===== */
#cycle-name-search {
  display: inline-block;
  margin-left: 10px;
}

#cycle-search-input {
  padding: 8px 12px;
  border-radius: 30px;
  border: 1px solid #dfdfdf;
  min-width: 220px;
  font-size: 13px;
  font-family: "DM Sans", sans-serif;
  outline: none;
}

#cycle-search-input:focus {
  border-color: #00a5f1;
}

#search-count {
  margin-left: 8px;
  color: #6b7280;
  font-size: 14px;
  font-family: "DM Sans", sans-serif;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .featured-page {
    flex-direction: column;
    margin-top: 50px !important;
  }

  .filters-sidebar {
    width: 100%;
    position: relative;
    top: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e7eef1;
    padding-bottom: 20px;
    margin-bottom: 20px;
  }

  .cycles-header-bar {
    flex-direction: column;
    gap: 0px !important;
  }

  .featured.container.no-gutter .row.posts {
    grid-template-columns: 1fr;
  }

  .cycles-header-bar {
    margin-top: 25px !important;
  }
}

@media (max-width: 768px) {
  .cycles-header-bar .section-heading h1 {
    font-size: 18px !important;
  }
  .featured.container.no-gutter .row.posts {
    grid-template-columns: 1fr !important;
  }
  .filter-chips-wrapper {
    width: 100%;
  }

  /* sort-button hidden in 991px block */

  .cycles-header-bar {
    align-items: flex-start;
  }

  /* filter-chips-wrapper scroll handled in 991px block */

  .filter-chip {
    white-space: nowrap !important;
  }

  .filter-items-list {
    margin: 12px 0px;
  }
  .cycles-main-content {
    padding: 0px !important;
  }
}

.badge-danger {
  background-color: #c71515;
  padding-left: 10px;
  padding-right: 10px;
  padding-top: 5px;
  margin-bottom: 5px;
  padding-bottom: 5px;
  border-radius: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.available-badge {
  overflow: hidden;
  background-color: #ffe6e6;
  padding-left: 6px;
  padding-right: 6px;
  padding-top: 3px;
  padding-bottom: 3px;
  border-radius: 20px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #4d4d4d;
}

/* Wishlist Overlay */
.wishlist-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 20;
  cursor: pointer;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* .wishlist-btn:hover {
  transform: scale(1.1);
} */

.wishlist-btn img {
  width: 20px;
  height: auto;
  pointer-events: none; /* Let click pass through to btn */
  border-radius: 0px !important;
}

.tag {
  background: linear-gradient(
    88.74deg,
    #f9ffa1 0.67%,
    #fefff7 98.92%
  ) !important;
}

/* Darker skeletons for white background */
.featured-item .skeleton-loading {
  background: #ebeef1;
  background-image: linear-gradient(
    to right,
    #ebeef1 0%,
    #dfe3e7 20%,
    #ebeef1 40%,
    #ebeef1 100%
  );
}

@keyframes shimmer {
  to {
    background-position-x: -200%;
  }
}
