@import url('../../styles/pagination.css');

.rice-krispies-recipe-listing {
  max-width: 1200px;
  margin: 0 auto;
}

/***** SEARCH/FILTER ITEMS *****/
.search-filter-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.search-filter-container .search-bar-container .search-bar-input {
  border-radius: 2em !important;
  border: none !important;
  box-shadow: 0 0 1em rgba(0 0 0 / 15%);
  padding-left: 1rem;
  padding-right: 1rem;
}

.search-filter-container .filter-dropdown-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 2em;
  border: .15em solid var(--secondary-color);
  padding: .5rem 1.5em;
}

.yext-filters-wrapper {
  display: none;
}

body:has(.filter-dropdown-wrapper.open) {
  overflow-y: hidden;
}

.search-filter-container:has(.filter-dropdown-wrapper.open) ~ .yext-filters-wrapper {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 4.5rem 0 0;
  padding: 1rem;
  background-color: var(--white);
}

.search-filter-container:has(.filter-dropdown-wrapper.open) ~ .applied-filters-wrapper {
  display: none;
}

/***** FILTER DIV *****/
.search-filter-container .filter-dropdown-wrapper p {
  color: var(--secondary-color);
  font-size: 1.125rem;
  font-weight: bold;
  margin: 0;
}

.search-filter-container .filter-dropdown-wrapper .results-toggle {
  display: flex;
  gap: .5rem;
  cursor: pointer;
}

.search-filter-container .filter-dropdown-wrapper .results-toggle .results-count-container {
  color: #666;
  font-weight: normal;
}

.search-filter-container .filter-dropdown-wrapper .results-toggle .toggle {
  position: relative;
  width: 20px;
  height: 5px;
  background-color: var(--secondary-color);
  border-radius: 1rem;
  margin-top: .57rem;
}

.search-filter-container .filter-dropdown-wrapper .results-toggle .toggle::before {
  content: '';
  position: absolute;
  top: -.5em;
  left: .5em;
  width: 5px;
  height: 20px;
  background-color: var(--secondary-color);
  border-radius: 1rem;
}

.search-filter-container .filter-dropdown-wrapper .results-toggle .results-count-container:empty + .toggle {
  margin-top: 0;
}

/***** FILTER CONTAINER *****/
.yext-filters-wrapper .filters-close {
  align-self: flex-end;
  position: relative;
  width: 20px;
  height: 3px;
  background-color: var(--secondary-hover);
  transform: rotate(45deg);
  margin: .25rem .25rem .5rem;
}

.yext-filters-wrapper .filters-close::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 3px;
  background-color: var(--secondary-hover);
  transform: rotate(-90deg);
  top: 0;
  left: 0;
}

.yext-filters-wrapper .filter-title {
  font-size: 1.3rem;
  margin: 0;
}

.yext-filters-wrapper .filters-container {
  display: flex;
  flex-direction: column;
  margin: .5rem 0;
}

.yext-filters-wrapper .filters-container .title-label {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: .5rem;
}

.yext-filters-wrapper .filters-container .options-container {
  display: flex;
  flex-flow: column wrap;
  margin-bottom: 2rem;
  max-height: 300px;
}

.yext-filters-wrapper .filters-container .options-container .option {
  display: flex;
  align-items: center;
  gap: .5rem;
  position: relative;
}

.yext-filters-wrapper .filters-container .options-container .option input[type="checkbox"] {
  position: absolute;
  left: -199rem;
}

.yext-filters-wrapper .filters-container .options-container .option input[type="checkbox"] + label {
  color: var(--secondary-hover);
  font-weight: 600;
  padding: .45rem 1rem .45rem 1.5rem;
  display: block;
  line-height: 1;
  cursor: pointer;
}

.yext-filters-wrapper .filters-container .options-container .option input[type="checkbox"] + label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 1rem;
  height: 1rem;
  border: 0.15rem solid var(--light-grey);
  border-radius: 1rem;
  background: var(--light-grey);
  color: var(--light-grey);
}

.yext-filters-wrapper .filters-container .options-container .option input[type="checkbox"] + label::after {
  content: '';
  position: absolute;
  background: var(--primary-color);
  border-radius: 1em;
  border: 0.15em solid var(--primary-color);
  color: var(--white);
  transition: all .15s;
  left: 0;
  top: 0.4rem;
  width: 1rem;
  height: 1rem;
  pad: .2rem;
  font-size: 100%;
  transform: scale(.1);
  opacity: 0;
}

.yext-filters-wrapper .filters-container .options-container .option input[type="checkbox"]:checked + label::after {
  content: "✔";
  transform: scale(1);
  opacity: 1;
}

.yext-filters-wrapper .filters-container .options-container .option label {
  color: var(--secondary-hover);
  font-weight: bold;
}

/***** FILTER ACTIONS *****/
.rk-recipe-search-module > .applied-filters-wrapper .applied-filters-container {
  margin-bottom: 2rem;
}

.yext-filters-wrapper .filters-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
}

.yext-filters-wrapper .filters-actions .applied-filters-container {
  margin-top: 0;
  gap: .5rem;
}

.yext-filters-wrapper .filters-actions .applied-filters-container .removable-filter,
.yext-filters-wrapper .filters-actions .applied-filters-container .clear-all-button {
  font-size: 1rem;
  padding: .25rem 1rem;
}

.yext-filters-wrapper .filters-actions .applied-filters-container .removable-filter button {
  height: 20px;
  width: 20px;
}

.yext-filters-wrapper .filters-actions .applied-filters-container .removable-filter button svg {
  height: 10px;
  width: 10px;
  transform: translate(-2px, -3px);
}

.yext-filters-wrapper .filters-actions .filters-apply-btn .apply-filter-btn {
  background-color: var(--primary-color) !important;
  color: var(--white);
  font-size: 1rem;
  border: none;
  border-radius: 2rem;
  padding: .5rem .75rem;
  text-decoration: none;
  text-transform: none;
  width: 125px;
}

/***** RESULTS CARDS *****/
.yext-cards-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0;
  margin: 0 auto;
  list-style: none;
  gap: .625rem;
}

.yext-cards-container .recipe-card-wrapper {
  display: flex;
  flex-direction: column;
  flex-basis: 100%;
  background-color: var(--white);
  max-width: 24rem;
  border-radius: 1.5rem;
  box-shadow: 0 0 1em rgba(0 0 0 / 15%);
  padding-bottom: 1.5rem;
  text-decoration: none;
}

.yext-cards-container .recipe-card-wrapper .recipe-img-container {
  width: 100%;
  overflow: hidden;
}

.yext-cards-container .recipe-card-wrapper .recipe-img-container img {
  aspect-ratio: 4/3;
  width: 100%;
  object-fit: cover;
  border-radius: 1.5rem 1.5rem 0 0;
}

.yext-cards-container .recipe-card-wrapper .recipe-img-container .recipe-body {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.yext-cards-container .recipe-card-wrapper .recipe-body .recipe-desc {
  text-align: center;
  padding: 0 1rem 1rem;
  text-decoration: none !important;
}

.yext-cards-container .recipe-card-wrapper .recipe-body .recipe-desc .recipe-subhead {
  margin: 1rem 0;
  font-size: 1.5rem;
  line-height: normal;
}

.yext-cards-container .recipe-card-wrapper .recipe-body .recipe-desc .desc {
  color: var(--black);
  margin: 0;
}

.yext-cards-container .recipe-card-wrapper .button-container {
  margin: auto auto 0;
}

@media(width >= 580px) {
  .yext-cards-container .recipe-card-wrapper {
    flex-basis: 48%;
  }
}

@media(width >= 768px) {
  .search-filter-container {
    flex-direction: row;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .search-filter-container .search-bar-wrapper {
    flex-basis: 56%;
  }

  .search-filter-container .filter-dropdown-wrapper {
    flex-basis: 44%;
  }

  body:has(.filter-dropdown-wrapper.open) {
    overflow-y: unset;
  }
  
  .search-filter-container:has(.filter-dropdown-wrapper.open) ~ .yext-filters-wrapper {
    display: flex;
    flex-direction: column;
    position: relative;
    top: unset;
    bottom: unset;
    left: unset;
    right: unset;
    border: 2px solid var(--secondary-color);
    border-radius: 1.25rem;
    background-color: var(--white);
    margin-bottom: 1rem;
  }

  .yext-filters-wrapper .filters-container {
    flex-direction: row;
    margin: .5rem 0;
    gap: 2rem;
  }

  .yext-filters-wrapper .filters-container .static-filters-container {
    flex-basis: 50%;
  }

  .yext-cards-container .recipe-card-wrapper {
    max-width: none;
    flex-basis: 32.3333%;
  }
}
