/* ========== product list page styles ========== */
.product-list {
  display: flex;
  flex-direction: column;
}

@media (min-width: 800px) {
  .product-list {
    flex-direction: row;
  }
}

/* ======= Side Navigation ======= */
.sidenav {
  width: 90vw;
  margin: 5% auto 0;
  position: relative;
}

.sidenav hr {
  margin: 5% 0;
}

.catalog-link a {
  font-family: "Vast Shadow", serif;
  color: white;
}

.back-to-top {
  bottom: 30px;
  left: 1%;
  text-decoration: none;
  z-index: 1000;
  position: fixed;
  margin-left: 2%;
}

.back-to-top a {
  font-family: "Vast Shadow", serif;
  color: black;
}

.pill {
  color: white;
  background-color: black;
  padding: 8px;
  border-radius: 8px;
  text-decoration: none;
  margin: 4px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}

.pill .link-x {
  color: white;
  margin-left: 4px;
  font-weight: bold;
}

#industries-list {
  margin-top: 5%;
}

details summary {
  cursor: pointer;
  /* display: flex; */
}

details summary h3 {
  display: inline-block;
  /* margin-bottom: 4%; */
  margin: 0;
}

details summary span {}

/* ----- filters ----- */
#filters #linksContainer {
  display: flex;
  flex-flow: row wrap;
}

#filters form fieldset {
  margin: 4% 0;
}

#filters form fieldset span {
  display: flex;
  flex-direction: column;
}

input[type="radio"] {
  accent-color: black;
}

/* ----- categories ----- */
.sidenav .categories ul {
  list-style: none;
  padding: 0;
}

/* ---- Super Category ---- */
.sidenav .categories ul li {
  margin: 1% 0;
}

.sidenav .categories ul li a {
  /* font-family: "Vast Shadow", serif; */
  font-weight: bold;
  font-size: 1rem;
  text-decoration: none;
  color: black;
  white-space: nowrap;
}

/* ---- Sub Category ---- */
.sidenav .categories ul li ul {
  border-left: 1px solid black;
}

.sidenav .categories ul li ul li {
  margin-left: 5%;
}

.sidenav .categories ul li ul li a {
  font-family: sans-serif;
  font-weight: initial;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}

/* ---- Active Super & Sub Categories ---- */
.sidenav .categories ul li a.active,
.sidenav .categories ul li ul li a.active {
  text-decoration: underline;
}

.sidenav ul hr {
  display: none;
}

@media (min-width: 800px) {
  .sidenav {
    width: clamp(200px, 25%, 260px);
    background-color: #fdd817;
    /* background-color: whitesmoke; */
    margin: 1%;
    padding: 25px;
  }

  .sidenav ul hr {
    width: 20px;
    color: black;
  }

  details summary {
    list-style: none;
  }

  #filters form fieldset {
    margin: 8% 0;
  }
}

/* ========== Right Side Content ========== */
.right-side {
  width: 90vw;
  margin: 0 auto;
  /*overflow: hidden;*/
}

@media (min-width: 800px) {
  .right-side {
    /* width: 57%; */
    margin: 4%;
  }
}

.clear-search-parameters {
  margin: 5% 0;
}

/* ======= Search Options ======= */
.search-options {
  display: grid;
  grid-template-rows: auto;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "search"
    "results"
    "view-options"
    "table-options"
    "sort-by";
  justify-content: space-between;
  gap: 30px 0;
}

@media (min-width: 1400px) {
  .search-options {
    grid-template-areas:
      "search results view-options"
      "table-options . sort-by";
    gap: 50px;
  }
}

/* --- pizza search styles also located in base.css --- */
.search-options .pizza-search {
  grid-area: search;
}

.search-options .pizza-search label {
  display: none;
}

/* ----- results ------- */
.results {
  grid-area: results;
  justify-self: flex-end;
  align-self: flex-end;
}

.results p {
  /* margin: 0; */
}

/* ----- view option links ------- */
.view-options {
  grid-area: view-options;
  display: flex;
  justify-content: flex-end;
  align-self: flex-end;
  gap: 5px;
  gap: 10px;
}

.view-options img {
  height: 20px;
  height: 30px;
  background-color: #fff;
  padding: 5px;
  padding: 8px;
  border-radius: 5px;
}

.view-options img:hover,
.view-options img.active {
  filter: invert(100%);
}

/* ----- sort by options ------- */
.sort-by {
  grid-area: sort-by;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2%;
  white-space: nowrap;
}

.sort-by select {
  width: auto;
  margin: 0;
  padding: 6px;
}

/* ----- table options ------- */
.table-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: space-between;
  align-items: end;
  grid-area: table-options;
}

.table-options a {
  white-space: nowrap;
}

@media (min-width: 550px) {
  .table-options {
    flex-direction: row;
  }
}

@media (min-width: 1400px) {
  .table-options {
    justify-content: flex-start;
    align-items: center;
  }
}

/* ===== Product Display Area ===== */
.products a {
  display: flex;
  justify-content: space-between;
  margin: 5% 0;
}

@media (min-width: 800px) {
  .products a {
    margin: 1% 0;
  }
}

#search-results.products.show-table #grid-list {
  display: none;
}

.products.show-table #table-general {
  display: table;
}

/* .products .description #heart-icon {
  position: absolute;
  top: 5px;
  right: 5px;
} */
/* ========== Grid & List View ========== */
.grid #grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.list #grid-list {
  grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
}

#grid-list {
  margin: 2.5% 0;
}

#grid-list a.product {
  text-decoration: none;
  color: black;
}

#grid-list a.product img {
  height: auto;
  object-fit: contain;
  display: flex;
}

#grid-list .description {
  position: relative;
}

#grid-list .description p {
  margin: 0;
  font-size: 1rem;
}

#grid-list .grid-code {
  background-color: #fdd817;
  color: black;
  align-self: flex-start;
  justify-self: flex-start;
  padding: 2.5px 5px;
  margin-right: 10px;
  border-radius: 4px;
}

/* ========== Grid View Only ========== */
.grid hr {
  display: none;
}

.grid a.product {
  flex-direction: column;
  position: relative;
}

.grid a img {
  width: 100%;
}

.grid .product-details {
  background-color: rgba(0, 0, 0, .8);
  color: white;
  padding: 4%;
  height: clamp(50px, 75px, 80px);
  line-height: 1.6;
}

.grid .product-details h4 {
  position: absolute;
  top: 60%;
  left: 2%;
  background-color: black;
  color: white;
  margin: 0;
  font-size: 1rem;
  padding: 1%;
  border-radius: 4px;
}

.grid .product-details p {
  margin: 0;
  font-size: 1rem;
}

.grid .list-view-details {
  display: none;
}

/* ========== List View Only ========== */
.list {
  flex-direction: column;
}

.list .product {
  margin: 25px 0;
}

.list hr {
  width: 100%;
}

.list a {
  width: 100%
}

.list a img {
  width: clamp(150px, 40%, 325px);
  object-fit: cover;
}

.list .product-details {
  display: flex;
  flex-direction: column;
  margin-left: 5%;
  flex-grow: 2;
}

.list .product-details h4 {
  margin: 0;
}

.list .list-view-details {
  display: block;
}

.list .list-view-details p {
  margin: 0;
}

/* ========== Table View ========== */
#table-general {
  display: none;
}

caption {
  display: none;
}

thead {
  border-bottom: 2px solid black;
}

/* --- row striping --- */
tbody tr:nth-child(even) {
  background-color: whitesmoke;
}

tbody tr:nth-child(odd) {
  background-color: white;
}

thead tr th,
tbody tr td {
  padding: 5px;
}

tbody tr td {
  border: none;
  border-left: 2px dashed white;
}

thead tr th {
  border: none;
  text-align: left;
}

thead tr th:not(:nth-child(2), :nth-child(3)),
tbody tr td:not(:nth-child(2), :nth-child(3)) {
  text-align: center;
}

/* --- rotated headers --- */
.rotate {
  height: 80px;
  position: relative;
}

.rotate .rotated-label {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: rotate(-45deg);
  transform-origin: center left;
  white-space: nowrap;
}

/* ====== Table Layout & Options ====== */
.table-wrapper {
  width: 100%;
}

/* --- column widths --- */
#table-general {
  width: 100%;
  margin: 5% 5% 0 0;
  border-collapse: collapse;
  table-layout: fixed;
}

#table-general th,
#table-general td {
  padding: 8px 10px;
  /* prevent wrapping in most columns */
  white-space: nowrap;
  /* text-align: center; */
}

#table-general th,
#table-general td,
#table-general th.code,
#table-general td.code,
#table-general th.description,
#table-general td.description a {
  font-size: .8rem;
}

#table-general th.code,
#table-general td.code {
  text-align: right;
  width: 80px;
}

/* let desc. column stretch to fill remaining space */
#table-general th.description,
#table-general td.description {
  width: 150px;
  /* allow wrapping if needed */
  white-space: normal;
  text-align: left;
}

@media (min-width: 500px) {
  #table-general {
    /* allow column size based on content */
    table-layout: auto;
  }

  #table-general th,
  #table-general td,
  #table-general th.code,
  #table-general td.code,
  #table-general th.description,
  #table-general td.description a {
    font-size: 1rem;
  }

  #table-general th.code,
  #table-general td.code {
    width: initial;
  }

  /* let desc. column stretch to fill remaining space */
  #table-general th.description,
  #table-general td.description {
    width: 100%;
  }
}

/* ======= Table Column Toggle ======= */
.hidden-column {
  display: none !important;
  color: magenta;
}

#radio-dropdown {
  position: relative;
  display: none;
}

#radio-summary {
  background-color: #f0f0f0;
  padding: 8px;
  cursor: pointer;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: max-content;
}

#radio-options {
  display: none;
  position: absolute;
  background-color: #fff;
  border: 1px solid #ccc;
  margin-top: 5px;
  padding: 10px;
  z-index: 100;
  border-radius: 4px;
}

#radio-dropdown.open #radio-options {
  display: block;
}

.radio-option {
  display: block;
  margin: 5px 0;
}

/* --- sort indicators --- */
.sort-indicator {
  font-size: 12px;
  color: #888;
  margin-left: 5px;
  cursor: pointer;
}

th.asc .sort-indicator {
  color: green;
}

th.desc .sort-indicator {
  color: red;
}

/* ========== Tabs ========== */
.tab-list {
  display: flex;
}

.tab-list .tablinks {
  cursor: pointer;
  padding: 8px 16px;
  transition: 0.3s;
  text-decoration: underline;
}

.tab-list .tablinks:hover {
  background-color: whitesmoke;
  color: black;
}

.tab-list .tablinks[aria-selected="true"] {
  background-color: #000;
  color: white;
  text-decoration: none;
}

/* ========= Table Images ========= */
.product-list #table-general a {
  position: relative;
  margin: 0;
  color: rgb(27, 137, 202);
}

.product-list #table-general a .icon {
  display: none;
}

@media (min-width: 800px) {
  .product-list #table-general a .icon {
    display: initial;
    height: 18px;
    width: 18px;
  }
}

.product-list #table-general a .icon img {
  height: 100%;
}

.product-list #table-general a img.hoverProduct {
  position: absolute;
  bottom: 90%;
  right: -25%;
  z-index: 1000;
  max-width: 250px;
  display: none;
  -moz-box-shadow: 1px 2px 7px 2px rgba(0, 0, 0, 0.75);
  -webkit-box-shadow: 1px 2px 7px 2px rgba(0, 0, 0, 0.75);
  box-shadow: 1px 2px 8px 2px rgba(0, 0, 0, 0.75);
}

.product-list #table-general a:hover img.hoverProduct {
  display: block;
}

/* loading image */
.spinner {
  animation: spin 1s linear infinite;
  display: inline-block;
  width: 16px;
  height: 16px;
}

/* spin animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}