@import url('https://fonts.googleapis.com/css2?family=Pompiere&display=swap');
/* The color palette seemed off, replaced to make it more appealing */
/* https://www.realtimecolors.com/?colors=040316-ffffff-427b43-bccc2e-f6844c&fonts=Inter-Inter */
:root{
  --background-color: #FFFFFF;
  --primary-color: #427A43;
  --secondary-color: #BBCB2E;
  --accent-color: #F5824A;
  --text-color: #040316;
  --header-text-color: #f9ffef;
  --card-background: #ffffff;
  --card-border: rgba(0, 0, 0, 0.12);
  --button-text-color: #fff7eb;
  --footer-text-color: #f7ffe8;
}

/* For dark mode management */
:root.dark-mode{
  --background-color: #041702;
  --primary-color: #427A43;
  --secondary-color: #c1d133;
  --accent-color: #b34209;
  --text-color: #f8f8ff;
  --header-text-color: #eaf7d9;
  --card-background: rgba(20, 56, 25, 0.92);
  --card-border: rgba(255, 255, 255, 0.14);
  --button-text-color: #fff4de;
  --footer-text-color: #f2ffe3;
}

/* Styling of default tags*/
:root{
  font-size: 20px;
  font-family: 'Pompiere', cursive;
}
body{
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Pompiere', cursive;
}
header{
  position: fixed;
  width: 100%;
  top: 0;
  /* font-family: 'Pompiere', cursive; */
  z-index: 1000;
  color: var(--text-color);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

footer{
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 42px;
  width: 100%;
  bottom: 0;
  background-color: var(--primary-color);
  color: var(--footer-text-color);
  /* font-family: 'Pompiere', cursive; */
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

footer p{
  margin: 0;
  font-size: inherit;
}

input{
  border: none;
  font-size: 1rem;
  padding: 6px 10px;
  width: 400px;
  background-color: transparent;
  font-family: 'Pompiere', cursive;
}

button:hover{
  cursor: pointer;
}

i{
  color: black;
}

label{
  display: flex;
  flex-direction: row;
  align-items: center;
  width: fit-content;
  font-family: 'Pompiere', cursive;
  gap: 6px;
}

button{
  border: none;
  background-color: var(--accent-color);
  color: var(--button-text-color);
  font-size: 1rem;
  padding: 6px 12px;
  font-family: 'Pompiere', cursive;
  border-radius: 8px;
}
select{
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 1rem;
  padding: 6px 12px;
  min-height: 2.15rem;
  background-color: rgba(255, 255, 255, 0.14);
  color: var(--header-text-color);
  font-family: 'Pompiere', cursive;
  border-radius: 8px;
  box-shadow: none;
}

select:focus{
  outline: 2px solid var(--accent-color);
  outline-offset: 1px;
}
/* --------- Styling header's custom elements -----------*/

#topSearchBar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;  
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background-color: var(--primary-color);
  padding: 0.5rem 0;
}

#searchContainer {
  display: flex;
  align-items: center;
  padding: 7px;
  /* Keeping the color white no matter the color mode */
  background-color: white;
  border-radius: 25px;
}

#logo{
  height: 40px;
  margin-left: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
    color: var(--secondary-color);
}

#logo span{
  color: var(--accent-color);
}

#logo i{
  color: var(--secondary-color);
}

#navBar {
  background-color: var(--primary-color);
  height: 2rem;
  display: flex;
  align-items: center;
}

.breadcrumb {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  display: flex;
  align-items: center;
}

.breadcrumb li{
  display: flex;
  align-items: center;
}

/* https://www.w3schools.com/howto/howto_css_breadcrumbs.asp */
.breadcrumb li + li::before{
  content: ">";
  /* Keeping the color white no matter the color mode */
  color: white;
}

.breadcrumb .tablinks{
  border: none;
  background: transparent;
  font-size: 1rem;
  padding: 6px 8px;
  cursor: pointer;
  font-family: 'Pompiere', cursive;
  /* Keeping the color white no matter the color mode */
  color: white;
}

.breadcrumb .tablinks.active{
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

#AccessibilityButton{
  background-color: transparent;
  border: none;
  display: flex;
  gap: 12px;
  align-items: center;
}

#AccessibilityButton i{
  color: var(--secondary-color);
  font-size: 1.5rem;
}


.tabcontent{
  min-height: 75vh;
  display: none;
  align-items: center;
  flex-direction: column;
  padding: 5.5rem 12px 6rem;
  background-color: var(--background-color);
  color: var(--text-color);
}
.tabcontent.is-active{
  display: flex;
}
#Home{
  background-image: url('Background.png');
  background-size: cover;
  background-position: center;
}
/* --------- Styling Client information tab ----------- */
/* Code from https://www.w3schools.com/howto/howto_css_switch.asp */
/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding-left: 70px;
  cursor: pointer;
}
/* Hide default HTML checkbox/radio for switches only */
.switch input[type="checkbox"],
.switch input[type="radio"] {
  opacity: 0;
  width: 0;
  height: 0;
}
/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  width: 60px;
  height: 34px;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}
.switch input:checked + .slider {
  background-color: var(--accent-color);
}
.switch input:focus + .slider {
  box-shadow: 0 0 1px var(--accent-color);
}
.switch input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}
/* ------- Client information Page----------- */
#ClientCard {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-width: 30rem;
  min-height: 10rem;
  padding: 2rem;
  margin-top: 1.5rem;
  background: var(--card-background);
  color: var(--text-color);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--card-border);
}

#ClientCard i{
  color: var(--text-color);
}
#ClientCardContent{
  display: flex;
  flex-direction: row;
  gap: 16px;
}
#dietOptions{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#foodPreference{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#buttonContainer{
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  width: 100%;
}

/* -------- Product Page ----------- */

#productHeader{
  position: static;
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 10px;
  padding: 0.7rem 0.9rem;
  margin: 0 0 10px;
  background-color: var(--primary-color);
  color: var(--header-text-color);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0;
}
#productHeader i{
  padding: 0;
  color: var(--header-text-color);
}
#productHeader p,
#productHeader .filter-option{
  color: var(--header-text-color);
  margin: 0;
  line-height: 1.15;
}

.product-list{
  display: flex;
  flex-direction: column;
  padding-top: 0.2rem;
  gap: 10px;
  width: min(1120px, 96%);
  margin-bottom: 16px;
}

.product-header-title{
  text-align: center;
  font-size: 0.95rem;
}

.productSelect{
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px 14px;
  align-items: center;
}

.product-header-section{
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-cats{
  min-width: 0;
}

.product-price,
.product-sort-actions{
  justify-self: end;
}

.filter-option{
  font-size: 0.92rem;
  white-space: nowrap;
}

.filter-option i{
  margin-right: 6px;
}

.category-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.category-btn{
  background: rgba(255, 255, 255, 0.08);
  color: var(--header-text-color);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.category-btn.active{
  background: var(--accent-color);
  color: var(--button-text-color);
  border-color: var(--accent-color);
}

.price-slider-wrap{
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--header-text-color);
}

#priceFilter{
  width: 150px;
  height: 14px;
  padding: 0;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

/* https://www.w3schools.com/howto/howto_js_rangeslider.asp */
#priceFilter::-webkit-slider-runnable-track{
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

#priceFilter::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  border: 2px solid var(--accent-color);
  background: #ffffff;
  box-shadow: none;
}

#priceFilterValue{
  min-width: 70px;
  font-size: 0.9rem;
  white-space: nowrap;
}

#priceSort{
  min-width: 130px;
}

#Client,
#addCart{
  min-height: 2.15rem;
}

@media (max-width: 1120px){
  .productSelect{
    grid-template-columns: 1fr 1fr;
  }

  .product-cats{
    grid-column: 1 / -1;
  }

  .product-price{
    justify-self: start;
  }

  .product-sort-actions{
    justify-self: end;
  }
}

@media (max-width: 760px){
  #productHeader{
    width: min(1120px, 96%);
  }

  .productSelect{
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .product-cats,
  .product-price,
  .product-sort-actions{
    grid-column: auto;
    justify-self: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  #priceFilter{
    width: min(220px, 60vw);
  }

  #priceSort{
    width: 100%;
    max-width: 220px;
  }
}
#Products .product-list{
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: min(1120px, 96%);
}

.product-item{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background-color: var(--card-background);
  color: var(--text-color);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
}

.product-label{
  font-weight: 600;
  text-transform: capitalize;
  margin: 0;
}

.product-price{
  font-size: 0.95rem;
  opacity: 0.9;
}

.product-qty{
  width: 74px;
  border-radius: 8px;
  border: 1px solid var(--accent-color);
  padding: 4px 6px;
  background: white;
  color: #222;
}

.product-image{
  width: 100%;
  height: 10rem;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background-color: rgba(255,255,255,0.1);
}

.product-image.placeholder{
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
}

.product-controls{
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.product-qty-label{
  font-size: 0.9rem;
}

.add-to-cart-btn{
  margin-left: auto;
  background-color: var(--accent-color);
  color: var(--button-text-color);
  font-weight: 600;
}

.product-category-section{
  width: 100%;
}

.product-category-title{
  margin: 0 0 8px;
  color: var(--text-color);
}

.product-category-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.empty-state{
  padding: 16px;
  border-radius: 10px;
  background: var(--card-background);
  border: 1px solid var(--card-border);
}

#addCart{
  font-weight: 600;
  letter-spacing: 0.02em;
}

#addCart:active{
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* -------- Cart Page ----------- */
.cart-list{
  width: min(1120px, 96%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item{
  display: grid;
  grid-template-columns: 88px 1fr auto auto auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: var(--card-background);
  border: 1px solid var(--card-border);
}

.cart-item .product-image{
  width: 88px;
  height: 88px;
}

.cart-name{
  font-weight: 600;
  text-transform: capitalize;
}

.cart-qty, .cart-line-total{
  font-size: 0.95rem;
  opacity: 0.9;
}

.cart-remove{
  border: 1px solid var(--accent-color);
  background-color: transparent;
  color: var(--text-color);
  font-size: 1rem;
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: none;
}

.cart-total{
  width: min(1120px, 96%);
  font-size: 1.2rem;
  font-weight: 600;
}

/* ------- Accessibility ----------- */
#displayAccessibility{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#darkModeToggle{
  width: auto;
  accent-color: var(--accent-color);
}

.darkmode-checkbox{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-color);
  cursor: pointer;
}
