﻿/* ═══════════════════════════════════════════════════════
   Algolia full-width search overlay
   ═══════════════════════════════════════════════════════ */

/* Prevent body scroll while overlay is open */
body.algolia-overlay-open {
  overflow: hidden;
}

/* Overlay wrapper – sits above everything */
.algolia-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

/* Semi-transparent backdrop */
.algolia-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

/* White panel that slides down from the top */
.algolia-overlay-panel {
  position: relative;
  width: 100%;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  z-index: 1;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
  animation: algolia-slide-down 0.2s ease;
}

@keyframes algolia-slide-down {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ?? Top bar ?? */
.algolia-overlay-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid #e8e8e8;
}

.algolia-overlay-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 8px 16px;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
}

.algolia-overlay-search-icon {
  flex-shrink: 0;
  color: #6b7280;
  display: flex;
  align-items: center;
}

  .algolia-overlay-search-icon svg {
    width: 18px;
    height: 18px;
  }

.algolia-overlay-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: #111827;
  border: none;
}

  .algolia-overlay-input::placeholder {
    color: #9ca3af;
  }

.algolia-overlay-clear {
  cursor: pointer;
  color: #9ca3af;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

  .algolia-overlay-clear:hover {
    color: #374151;
  }

.algolia-overlay-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #6b7280;
  line-height: 1;
  padding: 4px 8px;
  flex-shrink: 0;
}

  .algolia-overlay-close:hover {
    color: #111827;
  }

/* ?? Body: three-column layout ?? */
.algolia-overlay-body {
  display: flex;
  gap: 0;
  padding: 28px 24px 32px;
  min-height: 300px;
}

/* Left promo panel */
.algolia-overlay-promo {
  flex: 0 0 240px;
  padding-right: 24px;
  border-right: 1px solid #e8e8e8;
  margin-right: 32px;
}

.algolia-overlay-promo-inner {
  background: linear-gradient(145deg, #1a3a5c 0%, #0d2240 100%);
  border-radius: 12px;
  padding: 32px 24px;
  color: #fff;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 200px;
}

.algolia-overlay-promo-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #ffffff;
}

.algolia-overlay-promo-btn {
  display: inline-block;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

  .algolia-overlay-promo-btn:hover {
    background: #fff;
    color: #1a3a5c;
    text-decoration: none;
  }

/* Centre results column */
.algolia-overlay-results-col {
  flex: 1;
  min-width: 0;
  padding-right: 32px;
  border-right: 1px solid #e8e8e8;
  margin-right: 32px;
}

/* Right categories column */
.algolia-overlay-categories-col {
  flex: 0 0 425px;
}

/* ?? Section titles ?? */
.algolia-overlay-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000;
  margin: 0 0 14px;
}

/* ?? Product list ?? */
.algolia-overlay-product-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.algolia-overlay-product-item a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}

  .algolia-overlay-product-item a:hover {
    background: #f9fafb;
  }

.algolia-overlay-product-img {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

  .algolia-overlay-product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

.algolia-overlay-product-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.algolia-overlay-product-name {
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.5;
  max-width: 365px;
  text-align: left;
  margin-bottom: 5px;
}

.algolia-overlay-product-price {
  font-size: 15px;
  font-weight: 700;
  color: #000;
  line-height: 1;
  text-align: left;
}

.algolia-overlay-product-inclgst {
  font-size: 10px;
  font-weight: 400;
  color: #000;
  margin-left: 3px;
  vertical-align: middle;
  padding-left: 5px !important;
}

.algolia-overlay-loading,
.algolia-overlay-no-results {
  padding: 10px 8px;
  color: #9ca3af;
  font-size: 14px;
}

/* "See all results" button */
.algolia-overlay-see-all {
  display: block;
  margin: 16px auto 0;
  width: fit-content;
  padding: 10px 24px;
  background: #1a3a5c;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  text-align: center;
  transition: background 0.15s;
}

  .algolia-overlay-see-all:hover {
    background: #0d2240;
    color: #fff;
    text-decoration: none;
  }

/* ── Related categories (right column, replaces top-cats during live search) ── */
.algolia-overlay-related-cats {
  width: 100%;
  text-align: left;
}

.algolia-overlay-related-cats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  gap: 35px;
}

  .algolia-overlay-related-cats-list li a {
    font-size: 15px;
    color: #000;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: color 0.12s;
  }

    .algolia-overlay-related-cats-list li a:hover {
      color: #000;
      text-decoration: underline;
    }

/* ?? Category list ?? */
.algolia-overlay-category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

  .algolia-overlay-category-list li a {
    font-size: 15px;
    color: #000;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: color 0.12s;
  }

    .algolia-overlay-category-list li a:hover {
      color: #000;
      text-decoration: underline;
    }

/* ?? Responsive ?? */
@media (max-width: 768px) {
  .algolia-overlay-body {
    flex-direction: column;
    padding: 20px 16px 24px;
  }

  .algolia-overlay-promo {
    flex: none;
    border-right: none;
    border-bottom: 1px solid #e8e8e8;
    margin-right: 0;
    margin-bottom: 20px;
    padding-right: 0;
    padding-bottom: 20px;
  }

  .algolia-overlay-results-col {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 20px;
    margin-bottom: 20px;
  }

  .algolia-overlay-categories-col {
    flex: none;
  }

  .algolia-overlay-topbar {
    padding: 14px 16px;
  }
}

/* ????????????????????????????????????????????????????????
   Legacy autocomplete styles (kept for fallback pages)
   ???????????????????????????????????????????????????????? */
.aa-dropdown-menu {
  position: relative;
  top: -6px;
  border-radius: 3px;
  margin: 6px 0 0;
  padding: 0;
  text-align: left;
  height: auto;
  background: white;
  border: none;
  width: 100%;
  left: 0 !important;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2), 0 2px 3px 0 rgba(0, 0, 0, 0.1);
}

  .aa-dropdown-menu:before {
    position: absolute;
    content: '';
    width: 14px;
    height: 14px;
    background: #fff;
    top: -7px;
    border-top: 1px solid #D9D9D9;
    border-right: 1px solid #D9D9D9;
    transform: rotate(-45deg);
    border-radius: 2px;
    z-index: 999;
    display: block;
    left: 24px;
  }

  .aa-dropdown-menu .aa-suggestions {
    position: relative;
    z-index: 1000;
  }

  .aa-dropdown-menu [class^="aa-dataset-"] {
    position: relative;
    border: solid 1px #D9D9D9;
    border-radius: 3px;
    overflow: auto;
    padding: 8px 8px 8px;
  }

  .aa-dropdown-menu * {
    box-sizing: border-box;
  }

.aa-suggestion {
  font-size: 1.1em;
  padding: 4px 4px 0;
  display: block;
  width: 100%;
  height: 38px;
  clear: both;
}

.aa-suggestions {
  width: 100% !important;
}

.aa-dataset-1 {
  padding: 2px 3px !important;
}

.aa-suggestion span {
  white-space: nowrap !important;
  text-overflow: ellipsis;
  overflow: hidden;
  display: block;
  float: left;
  line-height: 2em;
  width: 100%;
  cursor: pointer;
}

.aa-suggestion.aa-cursor {
  background: #eee;
}

.aa-suggestion em, .no-result em {
  color: #4098CE;
  font-style: normal;
}

.aa-suggestion img {
  float: left;
  vertical-align: middle;
  height: 30px;
  width: 20px;
  margin-right: 6px;
}

#small-search-box-form span {
  float: left;
}

.branding {
  text-align: center;
  width: 100%;
  font-size: 12px;
  padding: 2px;
}

  .branding img {
    height: 12px;
    display: inline-block;
    position: absolute;
    margin: 2px;
  }

.no-result {
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fbfd 0%, #f3f6f9 100%);
  border: 1px solid #e1e8ef;
  color: #425466;
}

.no-result-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.no-result-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f1fb;
  color: #2f6fad;
}

  .no-result-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
  }

.no-result-copy {
  min-width: 0;
}

.no-result-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2933;
  margin-bottom: 6px;
}

.no-result-query {
  font-size: 14px;
  margin-bottom: 8px;
}

.no-result-help {
  font-size: 12px;
  line-height: 1.5;
  color: #6b7c93;
  margin-top: 10px;
}

.no-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.no-result-action {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d7e2ec;
  color: #486581;
  font-size: 12px;
  font-weight: 500;
}
