/* =======================================================
   SEARCH MODAL (Fullscreen search)
======================================================== */
.search-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #fff;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: 0.4s;
}
.search-modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-modal-container {
  width: 95%;
  max-width: 1300px;
  position: relative;
  text-align: left;
  margin-bottom: 50px;
}

.search-close-btn {
  position: absolute;
  top: -100px; right: 0;
  background: none;
  border: none;
  font-size: 40px;
  cursor: pointer;
}

.search-modal-form {
  display: flex;
  border-bottom: 2px solid #16283A;
  padding: 10px 0;
}
.search-modal-form input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
}
.search-modal-form button {
  background: none;
  border: none;
  cursor: pointer;
}

.search-suggestions,
.search-suggestions-text {
  margin-top: 20px;
  font-size: 14px;
  color: #5A6B7B;
}
.search-suggestions a,
.search-suggestions-text a {
  margin-left: 15px;
  color: #16283A;
  text-decoration: underline;
}

/* ----- Lưới sản phẩm gợi ý ----- */
.suggested-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 30px 0 15px;
}

.suggested-grid {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 15px !important;
  width: 100%;
}

.suggested-product-card {
  display: block;
  text-decoration: none;
  text-align: left !important;
}

.spc-image {
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 10px;
  aspect-ratio: 3/4;
  background: #f5f5f5;
  width: 100%;
}
.spc-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.suggested-product-card:hover .spc-image img {
  transform: scale(1.05);
}

.spc-name {
  font-size: 13px;
  color: #16283A;
  margin-bottom: 5px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.spc-price {
  font-size: 14px;
  font-weight: 700;
  color: #16283A;
}

/* ----- Mobile ----- */
@media (max-width: 768px) {
  .search-modal { padding-top: 50px; }
  .search-close-btn { top: -40px; font-size: 35px; }
  .search-modal-form input { font-size: 16px; }

  .search-suggestions-text {
    font-size: 11px;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .search-suggestions-text a {
    margin-left: 0;
    padding: 4px 10px;
    background: #f5f5f5;
    border-radius: 20px;
  }

  .suggested-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  .suggested-title { font-size: 12px; margin-bottom: 10px; }
  .spc-image { margin-bottom: 6px; }
  .spc-name { font-size: 10px; margin-bottom: 2px; }
  .spc-price { font-size: 11px; }
}

/* ----- Loading giá ----- */
.price-loading {
  display: inline-block;
  width: 70px;
  height: 14px;
  background: linear-gradient(90deg, #eee 25%, #ddd 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite ease-in-out;
  border-radius: 3px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =======================================================
   SEARCH V2 — kết quả mở rộng, chip chất liệu, highlight
======================================================== */
.spc-image { position: relative; }

.spc-mat {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #16283A;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  pointer-events: none;
}

.spc-soldout {
  position: absolute;
  top: 8px; left: 8px;
  background: #16283A;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  pointer-events: none;
}

.spc-meta {
  font-size: 11px;
  color: #5A6B7B;
  margin: 0 0 4px;
}

.spc-hl {
  background: #D8F0FC;
  color: #0A7FD9;
  border-radius: 2px;
  padding: 0 1px;
}

.spc-compare {
  font-size: 11px;
  font-weight: 400;
  color: #9AA7B3;
  margin-left: 4px;
}

.search-empty {
  grid-column: 1 / -1;
  padding: 20px 0;
  color: #5A6B7B;
  font-size: 13px;
}

.search-more-wrap {
  text-align: center;
  margin-top: 24px;
}
.search-more-btn {
  display: inline-block;
  padding: 12px 28px;
  background: #fff;
  color: #0A7FD9;
  border: 1px solid #0A7FD9;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}
.search-more-btn:hover {
  background: #0A7FD9;
  color: #fff;
}

/* Modal cho phép cuộn khi kết quả nhiều */
.search-modal {
  align-items: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.search-modal-container {
  margin-top: 100px;
  margin-bottom: 60px;
}

@media (max-width: 768px) {
  .search-modal-container { margin-top: 70px; }
  .spc-mat { font-size: 8px; padding: 2px 6px; bottom: 5px; right: 5px; }
  .spc-soldout { font-size: 8px; padding: 2px 6px; top: 5px; left: 5px; }
  .spc-meta { font-size: 9px; margin-bottom: 2px; }
  .spc-compare { font-size: 9px; }
  .search-more-btn { width: 100%; padding: 13px; }
  /* Chừa chỗ cho bottom-nav khi cuộn hết danh sách */
  .search-modal-container { padding-bottom: calc(var(--sobie-bnav-h, 60px) + 20px); }
}
