:root {
  --bst-mtt-color-primary: #90ccdb;
  --bst-mtt-color-secondary: #ffffff;
  --bst-mtt-color-text: #191919;
  --bst-mtt-color-accent: #f0f5f9;
  --bst-mtt-color-red: #de3c2b;
  --bst-mtt-color-blue: #06aee7;
  --bst-mtt-color-purple: #672f8a;
  --bst-mtt-color-orange: #f9913b;
  --bst-mtt-color-dim: #ffffff00;
  --bst-mtt-color-focus: #90ccdb3b;

  --bst-mtt-font: "Plus Jakarta Sans", sans-serif;
  --bst-mtt-light-font-weight: 200;
  --bst-mtt-normal-font-weight: 400;
  --bst-mtt-semibold-font-weight: 600;
  --bst-mtt-bold-font-weight: 800;
  --bst-mtt-normal-font-style: normal;

  --bst-mtt-h1: 2rem;
  --bst-mtt-h2: 1.75rem;
  --bst-mtt-h3: 1.2rem;
  --bst-mtt-p: 1rem;
  --bst-mtt-pb: 0.9rem;

  --bst-mtt-border-radius: 1rem;
  --bst-mtt-box-shadow: 0 2px 6px rgba(37, 83, 185, 0.1);
}

body {
  background-color: var(--bst-mtt-color-accent);
}

.text-dark {
  color: var(--bst-mtt-color-text) !important;
}

/* .sortofheader,
.sortofwfheader {
  padding-right: 1rem;
  display: flex;
}

.sortofheader {
  padding-left: 5.5rem;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  height: calc(3rem + 2.5vh);
}

.sortofwfheader {
  flex-direction: column;
  justify-content: center;
}

.inner-content {
  display: flex;
  padding-left: 4.9rem;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: stretch;
  margin-bottom: 5rem;
} */

.two-distance-elements,
.two-distance-elements-h {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: nowrap;
  justify-content: space-between;
}

.two-distance-elements-h {
  height: calc(3rem + 2.5vh);
}

.two-near-items {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  column-gap: 0.5rem !important;
}

.i-in-content,
.sort-table {
  color: var(--bst-mtt-color-text);
  cursor: pointer;
}

.i-in-content {
  font-size: var(--bst-mtt-p);
  display: flex;
  align-items: center;
}

.i-in-content:hover,
.sort-table:hover {
  color: var(--bst-mtt-color-accent);
}

.list-border-settings {
  border-bottom: 1px;
  border-left: 0;
  border-right: 0;
  border-radius: 0 !important;
}

.title-row-category {
  display: flex;
  padding-left: 0.5rem;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bst-mtt-color-accent);
  height: calc(2rem + 2.5vh);
  padding-right: 1rem;
  border-color: var(--bst-mtt-color-accent) !important;
  border-top: 1px solid;
}

.title-category {
  font-size: var(--bst-mtt-h3);
  margin: 0 !important;
  padding: 0 !important;
  height: auto;
  font-weight: var(--bst-mtt-bold-font-weight);
  color: var(--bst-mtt-color-text);
  text-transform: capitalize;
}

.title-table-category {
  font-size: var(--bst-mtt-text);
  height: auto;
  font-weight: var(--bst-mtt-bold-font-weight);
  color: var(--bst-mtt-color-text);
  line-height: var(--bst-mtt-h2);
}

.page-title {
  font-size: var(--bst-mtt-h1);
  margin: 0 !important;
  padding: 0 !important;
  height: auto;
  font-weight: var(--bst-mtt-bold-font-weight);
  color: var(--bst-mtt-color-text);
}

.table thead th {
  border-bottom: 0;
  background-color: var(--bst-mtt-color-primary);
  padding: 1rem 1.5rem;
}

td {
  font-weight: var(--bst-mtt-light-font-weight);
  font-size: var(--bst-mtt-p);
  line-height: var(--bst-mtt-h2);
  /* padding: 1.5rem 1.5rem !important; */
}

th {
  /* padding: 1.5rem 1.5rem !important; */
}

li {
  font-weight: var(--bst-mtt-light-font-weight);
  font-size: var(--bst-mtt-p);
}

a {
  color: var(--bst-mtt-color-accent);
}

a:hover {
  color: var(--bst-mtt-color-blue);
}

.default-button,
.default-button-light,
.default-button-dark {
  display: flex;
  align-items: center;
  column-gap: 0.5rem;
  font-size: var(--bst-mtt-pb);
  font-weight: var(--bst-mtt-light-font-weight);
}

.default-button-light {
  color: var(--bst-mtt-color-text) !important;
  background-color: var(--bst-mtt-color-dim) !important;
  border-color: var(--bst-mtt-color-text) !important;
}

.default-button-dark {
  color: var(--bst-mtt-color-secondary) !important;
  background-color: var(--bst-mtt-color-accent) !important;
  border-color: var(--bst-mtt-color-accent) !important;
}

.default-button-light:hover,
.default-button-dark:hover,
.default-button-light:active,
.default-button-dark:active,
.default-button-light:focus,
.default-button-dark:focus {
  border-color: var(--bst-mtt-color-blue) !important;
  color: var(--bst-mtt-color-secondary) !important;
  background-color: var(--bst-mtt-color-blue) !important;
}
.default-button-light:focus,
.default-button-dark:focus,
.form-check-input:focus,
.form-check-input:checked:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--bst-mtt-color-accent);
  box-shadow: 0 0 0 0.25rem var(--bst-mtt-color-accentshadowfocus);
}

.btn.show {
  background-color: var(--bst-mtt-color-blue);
  border-color: var(--bst-mtt-color-blue);
}

.btn-close:focus {
  box-shadow: 0 0 0 0.25rem var(--bst-mtt-color-accentshadowfocus);
}

.form-check-input,
.form-control {
  border-color: #888;
  color: var(--bst-mtt-color-text);
}

.form-check-input:checked,
.form-control:checked {
  background-color: var(--bst-mtt-color-accent);
  border-color: var(--bst-mtt-color-accent);
}

.page-link,
.page-link:hover,
.page-link:focus {
  color: var(--bst-mtt-color-primary);
}

.page-link:hover,
.page-link:focus {
  background-color: var(--bst-mtt-color-primary);
  color: var(--bst-mtt-color-secondary);
  box-shadow: none;
}

.page-item.active .page-link {
  color: var(--bst-mtt-color-secondary) !important;
  background-color: var(--bst-mtt-color-primary) !important;
  border-color: var(--bst-mtt-color-primary);
}

.extra-inner-content {
  margin: 0.5rem !important;
  row-gap: 1.5rem;
}

.form-check-inline {
  margin-bottom: 1rem;
}

.dropdown-item,
.dropdown-item:focus,
.dropdown-item:hover {
  color: var(--bst-mtt-color-text);
}

.dropdown-item:focus,
.dropdown-item:hover {
  background-color: var(--bst-mtt-color-accent);
}

.dropdown-item.active,
.dropdown-item:active {
  color: var(--bst-mtt-color-secondary);
  background-color: var(--bst-mtt-color-accent);
}

.toast {
  border-color: var(--bst-mtt-color-accent) !important;
}

.toast-header {
  color: var(--bst-mtt-color-accent) !important;
  border-color: var(--bst-mtt-color-accent) !important;
}

/* Select2 Bootstrap 5 Theme */

.select2-container--bootstrap-5
  .select2-dropdown
  .select2-results__options
  .select2-results__option.select2-results__option--selected,
.select2-container--bootstrap-5
  .select2-dropdown
  .select2-results__options
  .select2-results__option.select2-results__option--highlighted {
  color: var(--bst-mtt-color-secondary) !important;
  background-color: var(--bst-mtt-color-accent) !important;
}

.select2-container--bootstrap-5.select2-container--open .select2-selection {
  border-color: var(--bst-mtt-color-accent) !important;
  box-shadow: 0 0 0 0.15rem var(--bst-mtt-color-focus) !important;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-search__field:focus {
  border-color: var(--bst-mtt-color-accent) !important;
  box-shadow: 0 0 0 0.25rem var(--bst-mtt-color-focus) !important;
}

.select2-container--bootstrap-5 .select2-dropdown {
  border-color: var(--bst-mtt-color-accent) !important;
}

.select2-container--bootstrap-5
  .select2-selection--multiple
  .select2-search
  .select2-search__field {
  box-shadow: none !important;
}

.select2-container--bootstrap-5
  .select2-selection--multiple
  .select2-selection__rendered
  .select2-selection__choice {
  border-color: var(--bst-mtt-color-secondary) !important;
  color: var(--bst-mtt-color-text) !important;
}

.select2-container--bootstrap-5 .select2-selection {
  border-color: var(--bst-mtt-color-accent) !important;
}

/* SIDEBAR + NAV */

/* Layout container */
.wrapper {
  display: flex;
}

/* Main content area */
#main-content {
  flex-grow: 1;
  max-width: 1250px;
  margin: 0 auto;
  padding: 20px;
  transition: all 0.3s ease-in-out;
}

/* --- Mobile-specific behavior (screen width < 992px) --- */
@media (max-width: 991px) {
  /*
   * This rule targets the main content wrapper on mobile.
   * We add padding here to prevent content from touching the screen edges.
   */
  #main-content {
    padding-top: 60px;
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
  }

  /* On mobile, if the sidebar is open, hide the button to avoid clutter */
  .sidebar-open .sidebar-toggle-button {
    transform: translateX(250px);
    opacity: 0;
  }

  /* On mobile, the button sits in the top-left corner */
  .sidebar-toggle-button {
    left: 20px;
  }

  /* --- NEW RULES FOR NOLEGGIO PAGE --- */

  /* Make form inputs take full width */
  .form-row .form-group {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }

  /* Make the Kayak list responsive */
  .lista-singola li {
    flex-direction: column;
    height: auto;
    padding: 10px;
    align-items: flex-start;
  }

  .lista-singola li > div {
    white-space: normal;
    text-align: left !important;
    margin-bottom: 5px;
  }
}

/* Main content responsive */
@media (max-width: 1330px) and (min-width: 992px) {
  #main-content {
    margin: 0 0 auto 3rem;
  }
}

/* Sticky Sidebar and Nav */
/* .stickysidenav {
  position: sticky;
  position: -webkit-sticky;
  top: 1rem;
  z-index: 999;
}

.nav {
  box-shadow: var(--bst-mtt-box-shadow);
  border-radius: var(--bst-mtt-border-radius);
  background: var(--bst-mtt-color-secondary);
}

.nav-item {
  color: var(--bst-mtt-color-text);
}

.nav-item:hover {
  background-color: var(--bst-mtt-color-primary);
  border-radius: 1rem;
  color: var(--bst-mtt-color-secondary);
}

.nav-link:hover,
.nav-link:focus {
  border-color: var(--bst-mtt-color-dim) !important;
} */

/* End Nav Style */

.sidebar-toggle-button {
  position: fixed;
  top: 20px;
  z-index: 1050; /* High z-index to stay on top of everything */
  background-color: var(--bst-mtt-color-secondary);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--bst-mtt-color-text);
  box-shadow: var(--bst-mtt-box-shadow);
  transition: all 0.3s ease-in-out;
  cursor: pointer;
}

.sidebar-toggle-button {
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sidebar-toggle-button:hover {
  background-color: var(--bst-mtt-color-primary);
  color: var(--bst-mtt-color-secondary);
  transform: scale(1.1) rotate(180deg);
}

/* --- Desktop-specific behavior (screen width > 991px) --- */
@media (min-width: 992px) {
  /* By default (sidebar open), position the button just outside the sidebar */
  .sidebar-toggle-button {
    left: 280px; /* 250px sidebar width + 20px margin */
  }

  /* When sidebar is collapsed, move button to the left */
  .sidebar-collapsed .sidebar-toggle-button {
    left: 100px; /* 60px collapsed sidebar width + 20px margin */
  }
}

/* --- Mobile-specific behavior (screen width < 992px) --- */
@media (max-width: 991px) {
  /* On mobile, the button sits in the top-left corner */
  .sidebar-toggle-button {
    left: 20px;
  }

  /* When the mobile sidebar is open, hide the button to avoid clutter */
  .sidebar-open .sidebar-toggle-button {
    transform: translateX(250px); /* Slide it off-screen with the sidebar */
    opacity: 0;
  }
}

#sidebar {
  width: 250px;
  overflow-y: auto; /* Make sidebar scrollable */
  overflow-x: hidden;
  background: var(--bst-mtt-color-secondary);
  color: var(--bst-mtt-color-text);
  transition: all 0.3s ease-in-out;
  height: 90vh; /* Ensure the sidebar is within the screen height */
  box-shadow: var(--bst-mtt-box-shadow);
  border-radius: var(--bst-mtt-border-radius);
}

/* Style the scrollbar track */
#sidebar::-webkit-scrollbar {
  width: 12px; /* Makes the scrollbar thinner */
  border-radius: 8px; /* Round the scrollbar track */
}

/* Style the scrollbar thumb (the draggable part) */
#sidebar::-webkit-scrollbar-thumb {
  background-color: var(--bst-mtt-color-primary);
  border-radius: 8px; /* Round the thumb */
  border: 3px solid var(--bst-mtt-color-secondary); /* Optional: Adds a border around the thumb */
}

/* Style the scrollbar when hovered */
#sidebar::-webkit-scrollbar-thumb:hover {
  background-color: var(--bst-mtt-color-secondary); /* Darker color on hover */
}

/* Style the scrollbar when active (dragging) */
#sidebar::-webkit-scrollbar-thumb:active {
  background-color: var(--bst-mtt-color-primary);
}

/* When hovering over the sidebar, use the full logo */
#sidebar:hover img.logo-sidebar,
img.logo-sidebar {
  content: url("/img/logo.png");
  width: 10rem !important;
  min-height: 7rem !important;
  object-fit: contain;
  padding: 0.5rem 1rem 0.5rem 1.2rem;
}

.sidebar-collapsed img.logo-sidebar {
  content: url("/img/logo-smaller.png"); /* Change the image when collapsed */
  min-height: 7rem !important;
  object-fit: contain !important;
  padding: 0.5rem 1rem 0.5rem 1.2rem !important;
  width: 3.75rem !important;
}

.link-nav-list {
  text-decoration: none;
  column-gap: 1rem !important;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  color: var(--bst-mtt-color-text);
  font-size: var(--bst-mtt-h3);
}

.link-nav-list:hover {
  text-decoration: none;
}

.li-nav-list {
  position: relative;
  overflow: hidden; /* Ensures the effect stays within bounds */
  width: 90%;
  border-radius: 0 1rem 1rem 0;
  transition: color 0.3s ease-in-out; /* Smooth text color transition */
  padding: 0.5rem 1rem 0.5rem 1.2rem;
  margin: 0.5rem 0;
  z-index: 0 !important;
}

/* Create the sliding background effect */
.li-nav-list::before,
.li-nav-list:focus {
  content: "";
  position: absolute;
  top: 0;
  left: -100%; /* Start position: fully outside (left) */
  width: 100%;
  height: 100%;
  background-color: var(--bst-mtt-color-primary) !important;
  transition: left 0.3s ease-in-out;
  z-index: -1; /* Ensures background is behind text */
}

.li-nav-list:hover::before {
  left: 0; /* Moves background in from left to right */
}

.li-nav-list:hover a {
  color: var(--bst-mtt-color-secondary) !important;
}

/* Mobile view: Sidebar should overlay content */
@media (max-width: 991px) {
  .wrapper {
    position: relative;
  }

  #sidebar {
    position: fixed;
    left: -250px;
    top: 0;
    height: 100%;
    z-index: 1000;
    border-radius: 0;
    overflow: auto; /* Make sidebar scrollable */
    max-height: 100vh; /* Make sure sidebar doesn't overflow screen vertically */
  }

  /* Prevent page scrolling when sidebar is open */
  .sidebar-open body {
    overflow: hidden; /* Prevent page scrolling */
  }

  /* Prevent main content from scrolling when sidebar is open on mobile */
  .sidebar-open #main-content {
    overflow: hidden; /* Prevent scrolling of content */
  }

  /* Show close button in mobile */
  .sidebar-open #closeSidebar {
    display: block;
  }

  /* Sidebar open */
  .sidebar-open #sidebar {
    left: 0;
  }

  /* Overlay effect */
  .sidebar-open::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
}

/* Close button (only for mobile/tablet) */
#closeSidebar {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  color: var(--bst-mtt-color-text);
  background: none;
  border: none;
  display: none;
}

.sidebar-collapsed #sidebar {
  width: 60px; /* Keep only icons visible */
}

.sidebar-collapsed #sidebar .links_name {
  display: inline-block; /* Show page name when collapsed */
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

/* .sidebar-collapsed #sidebar:hover {
  width: 250px;
}

.sidebar-collapsed #sidebar:hover .links_name {
  opacity: 1; 
}

@media (max-width: 991px) {
  .sidebar-collapsed #sidebar:hover {
    width: 60px;
  }
} */

/* ============================================= */
/* === STYLING FOR ITEM/KAYAK SELECTION LIST === */
/* ============================================= */

/* Main container for the list */
.item-list-container {
  border: 1px solid #dee2e6; /* A softer bootstrap-like border color */
  border-radius: var(--bst-mtt-border-radius, 0.5rem);
  background-color: var(--bst-mtt-color-secondary, #ffffff);
  box-shadow: var(--bst-mtt-box-shadow, 0 2px 6px rgba(0, 0, 0, 0.1));
  margin-bottom: 1rem;
  /* REMOVED fixed height and overflow. The list now grows naturally. */
}

.item-list {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

/* Individual list item row */
.item-list-row {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
  gap: 1rem; /* Creates space between columns */
}

.item-list li:last-child {
  border-bottom: none; /* No border on the last item */
}

/* Column layout for desktop */
.item-name {
  flex-grow: 1; /* Allows the name to take up most of the space */
  font-weight: 600;
}

.item-price {
  flex-shrink: 0; /* Prevents the price from shrinking */
  width: 80px;
  text-align: center;
  font-size: 1.1rem;
}

.item-quantity {
  flex-shrink: 0; /* Prevents the quantity controls from shrinking */
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 120px;
  text-align: center;
}

/* Interactive quantity buttons */
.quantity-value {
  font-size: 1.2rem;
  font-weight: bold;
}

.quantity-button {
  font-size: 1.5rem; /* Larger, easier to click icons */
  color: var(--bst-mtt-color-text, #333);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: all 0.2s ease-in-out;
}

.quantity-button:hover {
  background-color: var(--bst-mtt-color-primary, #90ccdb);
  color: var(--bst-mtt-color-secondary, #ffffff);
  transform: scale(1.1);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
  .item-list-row {
    flex-direction: column; /* Stack elements vertically */
    align-items: flex-start; /* Align all to the left */
    gap: 0.5rem; /* Reduce the gap for stacked layout */
  }

  /* On mobile, make columns full-width and adjust text */
  .item-name,
  .item-price,
  .item-quantity {
    width: 100%;
    text-align: left;
  }

  .item-price {
    font-size: 1rem;
    color: #6c757d; /* Make price less prominent */
  }

  .item-quantity {
    justify-content: flex-start; /* Align buttons to the left */
    gap: 1.5rem; /* Add space between buttons on mobile */
    padding-top: 0.5rem;
  }
}

/* ============================================= */
/* === STYLING FOR RESPONSIVE RENTALS TABLE === */
/* ============================================= */

/* General styling for a cleaner table on desktop */
.stylish-table {
  width: 100%;
  border-collapse: collapse;
}

.stylish-table th {
  background-color: transparent; /* Use card header background */
  font-weight: 600;
  text-align: left;
  padding: 1rem;
}

.stylish-table td {
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
  vertical-align: middle;
}

.stylish-table tbody tr:last-child td {
  border-bottom: none;
}

.stylish-table td a {
  font-size: 1.25rem;
}

.help-icons {
  display: flex;
  align-items: center;
  gap: 1.25rem; /* This now controls the space between the two icons */
}

/* --- Mobile Responsiveness (The Card Transformation) --- */
@media (max-width: 768px) {
  /* Hide the original table headers */
  .stylish-table thead {
    display: none;
  }

  /* Make table elements stack like blocks */
  .stylish-table,
  .stylish-table tbody,
  .stylish-table tr,
  .stylish-table td {
    display: block;
    width: 100%;
  }

  /* Each table row becomes a "card" */
  .stylish-table tr {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: var(--bst-mtt-border-radius, 0.5rem);
    padding: 0.5rem;
  }

  /* Each table cell becomes a row with a label */
  .stylish-table td {
    display: flex;
    justify-content: space-between; /* Pushes label and value apart */
    align-items: center;
    text-align: right; /* Aligns the data value to the right */
    padding: 0.75rem;
    border-bottom: 1px dashed #e9ecef;
  }

  .stylish-table td:last-child {
    border-bottom: none;
  }

  /* Use the data-label attribute to create a label */
  .stylish-table td::before {
    content: attr(data-label);
    font-weight: 600;
    text-align: left;
    margin-right: 1rem;
  }
}

/* ============================================= */
/* === STYLING FOR ACCORDION FORM & SERVICE LIST === */
/* ============================================= */

/* Add consistent vertical spacing for cards in the new dashboard layout */
.card {
  margin-bottom: 1.5rem;
}

.text-bg-primary {
  background-color: var(--bst-mtt-color-blue) !important;
}
