/* ========================================
   KORICHUKO – SEARCH OVERLAY DROPDOWN
   Used by: searchbox-dropdown + searchbox-*
======================================== */

/* Parent for the dropdown (input-group) */
.top-navbar .search-form .input-group,
#mobileSearchBar .input-group {
  position: relative;
}

/* Main dropdown container */
.searchbox-dropdown {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 950px;

  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  padding: 14px 18px;
  max-height: 460px;
  overflow-y: auto;
  z-index: 9999;
}

/* Sections (categories, subcategories, products) */
.searchbox-section {
  margin-bottom: 14px;
}

.searchbox-section:last-child {
  margin-bottom: 0;
}

/* Section headers */
.searchbox-header {
  font-size: 14px;
  font-weight: 600;
  color: #444;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.searchbox-header i {
  color: #2a9d8f;
}

.searchbox-header span {
  font-weight: 700;
}

/* Category/Subcategory row-style items */
.searchbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  transition: background 0.2s;
}

.searchbox-item:hover {
  background: #f8f8f8;
  text-decoration: none;
}

.searchbox-item i {
  font-size: 16px;
}

/* Subcategory info */
.searchbox-subinfo {
  display: flex;
  flex-direction: column;
}

.searchbox-subname {
  font-size: 13px;
  font-weight: 600;
}

.searchbox-parent {
  font-size: 12px;
  color: #888;
}

/* PRODUCT GRID =================================================== */

.searchbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 12px;
  justify-items: center;
  align-items: stretch;
}

/* Compact product card */
.searchbox-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
  overflow: hidden;
  width: 100%;
  max-width: 140px;
  min-height: 200px;
  color: inherit;
}

.searchbox-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

/* Image */
.searchbox-card-img {
  width: 100%;
  height: 90px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f9f9;
  border-bottom: 1px solid #eee;
}

.searchbox-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.searchbox-card:hover .searchbox-card-img img {
  transform: scale(1.05);
}

.no-img {
  font-size: 1.4rem;
  color: #cbd5e0;
}

/* Details */
.searchbox-card-details {
  flex: 1;
  padding: 6px;
  text-align: center;
}

.searchbox-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #333;
  line-height: 1.2;
  height: 30px;
  overflow: hidden;
}

.searchbox-price {
  margin-top: 4px;
  font-size: 12.5px;
}

.searchbox-price-sale {
  color: #e63946;
  font-weight: 700;
}

.searchbox-price-original {
  text-decoration: line-through;
  color: #aaa;
  font-size: 11px;
  margin-left: 4px;
}

/* Badges */
.searchbox-badge {
  font-size: 9.5px;
  padding: 2px 5px;
  border-radius: 5px;
  color: white;
  font-weight: 600;
  display: inline-block;
  margin-top: 3px;
}

.searchbox-sale {
  background: #e63946;
}

.searchbox-new {
  background: #2a9d8f;
}

/* Empty state */
.searchbox-empty {
  text-align: center;
  color: #888;
  font-size: 14px;
  padding: 18px;
}

/* Highlight match */
.searchbox-dropdown mark {
  background: #fff2ac;
  color: inherit;
  border-radius: 2px;
}

/* RESPONSIVE ========================================== */

@media (max-width: 992px) {
  .searchbox-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}

@media (max-width: 576px) {
  .searchbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .searchbox-dropdown {
    max-width: 100%;
    left: 0;
    transform: none;
    border-radius: 12px;
  }
}
