/* Combined CSS - MultiSelect + Custom Styles */

/* ========== MULTISELECT.CSS ========== */
.multi-select {
  display: flex;
  box-sizing: border-box;
  flex-direction: column;
  position: relative;
  width: 100%;
  user-select: none;
}
.multi-select .multi-select-header {
  border: 1px solid #dee2e6;
  padding: 7px 30px 7px 12px;
  overflow: hidden;
  gap: 7px;
  min-height: 45px;
}
.multi-select .multi-select-header::after {
  content: "";
  display: block;
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23949ba3' viewBox='0 0 16 16'%3E%3Cpath d='M8 13.1l-8-8 2.1-2.2 5.9 5.9 5.9-5.9 2.1 2.2z'/%3E%3C/svg%3E");
  height: 12px;
  width: 12px;
}
.multi-select .multi-select-header.multi-select-header-active {
  border-color: #c1c9d0;
}
.multi-select .multi-select-header.multi-select-header-active::after {
  transform: translateY(-50%) rotate(180deg);
}
.multi-select .multi-select-header.multi-select-header-active + .multi-select-options {
  display: flex;
}
.multi-select .multi-select-header .multi-select-header-placeholder {
  color: #65727e;
}
.multi-select .multi-select-header .multi-select-header-option {
  display: inline-flex;
  align-items: center;
  background-color: #f3f4f7;
  font-size: 14px;
  padding: 3px 8px;
  border-radius: 5px;
}
.multi-select .multi-select-header .multi-select-header-max {
  font-size: 14px;
  color: #65727e;
}
.multi-select .multi-select-options {
  display: none;
  box-sizing: border-box;
  flex-flow: wrap;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 999;
  margin-top: 5px;
  padding: 5px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}
.multi-select .multi-select-options::-webkit-scrollbar {
  width: 5px;
}
.multi-select .multi-select-options::-webkit-scrollbar-track {
  background: #f0f1f3;
}
.multi-select .multi-select-options::-webkit-scrollbar-thumb {
  background: #cdcfd1;
}
.multi-select .multi-select-options::-webkit-scrollbar-thumb:hover {
  background: #b2b6b9;
}
.multi-select .multi-select-options .multi-select-option, .multi-select .multi-select-options .multi-select-all {
  padding: 4px 12px;
  height: 42px;
}
.multi-select .multi-select-options .multi-select-option .multi-select-option-radio, .multi-select .multi-select-options .multi-select-all .multi-select-option-radio {
  margin-right: 14px;
  height: 16px;
  width: 16px;
  border: 1px solid #ced4da;
  border-radius: 4px;
}
.multi-select .multi-select-options .multi-select-option .multi-select-option-text, .multi-select .multi-select-options .multi-select-all .multi-select-option-text {
  box-sizing: border-box;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font-size: 16px;
  line-height: 20px;
}
.multi-select .multi-select-options .multi-select-option.multi-select-selected .multi-select-option-radio, .multi-select .multi-select-options .multi-select-all.multi-select-selected .multi-select-option-radio {
  border-color: #40c979;
  background-color: #40c979;
}
.multi-select .multi-select-options .multi-select-option.multi-select-selected .multi-select-option-radio::after, .multi-select .multi-select-options .multi-select-all.multi-select-selected .multi-select-option-radio::after {
  content: "";
  display: block;
  width: 3px;
  height: 7px;
  margin: 0.12em 0 0 0.27em;
  border: solid #fff;
  border-width: 0 0.15em 0.15em 0;
  transform: rotate(45deg);
}
.multi-select .multi-select-options .multi-select-option.multi-select-selected .multi-select-option-text, .multi-select .multi-select-options .multi-select-all.multi-select-selected .multi-select-option-text {
  color: #40c979;
}
.multi-select .multi-select-options .multi-select-option:hover, .multi-select .multi-select-options .multi-select-option:active, .multi-select .multi-select-options .multi-select-all:hover, .multi-select .multi-select-options .multi-select-all:active {
  background-color: #f3f4f7;
}
.multi-select .multi-select-options .multi-select-all {
  border-bottom: 1px solid #f1f3f5;
  border-radius: 0;
}
.multi-select .multi-select-options .multi-select-search {
  padding: 7px 10px;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  margin: 10px 10px 5px 10px;
  width: 100%;
  outline: none;
  font-size: 16px;
}
.multi-select .multi-select-options .multi-select-search::placeholder {
  color: #b2b5b9;
}
.multi-select .multi-select-header, .multi-select .multi-select-option, .multi-select .multi-select-all {
  display: flex;
  flex-wrap: wrap;
  box-sizing: border-box;
  align-items: center;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  width: 100%;
  font-size: 16px;
  color: #212529;
}

/* ========== CUSTOM STYLES ========== */
html, body {
  height: 100%;
  font-size: 1rem;
}
@media (max-width: 992px) {
  html, body {
    font-size: 0.9rem;
  }

}
/* @media (max-width: 768px) {
  html, body {
    font-size: 0.85rem;
  }
} */
@media (max-width: 576px) {
  html, body {
    font-size: 0.8rem;
  }
}
body {
  display: flex;
  flex-direction: column;
}
nav {
  z-index: 1500;
}
.content-wrap {
  flex: 1 0 auto;
}
footer {
  flex-shrink: 0;
}

/* Paredzēts boostrap dropdown, lai tas strādātu izmantojot hover */
.dropdown-hover:hover .dropdown-menu {
  display: block;
  margin-top: 0;
}

.cursor-pointer {
  cursor: pointer;
}
.cursor-default {
  cursor: default;
}
.small-icon {
  height: 24px;
}

.table.table-form-width th {
  width: 250px!important;
}

.table.table-form-width tr.required th:before {
  content: "*";
  color: red;
}

.product-image-style {
  width: 100%;
  max-height: 500px;
  height: auto;
  object-fit: contain;
  display: block;
}

/* MAP style */
.region-map {
  min-height: 400px;
  background-color: transparent!important;
}
.region-map path {
  stroke: rgb(255, 255, 255);
  stroke-opacity: 1;
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: square;
  fill: rgb(51, 136, 255);
  fill-opacity: 0.6;

  transition: 0.2s;
}
.region-map path:hover, .region-map path.selected {
  fill-opacity: 0.9
}
#region-map-toggle {
  background-color: #ebebeb;
  transition: all 0.1s;
}
#region-map-toggle:hover {
  filter: brightness(1.05);
}

.card-bg-color {
  background-color: #e6eaee!important;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.nav_region.multi-select .multi-select-header {
  border: none;
}

.product-image {
  max-width: 400px;
}
@media (max-width: 1200px) {
  .product-image {
    max-width: 300px;
  }
}
/* Prevent navbar wrapping on desktop */
@media (min-width: 992px) {
  .navbar-no-wrap {
    flex-wrap: nowrap !important;
    display: flex !important;
    flex-direction: row !important;
  }
  .navbar-no-wrap .nav-item {
    white-space: nowrap;
  }
}

/* Responsive navbar for smaller desktop screens */
@media (min-width: 992px) and (max-width: 1400px) {
  /* Reduce search input width */
  #nav-search-form {
    max-width: 600px !important;
  }
  #nav-search-input {
    font-size: 0.9rem;
    padding: 0.375rem 0.5rem;
  }
  /* Reduce navbar padding */
  .navbar-nav .nav-link {
    padding-left: 0.4rem !important;
    padding-right: 0.4rem !important;
    font-size: 0.9rem;
  }
  /* Smaller language toggle buttons */
  .navbar-nav .nav-item .btn-link {
    font-size: 0.85rem;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }
  /* Remove spacer padding on tighter screens */
  .nav-items-spacer {
    padding: 0 !important;
  }
}

@media (min-width: 992px) and (max-width: 1200px) {
  /* Further reduce search input width on smaller screens */
  #nav-search-form {
    max-width: 450px !important;
  }
  #nav-search-input {
    font-size: 0.85rem;
    padding: 0.3rem 0.4rem;
  }
  /* Tighter spacing for nav items */
  .navbar-nav .nav-link {
    padding-left: 0.3rem !important;
    padding-right: 0.3rem !important;
    font-size: 0.85rem;
  }
  /* Even smaller language toggle */
  .navbar-nav .nav-item .btn-link {
    font-size: 0.8rem;
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
  }
  /* Smaller SVG icons */
  .navbar-nav svg {
    width: 18px;
    height: 18px;
  }
}

/* Mobile: keep items in one row inside hamburger menu */
@media (max-width: 991px) {
  .navbar-no-wrap {
    flex-wrap: nowrap !important;
    display: flex !important;
    flex-direction: row !important;
  }
  .navbar-no-wrap .nav-item {
    white-space: nowrap;
  }

    #nav-search-form {
    padding-top: 20px;
  }
}

@media (max-width: 768px) {
  .product-image {
    max-width: 100%;
  }
  .nav-items-spacer {
    padding: 10px;
  }
}

#category-select {
  background-color: white;
}
#category-select .multi-select-options {
  max-height: 350px;
}
#category-select.above .multi-select-options {
  right: auto;
  top: auto;
  bottom: 50px;
}
#category-select .multi-select-option-radio {
  border-radius: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
#category-select .multi-select-selected .multi-select-option-radio::after {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  margin: 0em;
  border: none;
  background-color: white;
  border-width: 0.2;
  transform: rotate(0deg);
  border-radius: 100%;
}
.category-select-indent-1 { margin-left: 2rem; }
.category-select-indent-2 { margin-left: 4rem; }
.category-select-indent-3 { margin-left: 6rem; }
.category-select-indent-4 { margin-left: 8rem; }
.category-select-indent-5 { margin-left: 10rem; }

/* --- Category tree styles --- */
#category-table tr.category-row .toggle-icon{
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: .4rem;
  vertical-align: -1px;
  color: #000;
  background-color: currentColor;

  -webkit-mask: url('data:image/svg+xml;utf8,\
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\
<path fill=\"%23000\" d=\"M6 3l6 5-6 5z\"/>\
</svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,\
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\
<path fill=\"%23000\" d=\"M6 3l6 5-6 5z\"/>\
</svg>') center / contain no-repeat;

  transition: transform 120ms ease;
}

  /* Indentation by depth level */
  #category-table tr.category-row td.name-cell { white-space: nowrap; }
  #category-table tr.category-row .toggle-icon {
    display: inline-block;
    width: 1.1em;
    margin-right: .35em;
    color: #000;              /* black arrow */
    user-select: none;
  }
  /* spacer for leaves to keep alignment */
  #category-table tr.category-row.is-leaf .toggle-icon { visibility: hidden; }

  /* padding per level */
  #category-table tr.category-row[data-level="0"] td.name-cell { padding-left: .5rem; }
  #category-table tr.category-row[data-level="1"] td.name-cell { padding-left: 1.5rem; }
  #category-table tr.category-row[data-level="2"] td.name-cell { padding-left: 2.5rem; }
  #category-table tr.category-row[data-level="3"] td.name-cell { padding-left: 3.5rem; }
  #category-table tr.category-row[data-level="4"] td.name-cell { padding-left: 4.5rem; }

  #category-table tr.category-row.is-hidden { display: none; }

  #category-table tr.category-row.has-children { cursor: pointer; }

/* Landing Page Styles */
.carousel-control-prev-icon,
.carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  padding: 10px;
}

.hero-stats h3 {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.card-hover:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease-in-out;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Home: category list + product hover */
.category-list .js-cat {
  text-decoration: none;
}
.category-list .js-cat.active {
  font-weight: 600;
  color: #0d6efd;
}
.category-list .list-group-item {
  border: 0;
  padding: .5rem .75rem;
}
.category-list .list-group-item + .list-group-item {
  border-top: 1px solid rgba(0,0,0,.05);
}
.category-list .list-group-item.active,
.category-list .list-group-item:hover {
  background-color: #f8f9fa;
}
.category-list .js-cat {
  color: inherit;
}
.category-list .js-cat:hover {
  color: #0d6efd;
  text-decoration: underline;
}
.category-list .js-expand:hover {
  border-color: #0d6efd;
  color: #0d6efd;
}
.category-list .js-cat:focus,
.category-list .js-expand:focus {
  outline: 0;
  box-shadow: 0 0 0 .15rem rgba(13,110,253,.25);
}
.category-list .js-expand {
  width: 2rem;
  line-height: 1;
}
.card.h-100:hover {
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,.08);
  transform: translateY(-2px);
  transition: box-shadow .2s ease, transform .2s ease;
}

/* Full-height sidebar rail */
.sidebar-rail {
  height: 100vh;            /* full viewport height */
}
.sidebar-rail .card-body {
  max-height: calc(100vh - 56px); /* subtract card header height only */
}

/* Product grid enhancements */
.product-card .card-body .title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.product-card .price {
  font-weight: 600;
}
.product-card .store {
  font-size: .85rem;
  color: #6c757d;
}
.product-card {
  border: 1px solid rgba(0,0,0,.075);
  border-radius: .5rem;
}
.product-card .card-footer {
  background: #fff;
  border-top: 1px solid rgba(0,0,0,.075);
}
.product-empty-state {
  color: #6c757d;
}

.star-rating {
  color: #ffc107;
}

.category-icon {
  font-size: 2rem;
  color: #007bff;
  margin-bottom: 1rem;
}

.section-title {
  margin-bottom: 3rem;
}

.section-title h2 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.bg-gradient-success {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.bg-gradient-info {
  background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.hero-slide-image {
  height: 420px;            /* Adjust as preferred */
  object-fit: cover;        /* Crop to fill nicely */
}

/* Optional: darker caption shadow for readability */
.carousel-caption {
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

/* --- Sidebar Professional Enhancements --- */
.sidebar-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}
.category-list .list-group-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #0d6efd;
}
.category-list .js-toggle {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.toggle-spacer {
  display: inline-block;
  width: 2rem;
}

/* ========== REGION-SELECT ========== */
#region-select {
  background-color: white;
}
#region-select .multi-select-options {
  max-height: 350px;
}
#region-select.above .multi-select-options {
  right: auto;
  top: auto;
  bottom: 50px;
}
#region-select .multi-select-option-radio {
  border-radius: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
#region-select .multi-select-selected .multi-select-option-radio::after {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  margin: 0em;
  border: none;
  background-color: white;
  border-width: 0.2;
  transform: rotate(0deg);
  border-radius: 100%;
}
.region-select-indent-1 { margin-left: 2rem; }
.region-select-indent-2 { margin-left: 4rem; }
.region-select-indent-3 { margin-left: 6rem; }
.region-select-indent-4 { margin-left: 8rem; }
.region-select-indent-5 { margin-left: 10rem; }

/* ========== PRODUCT PAGE STYLES ========== */
.logo-small {
  max-height: 150px;
  object-fit: cover;
}
.product-small {
  max-height: 125px;
  object-fit: cover;
}
.image-md-size {
  max-height: 250px;
  object-fit: fill;
}

.description-style {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.description-max {
  max-height: 350px;
  overflow-y: auto;
}
.description-max p {
  margin-top: 10px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.text-ellipsis {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive search form - stack inputs vertically on very small screens */
@media (max-width: 500px) {
  #nav-search-form {
    padding-top: 20px;
    flex-direction: column !important;
  }
  #nav-search-form > * {
    width: 100% !important;
  }
}
