/* ============================================================
   Branch / Location Selector Styles
   Clean Bootstrap-style: grey button, white menu, red accents
   ============================================================ */

/* --- Wrapper: sticky so branch selector stays on screen when scrolling --- */
.navbar-branch-wrapper {
  position: sticky;
  top: 0;
  z-index: 1020;
}

/* --- Navbar Branch Dropdown (floating, centered) --- */
.navbar-branch-selector {
  position: absolute;
  bottom: -48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1021;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Button: Bootstrap secondary-style grey */
.navbar-branch-selector .branch-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border-radius: 6px;
  border: 1px solid #ced4da;
  background: #6c757d;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
  box-shadow: none;
}

.navbar-branch-selector .branch-dropdown-toggle:hover {
  background: #5c636a;
  border-color: #565e64;
  color: #fff;
}

.navbar-branch-selector .branch-dropdown-toggle:active,
.navbar-branch-selector .branch-dropdown-toggle.show {
  background: #565e64;
  border-color: #51585e;
  color: #fff;
}

.navbar-branch-selector .branch-dropdown-toggle svg {
  width: 16px;
  height: 16px;
  opacity: 0.9;
  flex-shrink: 0;
}

.navbar-branch-selector .branch-dropdown-toggle::after {
  margin-left: 2px;
  opacity: 0.8;
}

/* --- Dropdown Menu: white card with red accents --- */
.navbar-branch-selector .branch-dropdown-menu {
  min-width: 210px;
  max-height: 340px;
  overflow-y: auto;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.15);
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 4px 0;
  margin-top: 6px !important;
}

.navbar-branch-selector .branch-dropdown-menu .dropdown-item {
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #212529;
  border-radius: 0;
}

.navbar-branch-selector .branch-dropdown-menu .dropdown-item:hover {
  background: #f8f9fa;
  color: #dc3545;
}

.navbar-branch-selector .branch-dropdown-menu .dropdown-item.active {
  background: #f8d7da;
  color: #dc3545;
  font-weight: 500;
}

.navbar-branch-selector .branch-dropdown-menu .dropdown-item.active::after {
  content: '';
  margin-left: auto;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc3545'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* --- Light navbar: outline button style --- */
.navbar-light ~ .navbar-branch-selector .branch-dropdown-toggle,
.navbar-branch-wrapper .navbar-light ~ .navbar-branch-selector .branch-dropdown-toggle {
  background: #fff;
  color: #6c757d;
  border-color: #6c757d;
}

.navbar-light ~ .navbar-branch-selector .branch-dropdown-toggle:hover,
.navbar-branch-wrapper .navbar-light ~ .navbar-branch-selector .branch-dropdown-toggle:hover {
  background: #6c757d;
  color: #fff;
}

/* --- Thin navbar variant: less overlap --- */
.navbar-branch-wrapper .navbar.py-1 ~ .navbar-branch-selector,
.navbar-branch-wrapper .navbar.py-0 ~ .navbar-branch-selector {
  bottom: -42px;
}

/* --- Mobile --- */
@media (max-width: 991.98px) {
  .navbar-branch-selector .branch-dropdown-toggle {
    width: auto;
    max-width: 320px;
  }
}

/* ============================================================
   Branch Selection Popup Modal (unchanged)
   ============================================================ */
.branch-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: branchPopupFadeIn 0.3s ease;
  padding: 1rem;
}

@keyframes branchPopupFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.branch-popup-dialog {
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem 2rem 1.75rem;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: branchPopupSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

@keyframes branchPopupSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.branch-popup-dialog .branch-popup-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: #eef2ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.branch-popup-dialog .branch-popup-icon svg {
  width: 28px;
  height: 28px;
  color: #4f46e5;
}

.branch-popup-dialog h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: #111827;
}

.branch-popup-dialog .branch-popup-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0 0 1.5rem;
}

.branch-popup-dialog .branch-popup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1.25rem;
  text-align: left;
}

.branch-popup-dialog .branch-popup-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  font-weight: 500;
  color: #374151;
  width: 100%;
}

.branch-popup-dialog .branch-popup-option:hover {
  border-color: #4f46e5;
  background: #eef2ff;
  color: #4f46e5;
  transform: translateX(2px);
}

.branch-popup-dialog .branch-popup-option svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #9ca3af;
}

.branch-popup-dialog .branch-popup-option:hover svg {
  color: #4f46e5;
}

.branch-popup-dialog .branch-popup-view-all {
  display: block;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px dashed #d1d5db;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
}

.branch-popup-dialog .branch-popup-view-all:hover {
  border-color: #9ca3af;
  color: #374151;
  background: #f9fafb;
}
