/* DOMOVSKA STRANKA */

/* Quill editor – admin formuláře */

/* Quill Snow CSS nastavuje .ql-container { height: 100% }, ale wrapper div nemá
   explicitní výšku → prohlížeč mu přiřadí 0 px a layout ho jako nulový přeskočí,
   takže se editors navzájem překrývají. !important bezpečně přebije Quill interní CSS. */
.quill-editor-sm .ql-container,
.quill-editor-lg .ql-container {
  height: auto !important;
  position: relative;
}
.quill-editor-sm .ql-editor {
  min-height: 140px;
  height: auto !important;
  box-sizing: border-box;
}
.quill-editor-lg .ql-editor {
  min-height: 320px;
  height: auto !important;
  box-sizing: border-box;
}
.quill-editor-sm .ql-toolbar,
.quill-editor-lg .ql-toolbar {
  border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
}
.quill-editor-sm .ql-container,
.quill-editor-lg .ql-container {
  border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
}

.card-cover {
  position: relative;
  background-size: cover;
  background-position: center;
  --bs-card-border-width: 0;
  border: none;
}

.card-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Oranžový přeliv (#fd5107) */
.bg-orange-overlay::before {
  background-color: rgba(253, 81, 7, 0.6);
}

/* Tmavě modrý přeliv (#002b58) */
.bg-blue-overlay::before {
  background-color: rgba(0, 43, 88, 0.6);
}

.card-cover>* {
  position: relative;
  z-index: 2;
}

.custom-navbar {
  background-color: #fff;
  /* White background */
  /* Removed bottom border here, as it's part of the content below nav */
  padding-top: 0.5rem;
  padding-bottom: 0;
  /* Remove default padding bottom to control via inner elements */
}

.custom-navbar .container-fluid {
  flex-direction: column;
  /* Stack items vertically */
  align-items: flex-start;
  /* Align content to the left */
  padding-left: 0;
  /* Adjust container padding */
  padding-right: 0;
  /* Adjust container padding */
}

.custom-navbar .navbar-top-row,
.custom-navbar .navbar-bottom-row {
  width: 100%;
  /* Ensure rows take full width */
  display: flex;
  align-items: center;
  padding: 0 1rem;
  /* Add horizontal padding back to rows */
}

.custom-navbar .navbar-top-row {
  padding-bottom: 0.5rem;
  /* Space between top and bottom rows */
  border-bottom: 1px solid #e0e0e0;
  /* Separator for the top row */
}

.custom-navbar .navbar-bottom-row {
  padding-top: 0.5rem;
  /* Space between top and bottom rows */
  padding-bottom: 0.5rem;
}

.custom-navbar .navbar-brand {
  padding-right: 15px;
  /* Space after logo/text block */
  margin-right: 0;
  /* Remove default margin */
  font-size: 1rem;
  /* Adjust brand font size */
}

.custom-navbar .navbar-brand img {
  height: 30px;
  /* Adjust as needed */
  margin-right: 10px;
}

.brand-text {
  color: #666;
  /* Lighter grey for secondary text */
  font-size: 0.9em;
  margin-left: 5px;
  white-space: nowrap;
  /* Prevent wrapping for these texts */
}

.vertical-divider {
  border-left: 1px solid #ccc;
  height: 20px;
  margin: 0 10px;
}

.custom-navbar .nav-link {
  color: #333;
  /* Darker text for links */
  font-weight: 500;
  padding: 0.5rem 1rem;
  /* Adjusted padding for lower links */
  position: relative;
  /* For the active indicator */
}

.custom-navbar .nav-link.active {
  color: #007bff;
  /* Bootstrap primary blue for active link */
}

.custom-navbar .nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  /* Adjust to sit on the border of the section below */
  height: 2px;
  background-color: #007bff;
  /* Blue line for active link */
}

.custom-navbar .navbar-nav {
  flex-wrap: wrap;
  /* Allow nav items to wrap if needed */
}

/* Adjustments for the right-aligned icon */
.custom-navbar .navbar-text {
  display: flex;
  align-items: center;
  margin-left: auto;
  /* Push to the right */
}

.custom-navbar .navbar-text img {
  height: 24px;
  /* Adjust icon size */
  width: 24px;
  border-radius: 50%;
  /* If it's a circular icon/avatar */
  border: 1px solid #ccc;
  /* Optional: subtle border */
  padding: 2px;
  /* Optional: padding inside border */
  filter: grayscale(100%);
  /* Make it grey as in the image */
}

/* Specific adjustments for responsiveness */
@media (max-width: 991.98px) {

  /* Adjust for large breakpoint (lg) for navbar-expand-lg */
  .custom-navbar .navbar-top-row,
  .custom-navbar .navbar-bottom-row {
    flex-direction: column;
    /* Stack items vertically on smaller screens */
    align-items: flex-start;
    padding: 0.5rem 1rem;
  }

  .custom-navbar .navbar-top-row {
    border-bottom: none;
    /* Remove border on smaller screens */
  }

  .custom-navbar .navbar-bottom-row {
    border-top: 1px solid #e0e0e0;
    /* Add border for collapsed content */
  }

  .custom-navbar .navbar-nav {
    width: 100%;
    margin-top: 10px;
    /* Space after toggler */
  }

  .custom-navbar .navbar-text {
    margin-left: 0;
    /* Reset margin on smaller screens */
    width: 100%;
    justify-content: flex-end;
    /* Push icon to the right within its new context */
    margin-top: 10px;
  }

  .custom-navbar .navbar-toggler {
    margin-left: auto;
    /* Push toggler to the right */
  }

  .custom-navbar .navbar-brand {
    padding-right: 0;
  }
}

@media (min-width: 992px) {
  .custom-navbar .navbar-top-row {
    justify-content: space-between;
    /* Space out items on desktop */
  }

  .custom-navbar .navbar-bottom-row .navbar-collapse {
    justify-content: flex-start;
    /* Align nav items to the left */
  }
}

/* LIST */

.sidebar {
  background-color: #f8f9fa;
  /* Světle šedé pozadí pro sidebar */
  border-right: 1px solid #e0e0e0;
  padding-top: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  /* Jemný stín */
}

.product-list {
  padding: 15px;
}

.page-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #ddd;
  text-align: center;
}

.top-navbar {
  background-color: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  padding: 15px 0;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.top-navbar .nav-link {
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  color: #555;
  transition: color 0.3s ease;
}

.top-navbar .nav-link:hover {
  color: #007bff;
}

.cookie-consent {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  background: #ffffff;
  border: 1px solid #d9dee5;
  border-radius: 0.75rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cookie-consent__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.cookie-consent__description {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: #2d343c;
}

.cookie-consent__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

@media (min-width: 768px) {
  .cookie-consent {
    left: auto;
    right: 1rem;
    max-width: 540px;
  }
}

/* Styly pro DataTables tabulku */
#vyrobkyTable {
  border-collapse: separate;
  border-spacing: 0 10px;
}

/* #vyrobkyTable thead th {
    background-color: #e9ecef;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0.75rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    font-size: 0.85em;
} */
#vyrobkyTable thead,
#dodavateleTable thead {
  display: none;
}

#vyrobkyTable tbody tr {
  background-color: #f8f9fa;
  /* Světle šedé pozadí pro řádky (karty) */
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#vyrobkyTable tbody tr:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

#vyrobkyTable tbody td {
  padding: 1.2rem 1rem;
  border: none;
  vertical-align: top;
}

/* ÚPRAVY POUZE PRO ŠÍŘKU SLOUPCŮ A ZALOMENÍ TEXTU */
#vyrobkyTable td:nth-child(1) {
  /* První sloupec: Název, výrobce, popis */
  width: 55%;
  /* Upraveno z 60% na 55% */
  white-space: normal;
  /* Povolí zalomení textu */
  word-wrap: break-word;
  /* Zajišťuje, že dlouhá slova se zalomí */
  padding-right: 1rem;
  /* Mírně menší mezera doprava */
}

#vyrobkyTable td:nth-child(2) {
  /* Druhý sloupec: Platnost a datumy */
  width: 25%;
  /* Upraveno z 20% na 25% pro více místa */
  min-width: 140px;
  /* Zajišťuje minimální šířku, aby se datumy nerozdělily nevhodně */
  white-space: nowrap;
  /* Zabrání zalomení textu u datumů */
  vertical-align: middle;
  /* Vertikální zarovnání na střed pro lepší vzhled */
}

#vyrobkyTable td:nth-child(3) {
  /* Třetí sloupec: Tlačítko Zobrazit více */
  width: 20%;
  /* Upraveno z 20% na 20% - zůstává, zbylá šířka */
  min-width: 100px;
  /* Minimální šířka pro tlačítko */
  white-space: nowrap;
  /* Zabrání zalomení textu u tlačítka */
  vertical-align: middle;
  /* Vertikální zarovnání na střed */
}

/* Pro zajištění, že text "Platnost od: / Platnost do:" se nezalamuje uvnitř druhého sloupce */
#vyrobkyTable .vyrobek-actions-cell .text-muted.small {
  white-space: nowrap;
  /* Zabrání zalomení textu uvnitř tohoto konkrétního divu */
}

/* Specifické styly pro obsah buněk */
.vyrobek-details h5 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #343a40;
  margin-bottom: 8px;
}

.vyrobek-details .description {
  font-size: 0.9em;
  color: #6c757d;
  line-height: 1.5;
  margin-bottom: 10px;
}

.vyrobek-details .meta-info {
  font-size: 0.85em;
  color: #495057;
}

.vyrobek-details .meta-info strong {
  color: #212529;
}

.vyrobek-status-cell {
  text-align: right;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
}

.vyrobek-status-cell .badge {
  font-size: 0.85em;
  padding: 0.6em 1em;
  border-radius: 50rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.vyrobek-status-cell .btn {
  font-size: 0.9em;
  padding: 0.7em 1.5em;
  border-radius: 5px;
  margin-top: 10px;
  box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
  transition: all 0.2s ease;
}

.vyrobek-status-cell .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* DataTables custom adjustments */
div.dataTables_wrapper .dataTables_filter input {
  border-radius: 5px;
  border: 1px solid #ced4da;
  padding: 0.375rem 0.75rem;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-item .page-link {
  border-radius: 5px !important;
  margin: 0 3px;
  color: #007bff;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-item.active .page-link {
  background-color: #007bff;
  border-color: #007bff;
  color: white;
}

#btn-back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  z-index: 1030;
  /* aby to nebylo schované pod navbar/footer */
}

/* Responzivní styly */
@media (max-width: 767.98px) {
  .sidebar {
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
  }

  #vyrobkyTable tbody td {
    display: block;
    width: 100% !important;
    padding: 0.8rem 1rem;
    text-align: left !important;
  }

  #vyrobkyTable tbody td:before {
    content: attr(data-label);
    float: left;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 10px;
    color: #555;
  }

  .vyrobek-status-cell {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
  }

  .vyrobek-status-cell .badge {
    margin-bottom: 0;
    margin-right: 10px;
  }

  .vyrobek-status-cell .btn {
    margin-top: 0;
  }
}


.navbar .nav-link i {
  opacity: 0.7;
}

.navbar .nav-link:hover i {
  opacity: 1;
}

/* FIX: mobilní navbar – logo + hamburger v jednom řádku */
@media (max-width: 991.98px) {
  .custom-navbar .container-fluid {
    flex-direction: row !important;
    align-items: center !important;
  }
}

/* ACCORDION */
.accordion-body {
    max-height: 500px;
    overflow-y: auto;
}

/* CHIPS */
.chip-item {
  transition: all 0.2s;
}

.chip-item:hover {
  border-color: #0d6efd !important;
  /* Bootstrap primary barva */
}

.btn-remove-chip:hover {
  color: #dc3545 !important;
  /* Červená při najetí na křížek */
}

/* SEARCH DROPDOWN */

#searchSuggestions {
    z-index: 1050;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    
    /* Dynamická šířka */
    width: max-content;     /* Roztáhni se podle nejdelšího textu */
    max-width: 100%;        /* Ale maximálně k okrajům navbaru */
    
    /* Pozicování */
    left: auto !important;  /* Zrušíme fixní vázání na levou stranu */
    right: 0 !important;    /* Zarovnáme ho k pravému okraji (pod lupu) */
    
    /* Zalamování */
    white-space: normal;
}

#searchSuggestions .dropdown-item {
    white-space: normal;    /* Povolíme zalamování uvnitř položek */
    word-wrap: break-word;
}

/* Zajistí, že našeptávač v mobilu bude nad vším ostatním v menu */
#searchSuggestionsMobile {
    z-index: 2000 !important;
    max-height: 300px; /* Aby se dalo v menu scrollovat, když je hodně výsledků */
    overflow-y: auto;
}

/* Oprava pro mobilní zobrazení - aby dropdown nebyl oříznutý */
.offcanvas-body {
    overflow-y: visible !important; 
}

/* KONEC SEARCH DROPDOWN */

  #product-page { background-color: #fff !important; color: #212529; }
  
  /* Minimalistický rozcestník */
  .product-anchor-nav {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
  }
  .product-anchor-nav a {
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
  }
  .product-anchor-nav a:hover {
    color: #004ab3;
    text-decoration: underline;
  }
  .nav-dot {
    width: 3px;
    height: 3px;
    background-color: #dee2e6;
    border-radius: 50%;
  }

  /* Odsazení pro skok */
  [id^="sekce-"] { scroll-margin-top: 25px; }

  /* Původní styly zachovány */
  .data-row {
    display: flex;
    padding: 14px 8px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
  }
  .data-row:hover { background-color: #fafafa; }
  .data-label {
    width: 280px;
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
  }
  .data-value { flex-grow: 1; font-weight: 500; }
  .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
  }
  .info-card {
    border: 1px solid #e9ecef;
    padding: 24px;
    border-radius: 12px;
    height: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  }
  .info-card h6 { letter-spacing: 1px; }

    #supplier-page { background-color: #fff !important; color: #212529; }
  
  /* Rozcestník styl */
  .product-anchor-nav {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
  }
  .product-anchor-nav a {
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
  }
  .product-anchor-nav a:hover { color: #004ab3; text-decoration: underline; }
  .nav-dot { width: 3px; height: 3px; background-color: #dee2e6; border-radius: 50%; }

  [id^="sekce-"] { scroll-margin-top: 25px; }

  /* VNITŘNÍ SCROLLING - Klíčové pro dlouhé seznamy */
  .scrollable-container {
    max-height: 550px; 
    overflow-y: auto;
    padding-right: 15px;
    border-bottom: 1px solid #f8f9fa;
  }

  /* Scrollbar design */
  .scrollable-container::-webkit-scrollbar { width: 8px; }
  .scrollable-container::-webkit-scrollbar-track { background: #f8f9fa; }
  .scrollable-container::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 10px; }
  .scrollable-container::-webkit-scrollbar-thumb:hover { background: #cbd3da; }

  .data-row {
    display: flex;
    padding: 14px 8px;
    border-bottom: 1px solid #f0f0f0;
  }
  .data-row:hover { background-color: #fafafa; }
  
  .data-label {
    width: 280px;
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
  }
  .data-value { flex-grow: 1; font-weight: 500; }

    #document-page { background-color:#fff !important; color:#212529; }

  .product-anchor-nav {
    padding:12px 0;
    border-bottom:1px solid #f0f0f0;
  }

  .product-anchor-nav a {
    color:#0d6efd;
    text-decoration:none;
    font-size:0.85rem;
    font-weight:500;
    transition:all .2s;
    display:flex;
    align-items:center;
  }

  .product-anchor-nav a:hover {
    color:#004ab3;
    text-decoration:underline;
  }

  .nav-dot {
    width:3px;
    height:3px;
    background:#dee2e6;
    border-radius:50%;
  }

  [id^="sekce-"] { scroll-margin-top:25px; }

  .scrollable-container {
    max-height:550px;
    overflow-y:auto;
    padding-right:15px;
    border-bottom:1px solid #f8f9fa;
  }

  .scrollable-container::-webkit-scrollbar { width:8px; }
  .scrollable-container::-webkit-scrollbar-track { background:#f8f9fa; }
  .scrollable-container::-webkit-scrollbar-thumb {
    background:#dee2e6;
    border-radius:10px;
  }

  .scrollable-container::-webkit-scrollbar-thumb:hover {
    background:#cbd3da;
  }

  .data-row {
    display:flex;
    padding:14px 8px;
    border-bottom:1px solid #f0f0f0;
  }

  .data-row:hover { background:#fafafa; }

  .data-label {
    width:280px;
    font-weight:600;
    color:#6c757d;
    font-size:.9rem;
    text-transform:uppercase;
    letter-spacing:.5px;
    flex-shrink:0;
  }

  .data-value {
    flex-grow:1;
    font-weight:500;
  }