/*
  Author:
  Karich.Design 2024
  https://github.com/karich-design

  Project: 
  erpnext-frontent
  https://github.com/bitopen/erpnext-frontend/


  1. Root Colors and Settings
  2. Header and Navigation
  3. Filter Modifications
  4. Product view Modifications
  5. Printing Rules
*/

/* ****** 1. Root Colors and Settings ****** */
:root {
  
  --primary-mcs: #efe52e; /* Primary used color */
  --secondary-mcs: #e31e24; /* Secondary color */
  --accent-mcs: #1e8ad3; /* Buttons, click to actions etc. */
  --dark-mcs: #2b2a29; /* Text */

  /* Header Height */
  --header-height-mcs:100px; 

  /* Header Height */
  --header-nav-height-mcs:35px; 

  /* Checkbox size */
  --filter-checkbox-mcs:18px;

  /* Radius of things */
  --border-radius: 5px;
  --border-radius-md: 5px;

  /* in and outside Spacing for mobile  */
  --mobile-page-spacing: 5px;
  --mobile-page-spacing-inside: 10px;
}




/* ****** 2. Header and Navigation ****** */
.navbar-light {
  background: var(--primary-mcs);
}

.navbar {
  display: flex; /* Assuming navbar uses flexbox */
  justify-content: space-between; /* Distributes content horizontally */
  align-items: center; /* Aligns content vertically */
  padding: 5px 10px 5px 10px;
  transition: height 0.3s ease-in-out;
}

.navbar .collapse {
  /* flex: 1; Allows navbar-nav elements to fill space */
}

.navbar-brand, .navbar-toggler {
  /* Move these elements outside the flexbox flow */
  order: 0; /* Ensures logo and button appear first */
}

.navbar-toggler {
  display: inline-block !important;
  position: absolute;
  top: 15px;
  right: 15px;
  border-radius: var(--border-radius);
}

.navbar-brand img {
  min-width: 350px;
  min-height: 76px;
  width: 100%;
  height: auto;
}

.navbar-nav {
  flex-direction: column !important;
}

.navbar-collapse .navbar-nav {
  padding-top: 15px;
}

.nav-item{
  padding-left: 25px;
}

.navbar-collapse {
  background-color: #ffffff;
  border-radius: 5px;
  padding-bottom: 10px;
}

.navbar-collapse{
  /* display: none !important; // Never display the written menu */
  /* display: flex !important; */
  /* flex-basis: auto; */
  order: 1;
}

.navbar .navbar-nav .nav-item {
  height: var(--header-nav-height-mcs);
}

/* .page-content-wrapper{
  padding-top: var(--header-height-mcs);
} */

/* #page-index{
  padding-top: var(--header-height-mcs);
} */

/* .page_content{
  padding-top: var(--header-height-mcs);
} */

.navbar-cta{
  margin: 5px 25px 25px 25px;
}

/* #language-switcher{
  min-width: 100%;
  order: 2; 
  padding-bottom: 5px;
  padding-top: 5px;
} */

.navbar-nav.ml-auto {
  /* Add some space for the language switcher */
  margin-right: 1rem;
}

#language-switcher {
  /* Remove default margin */
  padding-bottom: 5px;
  padding-top: 5px;
  padding-left: 5px;
  /* Style the select element */
}

#language-switcher select{
  width: 150px;
  margin-left: 20px;
  margin-bottom: 10px;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  float: left;
  min-width: 10rem;
  padding: .5rem 0;
  margin: .125rem 0 0;
  font-size: .875rem;
  color: #525252;
  text-align: left;
  list-style: none;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: .375rem;
}

.dropdown-menu.show {
  display: block;
  left: 0px;
  padding-right: 15px;
}

.navbar-nav .dropdown-menu {
  position: absolute; /* Change from static to relative */
}

.dropdown-menu-right {
  right: 0;
  left: auto;
}

.dropdown-item {
  margin-right: 25px;
}

@media (min-width: 992px) {
  .navbar-expand-lg .navbar-collapse {
    flex: 1 !important; /* Override display with flexbox for better responsiveness */
    display: none !important; /* Hide the menu by default */
  }

  .navbar-expand-lg>.container, .navbar-expand-lg>.container-fluid, .navbar-expand-lg>.container-sm, .navbar-expand-lg>.container-md, .navbar-expand-lg>.container-lg, .navbar-expand-lg>.container-xl {
    flex-wrap: wrap;
    padding-right: 0;
    padding-left: 0;
  }

  .navbar-collapse{
    margin-left: 10px;
  }

  /* Show the menu on button click using the existing collapse class */
  .navbar-collapse.show {
    display: flex !important; /* Show menu when the collapse class is applied */
    flex-basis: 100%;
    flex-grow: 1;
  }

  .navbar-cta{
    margin: 0;
  }

  #language-switcher {
    margin-right: 15px;
    
  }

  #language-switcher select {
    margin-bottom: 0px;
  }

  .navbar-brand img {
    min-width: 350px;
    min-height: 76px;
    width: 100%;
    height: auto;
  }

  /* .page-content-wrapper{
    padding-top: 100px;
  } */

}

@media (min-width: 576px) {
  .navbar-collapse .navbar-nav {
    align-items: flex-start;
  }
}

@media (max-width: 575px) {
  
  .navbar-brand img {
    min-width: 350px;
    min-height: 76px;
    width: 100%;
    height: auto;
  }

  .navbar .container {
    display: flex;
    flex-direction: row;
    justify-content: space-between; /* This separates the logo and the nav to each side */
    align-items: center; /* Aligns them vertically */
  }

  .navbar-brand {
    flex: 0 0 auto; /* This means the logo can grow but not shrink, and it's initial size is auto */
    max-width: none; /* If you had a max-width set previously */
  }

  .navbar-toggler {
    /*flex: 1 1 auto;  This allows the toggler to grow and shrink */
    order: 2; /* This will place the toggler after the navbar-brand/logo */
  }

  .navbar-collapse {
    flex: 1 1 auto; /* This allows the navigation items to grow and shrink */
    order: 1; /* This will place the navigation items between the logo and the toggler */
  }
  

  /* .navbar {
    min-height: 200px;
  }

  .container{
    flex-direction: column;
    flex-wrap: nowrap !important;
    justify-content: space-between;
    align-items: unset !important;
  } */

  /* .navbar-toggler{
    max-width: 55px;
  } */

  /* .page-content-wrapper{
    padding-top: 100px;
  } */


}

@media (max-width: 452px) {
  /* .navbar-brand img {
    min-width: 250px;
    min-height: 66px;
    width: 100%;
    height: auto;
  } */

  /* .page-content-wrapper{
    padding-top: 70px;
  } */
}

@media (max-width: 388px) {
  /* .navbar-brand img {
    min-width: 220px;
    min-height: 55px;
    width: 100%;
    height: auto;
  } */
  /* .navbar {
    min-height: 150px;
  } */

  /* #page-index{
    padding-top: 130px;
  } */
  /* .page-content-wrapper{
    padding-top: 60px;
  } */
}






/* ****** 3. Filter Modifications ****** */
.row {
  /* we might get in trouble in the future with that rule */
  flex-direction: column;
  /* background-color: #e31e24; */
}

.buttom-line-fix{
  border-bottom: none !important;
}

.toggle-container{
/* remove list- and grid view buttons */
  display: none;
}

.filters-section {
  display: block !important;
}

/* stretch search bar 100% */
.toolbar .input-group {
  width: 100%;
  max-width: 100%;
  flex: 0 0 100%;
}

/* made brand filter smaller */
/* justify horizontally and colum view */
.filter-options{
  display: flex;
  flex-wrap: wrap;
}

.filter-lookup-wrapper {
  flex: 0 0 200px; /* Adjust width as needed */
}

.filter-options .product-filter {
  width: var(--filter-checkbox-mcs) !important; 
  height: var(--filter-checkbox-mcs) !important; 
}

.filter-lookup-wrapper{
  padding-right: 10px;
}

@media (min-width: 768px) {

  /* stretch filter section 100% */
  .col-md-3 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* stretch product listing 100% */
  .col-md-9 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (min-width: 576px) {

  /* stretch products 100% wide */
  .col-sm-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}




/* ****** 4. Product view Modifications ****** */

.product-page-content .col-md-5 {
  display: flex;
  flex-direction: column; 
  max-width: 100%;
}

.product-page-content .item-slideshow {
  flex-direction: row !important; /* Display thumbnails in a row */
  justify-content: center; /* Center thumbnails */
  order: 2; /* Move to the bottom */
}

.product-page-content .product-image {
  order: 1; /* Keep the product image on top */
  margin-bottom: 10px; /* Add some space between product image and thumbnails */
}

.product-page-content .item-slideshow-image {
  margin: 0 5px 0 0; /* Adjust thumbnail spacing */
}


@media (max-width: 992px) {
  .page-content-wrapper .breadcrumb-container{
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  .product-page-content .col-md-5 {
    padding-left: var(--mobile-page-spacing-inside);
    padding-right: var(--mobile-page-spacing-inside);
  }

  .page-content-wrapper .container {
      padding-left: var(--mobile-page-spacing);
      padding-right: var(--mobile-page-spacing);
  }
}


.card {
  display: flex;
  flex-direction: row;
  border-radius: var(--border-radius) !important;
}

.product-price{
  display: flex;
  /* justify-content: flex-end; */
}

.card-img-container{
  width: unset !important;

  flex-shrink: 0; /* Prevents the image container from shrinking */
  margin-right: 20px; /* Adjust based on your design */
}

.card-img{
  border-radius: var(--border-radius) !important;
}

.item-card-group-section .card-img {
  max-height: 180px;
}

.item-card{
  max-width: 480px;

  /* display: flex; */
  flex-direction: row;
  align-items: center; /* This ensures vertical alignment is centered */
}

.card-body {
  display: flex;
  flex-direction: column;
  justify-content: center; /* Aligns the text vertically */
}

#products-grid-area{
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
}

#custom-filter-toggle {
  background-color: #f0f0f0; 
  border: 1px solid #ccc; 
  border-radius: 5px; 
  padding: 10px 15px; 
  cursor: pointer; 
  display: flex; /* Allow icon to align with text */
  align-items: center; /* Vertically center icon and text */
  position: absolute;
  right: 15px;
  top: -100px;
}

#filter-icon-custom{
  margin-right: 8px;
}

.filter-toggle {
  background-color: #f0f0f0; 
  border: 1px solid #ccc; 
  border-radius: var(--border-radius); 
  padding: 10px 15px; 
  cursor: pointer; 
  display: flex; /* Allow icon to align with text */
  align-items: center; /* Vertically center icon and text */
}

.filter-toggle i {
  margin-right: 5px; /* Add spacing between icon and text */
}

/* Responsive image size adjustments */
@media only screen and (max-width: 768px) {
  .card-img-container img.card-img {
    max-width: 100%; /* Makes image width responsive */
    height: auto; /* Maintains aspect ratio */
  }

  .item-card-group-section .card-img {
    max-height: 150px;
  }

  .item-card {
    flex-direction: column; /* Stacks image and text vertically on small screens */
    align-items: flex-start; /* Aligns items to the start of the flex container */
  }

  .card-body {
    width: 100%; /* Ensures the text takes up the full width below the image */
  }

  #custom-filter-toggle {
    right: 15px;
    top: -120px;
  }
}

@media (max-width: 576px) {
  .item-card-group-section .card-img-container {
    /* height: 100%;
    width: 100%; */
  }

  .item-card-group-section .item-card {
    padding: 1px 2px;
  }

  .filter-options {
    max-height: 100%;
    overflow: none;
  }

  .card-body.text-left.card-body-flex > div:nth-child(1) {
    position: relative;
    top: -15px;
  }

  #product-listing{
    padding-right: 5px;
    padding-left: 5px;
  }

  .card{
    width: 100%;
  }

  #custom-filter-toggle {
    right: 15px;
    top: -125px;
  }
}

@media (max-width: 450px) {
  .item-card-group-section .card-img {
    max-height: 120px;
    width: auto; /* To maintain the aspect ratio */
    object-fit: contain; /* Ensures the image is fully visible within the frame */
  }
  .item-card {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centers content vertically within the container */
    text-align: center; /* Centers content horizontally if needed */
  }
  
  .card-img-container {
    display: flex;
    justify-content: center; /* Centers the image horizontally within its container */
    align-items: center; /* Centers the image vertically within its container */
    height: 100%; /* Ensures the container extends to the full height of the parent */
  }

  #custom-filter-toggle {
    right: 15px;
    top: -125px;
  }
}

@media (min-width: 768px) {
  .item-card{
    max-width: unset;
  }
}

@media (min-width: 1036px) {
  .item-card{
    max-width: 480px;
  }
}

@media (max-width: 1036px) {
  #products-grid-area{
    display: flex;
    flex-direction: column;
  }
}





/* ****** 5. Printing Rules ****** */


@media print {
  /* Set all elements to use the full width of the page */
  body, html {
      width: 100%;
  }

  /* Hide certain elements when printing */
  .no-print {
      display: none;
  }

  /* Ensure images fit within the printed page width */
  /* img {
      max-width: 100%;
      height: auto;
  } */

  /* Adjust margins and padding for print layout */
  .content {
      margin: 0;
      padding: 0;
  }

}