#page-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 240px;
  background-color: var(--border);
  margin-bottom: 0px;
  @media (min-width: 768px) {
    margin-bottom: 0;
  }
  h1 {
    font-size: 48px;
    font-weight: 300;
  }
  .breadcrumb {
    a,
    span {
      font-size: 12px;
    }
    a {
      text-decoration: none;
      color: var(--text-gray);
    }
  }
}
.page-container {
  display: flex;
  flex-direction: column;
  @media (min-width: 768px) {
    flex-direction: row;
  }
  min-height: 100vh;
  padding-top: 30px;
  margin-top: 20px;
  gap: 30px;
  .sidebar {
    width: 100%;
    padding: 16px;
    height: 100%;
    position: sticky;
    top: 0;
    overflow-y: auto;
    @media (min-width: 768px) {
      width: 280px;
      min-width: 280px;
    }
    .clear-filters-container {
      margin-bottom: 20px;
      text-align: center;

      .clear-filters-btn {
        background-color: var(--border);
        color: var(--text-gray);
        border: none;
        border-radius: 4px;
        padding: 8px 16px;
        font-size: 12px;
        cursor: pointer;
        transition: all 0.2s;
        width: fit-content;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.2s;
        i {
          color: var(--text-gray);
        }
        &:hover {
          opacity: 0.8;
        }
        &.hidden {
          display: none;
        }
      }
    }
    .section {
      margin-bottom: 24px;
      .section-title {
        font-size: 14px;
        color: var(--text);
        padding-bottom: 6px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 12px;
        font-weight: 600;
      }
      .category-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        color: var(--text);
        font-size: 13px;
        &.active {
          font-weight: bold;
        }
        cursor: pointer;
        > span:first-child {
          transition: all 0.2s;
        }
        &:hover {
          > span:first-child {
            color: var(--gold);
          }
        }
        .category-count {
          color: var(--text-gray);
          font-size: 12px;
        }
      }
      .tags-container {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        .tag {
          padding: 6px 12px;
          background: var(--border);
          border-radius: 20px;
          font-size: 12px;
          color: var(--text);
          cursor: pointer;
          transition: all 0.2s;
          &:hover,
          &.active {
            background: var(--gold);
            color: var(--white);
          }
        }
      }
      .price-slider {
        -webkit-appearance: none;
        appearance: none;
        width: 100%;
        height: 4px;
        background: var(--border);
        border-radius: 2px;
        margin: 20px 0;
        cursor: pointer;
        &::-webkit-slider-thumb {
          -webkit-appearance: none;
          width: 16px;
          height: 16px;
          background: var(--gold);
          border-radius: 50%;
          cursor: pointer;
        }
      }
      .price-range-labels {
        display: flex;
        justify-content: space-between;
        font-size: 12px;
        color: var(--text);
        #price-value {
          font-weight: bold;
        }
      }
    }

    .price-range-container {
      margin-top: 15px;
    }

    .price-inputs {
      display: flex;
      justify-content: space-between;
      margin-bottom: 15px;
      .price-input-group {
        width: 48%;

        .price-input {
          width: 100%;
          padding: 8px;
          border: 1px solid var(--border);
          border-radius: 4px;
          margin-top: 5px;
          margin-bottom: 5px;
          direction: rtl;
        }
        .price-display {
          display: block;
          font-size: 12px;
          color: var(--text-gray);
          margin-bottom: 5px;
        }
      }
    }
    .apply-filter-btn {
      width: 100%;
      padding: 8px;
      background-color: var(--gold);
      color: var(--white);
      border: none;
      border-radius: 4px;
      cursor: pointer;
      margin-bottom: 15px;
      text-align: center;
      transition: all 0.3s;
      &:hover {
        background-color: var(--gold-dark);
      }
    }
  }
  .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    .product-container {
      position: relative;
      min-height: 200px;
      &::after {
        content: "\f110";
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        pointer-events: none;
        display: none;
        font-size: 40px;
        color: var(--gold);
        animation-name: spin;
        animation-duration: 2000ms;
        animation-iteration-count: infinite;
        animation-timing-function: linear;
        @keyframes spin {
          from {
            transform: rotate(0deg);
          }
          to {
            transform: rotate(360deg);
          }
        }
      }
      > div {
        margin-bottom: 15px;
      }
      &.loading {
        &::after {
          display: block;
        }
        > div {
          display: none;
        }
        + .pagination {
          display: none;
        }
      }
    }
    .header {
      order: -1;
      padding: 15px 0;
      .sorting-container {
        display: flex;
        flex-direction: column-reverse;
        gap: 10px;
        @media (min-width: 768px) {
          flex-direction: row;
          gap: 0;
        }
        align-items: center;
        justify-content: space-between;
        padding: 10px 15px;
        background: var(--white);
        direction: rtl;
        margin-bottom: 20px;
        .sorting {
          border: 1px solid var(--border);
          border-radius: 2.5rem;
          align-items: center;
          width: 380px;
          max-width: 100%;
          height: 38px;
          padding: 0 20px;
          display: flex;
          margin: 0 auto;
          > span {
            white-space: nowrap;
            font-size: 14px;
          }
          .dropdowwn {
            position: relative;
            margin: 0 10px;
            margin-left: auto;
            width: 100%;

            &.active {
              .dropdowwn-btn i {
                transform: rotate(180deg);
              }
              .dropdowwn-menu {
                display: block;
              }
            }
            .dropdowwn-btn {
              background: var(--white);
              color: var(--text-gray);
              border-radius: 20px;
              border: none;
              cursor: pointer;
              width: 100%;
              display: flex;
              align-items: center;
              justify-content: space-between;
            }

            .dropdowwn-menu {
              display: none;
              position: absolute;
              top: 100%;
              top: 28px;
              right: 0;
              background: var(--white);
              border: 1px solid var(--border);
              border-top: none;
              border-radius: 0 5px 5px 5px;
              list-style: none;
              padding: 5px;
              box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
              z-index: 20;
              width: calc(100% - 15px);
              li {
                padding: 5px;
                cursor: pointer;
                transition: all 0.2s;
                &:hover {
                  color: var(--gold);
                }
              }
            }
          }
        }
        .results-info {
          color: var(--text-gray);
          font-size: 14px;
        }
      }
    }
    .pagination {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      margin: 20px 0;
      &.hidden {
        display: none;
      }
      a,
      span {
        font-family: YekanBakhFaNum;
        border-radius: 100%;
        display: block;
        text-decoration: none;
        padding: 0;
        font-size: 1em;
        text-align: center;
        text-transform: uppercase;
        line-height: 40px;
        height: 40px;
        width: 40px;
        background-color: var(--border);
        color: var(--text-gray);
        transition: all 0.2s;
        &:hover {
          background-color: var(--gold);
          color: var(--white);
        }
      }
      .current {
        background-color: var(--gold);
        color: var(--white);
      }
    }
  }
}
