/**
 * accessories.css
 * Specific styles for the accessory listing page
 */

/* ===== LAYOUT STRUCTURE ===== */
.featured-page {
  display: flex !important;
  gap: 0;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 62px !important;
  padding: 0 15px; /* Add padding for container */
}

/* Main Content Area */
.accessories-main-content {
  flex: 1;
  width: 100%;
  background: #ffffff;
}

/* Sidebar Filters (Desktop) */
.filters-sidebar {
  width: 280px;
  padding: 30px 20px;
  border-right: 1px solid #e7eef1;
  height: 100vh;
  overflow-y: auto;
  background: #fff;
  position: sticky;
  top: 100px;
}

.desktop-only-sidebar {
  display: block;
}

@media (max-width: 991px) {
  .desktop-only-sidebar {
    display: none !important;
  }
  .featured-page {
    padding: 15px;
  }
}

.filter-section {
  margin-bottom: 30px;
}

.filter-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #303030;
}

.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-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

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

.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-size: 14px;
  color: #303030;
  cursor: pointer;
  margin: 0;
}

/* Active Filters Row */
.active-filters-row {
  padding: 15px 15px 0 15px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.filter-badge {
  background: #e8f6ff;
  color: #00a5f1;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter-badge i {
  cursor: pointer;
}

.clear-all-btn {
  border: none;
  background: none;
  color: #8f999e;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

/* Container Scroll */
.featured.container {
  height: calc(100vh - 220px);
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scroll */
  padding-bottom: 20px;
}

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

/* Header Bar */
.accessories-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding-top: 15px;
}

.section-heading span {
  font-size: 23px !important;
  color: #000000 !important;
}

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

@media (min-width: 992px) {
  .accessories-header-bar .section-heading h1 {
    font-size: 23px !important;
  }
  .accessories-header-bar {
    padding-left: 10px;
  }
}

/* Category Chips */
.filter-chips-wrapper {
  display: flex !important;
  gap: 12px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.filter-chips-wrapper::-webkit-scrollbar {
  display: none;
}

.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 (retained if needed) */
.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;
}

/* Grid System */
.featured.container.no-gutter .row.posts {
  display: grid !important;
  grid-template-columns: repeat(
    4,
    1fr
  ) !important; /* Start with 4 per row for large screens like cycle page usually has or 3? Cycle page has 3 usually. Let's do 3 or 4. User said "12" limit. Let's do 3 to match cycle rental typically or 4 if they fit. Cycle rental css usually col-lg-4 (3 per row). Let's stick to 3. */
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 30px;
  padding: 0; /* Remove padding here, handled by container */
  margin-right: 0;
  margin-left: 0;
}

/* Card Styles - Copied & Modified from User Request */
.featured-item {
  position: relative;
  /* margin-bottom: 25px; handled by grid gap */
  text-decoration: none;
  padding: 10px;
  background: #fff;
  border-radius: 20px; /* Optional: if card needs border, user didn't specify container style, but img has border. */
  /* User's HTML has inner divs. */
  height: 100%;
}

.featured-item img {
  transition: all 0.5s;
}

.featured-item .tag {
  position: absolute;
  top: 6%;
  left: 6%;
  overflow: hidden;
  background: linear-gradient(
    88.74deg,
    #a7ffa1 0.67%,
    #fefff7 98.92%
  ); /* Green gradient as requested */
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.featured-item .tag p {
  color: #2b7a0b; /* Green text - approximating "color is green of the text" */
  font-weight: 600;
  font-size: 11px; /* Slightly smaller for discount % */
  margin: 0;
  padding: 2px 0;
}

.featured-item h4 {
  transition: all 0.5s;
  color: #303030;
  font-weight: 800;
  padding-top: 15px;
  font-size: 18px !important; /* Smaller baseline */
  line-height: 1.3;
  /* Removed white-space: nowrap and ellipsis */
  display: block;
  word-break: keep-all;
  overflow: hidden;
  min-height: 48px; /* Allow 2 lines */
}

/* Original Price Styling */
.featured-item .original-price {
  text-decoration: line-through;
  color: #a4afb5;
  font-size: 0.6em;
  margin-left: 8px;
  font-family: "Courier New", monospace;
}

/* Description styling (mapped from h6 in user snippet) */
.featured-item h6.desc {
  color: #000000;
  font-size: 12px;
  margin-bottom: 5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 25px;
  font-family: "DM Sans", sans-serif;
  padding-top: 5px; /* Adjust spacing */
}

.featured-item .col {
  display: flex !important;
  align-items: center !important; /* Align center vert */
  justify-content: space-between !important;
  width: 100%;
  margin-top: auto; /* Push to bottom */
}

.featured-item .price-text {
  font-size: 21px !important;
  font-weight: 700;
  font-family: "Poppins", sans-serif;
  color: #303030 !important;
}

.featured-item .main-blue-button-stock a {
  display: inline-block;
  background-color: #00a5f1;
  color: #00a5f1;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 20px; /* Reduced padding for compact button */
  border-radius: 25px; /* Rounded pill */
  text-decoration: none;
  transition: all 0.3s;
  white-space: nowrap;
}

.featured-item .main-blue-button-stock a:hover {
  background-color: #0088cc;
  color: #fff;
}

/* Wishlist */
.wishlist-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 20;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
}
.wishlist-btn img {
  width: 18px;
}

/* RESPONSIVE */

@media (max-width: 991px) {
  .accessories-header-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0px !important;
  }

  .featured.container.no-gutter .row.posts {
    grid-template-columns: repeat(
      2,
      1fr
    ) !important; /* 2 Column Grid for tablet/mobile */
    gap: 15px;
  }
}

@media (max-width: 500px) {
  .accessories-header-bar {
    margin-left: 0 !important; /* Remove margin that causes overflow */
  }
  .featured.container.no-gutter .row.posts {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0px !important; /* Remove gap for continuous lines */
  }

  /* Target the wrapper div created in accessories.js */
  #accessories-grid > div {
    min-width: 0;
    border-bottom: 1px solid #e7eef1;
    box-sizing: border-box;
    padding-top: 15px;
    padding-bottom: 15px;
  }

  /* Left Column */
  #accessories-grid > div:nth-child(odd) {
    border-right: 1px solid #e7eef1;
    padding-left: 0;
    padding-right: 15px;
  }

  /* Right Column */
  #accessories-grid > div:nth-child(even) {
    padding-left: 15px;
    padding-right: 0;
  }

  /* Vertical line: between col 1 and col 2 */
  #accessories-grid > div:nth-child(odd) {
    border-right: 1px solid #e7eef1;
  }

  .featured-item {
    padding: 0px !important;
    margin-bottom: 0px !important;
  }

  .featured-item h4 {
    font-size: 14px !important; /* Flexible small font for mobile */
    min-height: 34px;
  }

  /* Overlay / Footer Styles from cycle-filters-mobile.css (adapted) */
  .mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    display: flex;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: 60px;
  }

  .mobile-bar-btn {
    flex: 1;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-right: 1px solid #e7eef1;
  }

  .mobile-bar-btn:last-child {
    border-right: none;
  }

  .mobile-bar-btn svg {
    width: 20px;
    height: 20px;
    stroke: #00a5f1;
  }

  .filter-count-badge {
    background: #00a5f1;
    color: #fff;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Modals */
  .mobile-sort-modal,
  .mobile-filter-modal {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

  .mobile-sort-modal.show,
  .mobile-filter-modal.show {
    bottom: 0;
  }

  .mobile-sort-content {
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 17px 0;
  }

  .mobile-sort-header,
  .mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 17px 15px;
  }

  .mobile-sort-option {
    padding: 15px 17px;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
  }

  .mobile-sort-option.active,
  .mobile-sort-option.is-selected {
    color: #00a5f1;
    background-color: #e8f6ff;
    border-radius: 0;
  }

  .mobile-filter-modal {
    background: #fff;
    height: 100%;
    flex-direction: column;
  }

  .mobile-filter-header {
    padding: 15px;
    border-bottom: 1px solid #e7eef1;
  }

  .mobile-filter-body {
    flex: 1;
    display: flex;
    overflow: hidden;
  }

  .mobile-filter-sidebar {
    width: 120px;
    background: #f8f9fa;
    border-right: 1px solid #e7eef1;
  }

  .mobile-filter-tab {
    padding: 15px 10px;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #e7eef1;
  }

  .mobile-filter-tab.active {
    background: #fff;
    color: #00a5f1;
    font-weight: 600;
    border-right: 2px solid #00a5f1;
  }

  .mobile-filter-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
  }

  .mobile-filter-section {
    display: none;
  }

  .mobile-filter-section .filter-item {
    color: #303030;
  }

  .mobile-filter-section.active {
    display: block;
  }

  .mobile-filter-footer {
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  }

  .main-blue-button-stock {
    display: none;
  }

  .featured-item .tag {
    left: 20px;
  }

  .mobile-apply-btn {
    width: 100%;
    background: #00a5f1;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 100px;
    font-weight: 600;
  }

  .filter-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
  }

  .filter-item label {
    font-size: 15px;
    flex: 1;
  }

  .filter-item input {
    margin-right: 10px;
  }
}

@media (min-width: 768px) {
  .featured-page {
    margin-top: 108px !important;
  }

  .accessories-main-content {
    padding-left: 20px;
  }
}
