html {
  font-size: 18px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Navigation pin/unpin styles */
/* When force-collapsed class is applied, always show hamburger menu */
.navbar.force-collapsed .navbar-toggler,
html.nav-force-collapsed .navbar .navbar-toggler {
  display: block !important;
}

.navbar.force-collapsed .navbar-collapse,
html.nav-force-collapsed .navbar .navbar-collapse {
  display: none !important;
}

.navbar.force-collapsed .navbar-collapse.show,
html.nav-force-collapsed .navbar .navbar-collapse.show {
  display: block !important;
}

/* Pin button styling */
#navPinToggleMobile,
#navPinToggleDesktop {
  font-size: 1rem;
  line-height: 1;
  border: none;
  background: transparent;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

#navPinToggleMobile:hover,
#navPinToggleDesktop:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 0.25rem;
}

#navPinToggleMobile:focus,
#navPinToggleDesktop:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(37, 140, 251, 0.25);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Mobile: Prevent auto-zoom on input focus */
/* iOS Safari and other mobile browsers auto-zoom when input font-size < 16px */
@media (max-width: 768px) {
  input,
  select,
  textarea,
  .form-control,
  .form-control-sm,
  .form-select,
  .form-select-sm,
  .ck-editor__editable,
  .ck-content {
    font-size: 16px !important;
  }

  /* Make (BETA) badge 40% smaller on mobile */
  .beta-badge {
    font-size: 0.6em;
  }
}

/* Keyboard-navigable dropdowns: highlight the focused item the same way hover does */
.dropdown-menu .dropdown-item:focus {
  color: var(--bs-dropdown-link-hover-color);
  background-color: var(--bs-dropdown-link-hover-bg);
  outline: none;
}

/* Custom autocomplete dropdown — uses .autocomplete-dropdown/.autocomplete-option instead of
   Bootstrap's .dropdown-menu/.dropdown-item to avoid Bootstrap dropdown.js keyboard handler conflicts */
.autocomplete-dropdown {
  position: absolute;
  z-index: 1000;
  display: none;
  min-width: 100%;
  padding: 0.5rem 0;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.175);
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}
.autocomplete-dropdown.show {
  display: block;
}
.autocomplete-option {
  display: block;
  width: 100%;
  padding: 0.25rem 1rem;
  clear: both;
  font-weight: 400;
  color: #212529;
  text-align: inherit;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  cursor: pointer;
}
.autocomplete-option:hover,
.autocomplete-option:focus,
.autocomplete-option.active {
  color: #1e2125;
  background-color: #e9ecef;
  outline: none;
}
.autocomplete-option.text-muted {
  pointer-events: none;
  cursor: default;
}
/* ── Global Search Typeahead ──────────────────────────────────────────────── */
.gs-suggest-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background: #fff;
  border: 1px solid rgba(0,0,0,.15);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  overflow: hidden;
}
.gs-suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  text-decoration: none;
  color: #212529;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.gs-suggest-item:hover,
.gs-suggest-item.active {
  background: #f0f4ff;
  color: #212529;
}
.gs-suggest-item + .gs-suggest-item {
  border-top: 1px solid #f0f0f0;
}
.gs-suggest-thumb {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 4px;
  object-fit: contain;
  background: #f8f9fa;
}
.gs-suggest-thumb-placeholder {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 4px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 14px;
}
.gs-suggest-text {
  flex: 1;
  min-width: 0;
}
.gs-suggest-name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}
.gs-suggest-subtitle {
  font-size: 0.75rem;
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-suggest-not-found {
  font-size: 0.875rem;
  color: #6c757d;
  font-style: italic;
  cursor: default;
  pointer-events: none;
}
.gs-suggest-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  background: #e9ecef;
  border-radius: 3px;
  padding: 2px 6px;
  white-space: nowrap;
  align-self: center;
  flex-shrink: 0;
  margin-left: 8px;
}
.gs-suggest-header {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c757d;
  padding: 6px 12px 4px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  cursor: default;
  pointer-events: none;
}

/* ── Product Card: compact dropdown variant ──────────────────────────────── */
.gs-suggest-thumb.pc-book-thumb,
.gs-suggest-thumb-placeholder.pc-book-thumb {
  width: 60px;
  height: 84px;
  object-fit: cover;
}
.gs-suggest-detail {
  font-size: 0.7rem;
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Product Card: horizontal scroll container (shared) ──────────────────── */
.results-scroll-container {
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  user-select: none;
}
.results-scroll-container::-webkit-scrollbar { display: none; }
.results-scroll-container.dragging { cursor: grabbing; }
.results-scroll-container.dragging .pf-card-inner { box-shadow: none !important; }
.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.9);
  border: 1px solid #dee2e6;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
  transition: all .2s;
  padding: 0;
}
.scroll-arrow:hover:not(.disabled) { background: #fff; box-shadow: 0 4px 8px rgba(0,0,0,.15); }
.scroll-arrow.disabled { cursor: not-allowed; background: rgba(255,255,255,.5); }
.scroll-arrow.disabled i { color: #adb5bd; }
