/* ==========================================================================
   SHIV SHAKTI MARBLE ART — GLOBAL LUXURY SEARCH SYSTEM CSS
   Production-Ready Design System for Global Header Search & Discovery
   ========================================================================== */

/* ── 1. HEADER SEARCH BAR WRAPPER & INPUT GROUP ── */
.header-search-wrapper {
  position: relative;
  z-index: 10000;
  display: flex;
  align-items: center;
  margin: 0 0.8rem;
}

.header-search-group {
  display: flex;
  align-items: center;
  background: rgba(15, 12, 8, 0.85);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  border-radius: 100px;
  padding: 0.4rem 0.9rem 0.4rem 1.1rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: 170px;
  position: relative;
}

.header-search-group:focus-within,
.header-search-group.active {
  width: 280px;
  border-color: rgba(212, 175, 55, 0.85);
  background: rgba(20, 16, 10, 0.95);
  box-shadow: 0 12px 35px rgba(212, 175, 55, 0.18), 0 0 20px rgba(212, 175, 55, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.header-search-group input {
  background: transparent;
  border: none;
  outline: none;
  color: #f0ece4;
  font-family: Inter, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  width: 100%;
  padding: 0;
  margin-right: 0.5rem;
}

.header-search-group input::placeholder {
  color: rgba(212, 175, 55, 0.55);
  font-weight: 400;
  transition: color 0.3s ease;
}

.header-search-group:focus-within input::placeholder {
  color: rgba(200, 190, 170, 0.35);
}

.search-icon-btn,
.mic-icon-btn {
  background: none;
  border: none;
  color: #D4AF37;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  transition: transform 0.3s ease, color 0.3s ease, opacity 0.3s ease;
  flex-shrink: 0;
}

.search-icon-btn:hover,
.mic-icon-btn:hover {
  transform: scale(1.15);
  color: #fff;
}

.mic-icon-btn {
  margin-right: 4px;
  opacity: 0.75;
  border-radius: 50%;
}

.mic-icon-btn.listening {
  color: #ff3b30 !important;
  opacity: 1 !important;
  animation: micPulse 1.2s infinite;
  background: rgba(255, 59, 48, 0.15);
  padding: 4px;
}

@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* ── 2. MOBILE SEARCH PILL ── */
.mob-search-pill {
  display: none;
  align-items: center;
  background: rgba(18, 14, 10, 0.9);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 50px;
  padding: 0.35rem 0.8rem;
  width: 140px;
  transition: all 0.35s ease;
  position: relative;
  margin: 0 4px;
}

.mob-search-pill:focus-within {
  width: 200px;
  border-color: #D4AF37;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.mob-search-pill input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: #f0ece4;
  font-size: 0.78rem;
}

@media (max-width: 1024px) {
  .header-search-wrapper { display: none !important; }
  .mob-search-pill { display: flex !important; }
}

/* ── 3. SEARCH RESULTS DROPDOWN PANEL (GLASSMORPHISM) ── */
.global-search-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 480px;
  max-height: 75vh;
  background: rgba(14, 11, 8, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 18px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 30px rgba(212, 175, 55, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10001;
  animation: searchDropdownFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (max-width: 600px) {
  .global-search-dropdown {
    position: fixed;
    top: 70px;
    left: 10px;
    right: 10px;
    width: calc(100vw - 20px);
    max-height: 80vh;
  }
}

@keyframes searchDropdownFadeIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.global-search-dropdown.visible {
  display: flex;
}

/* ── 4. FILTER TABS BAR ── */
.search-filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  background: rgba(212, 175, 55, 0.05);
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  overflow-x: auto;
  scrollbar-width: none;
}

.search-filter-tabs::-webkit-scrollbar { display: none; }

.search-filter-tab {
  background: transparent;
  border: 1px solid transparent;
  color: rgba(250, 248, 244, 0.6);
  font-family: Inter, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.75rem;
  border-radius: 30px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.search-filter-tab:hover {
  color: #D4AF37;
  background: rgba(212, 175, 55, 0.08);
}

.search-filter-tab.active {
  background: linear-gradient(135deg, #C8A951, #E8D08A, #D4AF37);
  color: #0a0805;
  font-weight: 700;
  border-color: #D4AF37;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

/* ── 5. RESULTS SCROLLABLE LIST ── */
.search-results-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  max-height: calc(70vh - 110px);
}

.search-results-list::-webkit-scrollbar {
  width: 5px;
}
.search-results-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.search-results-list::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.3); border-radius: 4px; }

/* Group Headers */
.search-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.2rem 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #D4AF37;
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
  margin-top: 0.4rem;
}

.search-group-header:first-child { margin-top: 0; }

/* Individual Result Card Item */
.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.2rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.search-result-item:hover,
.search-result-item.active-result {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.14) 0%, rgba(212, 175, 55, 0.02) 100%);
  border-left: 3.5px solid #D4AF37;
  padding-left: calc(1.2rem - 3.5px);
}

.result-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
  flex-shrink: 0;
}

.result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.result-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.result-title {
  color: #f0ece4;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-badge {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  flex-shrink: 0;
}

.badge-category { background: rgba(212, 175, 55, 0.18); color: #D4AF37; border: 1px solid rgba(212, 175, 55, 0.3); }
.badge-subcat { background: rgba(200, 180, 150, 0.15); color: #e0d0b0; }
.badge-instock { background: rgba(37, 211, 102, 0.15); color: #25d366; border: 1px solid rgba(37, 211, 102, 0.3); }
.badge-custom { background: rgba(180, 140, 80, 0.15); color: #c8a951; }

.result-desc {
  color: rgba(250, 248, 244, 0.5);
  font-size: 0.76rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  color: rgba(212, 175, 55, 0.75);
}

/* Highlighted query matching text */
mark.search-highlight {
  background: rgba(212, 175, 55, 0.35);
  color: #fff;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}

/* ── 6. DISCOVERY & HISTORY PANEL (EMPTY STATE / INITIAL CLICK) ── */
.search-discovery-panel {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.discovery-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.discovery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.discovery-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #D4AF37;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-clear-history {
  background: none;
  border: none;
  color: rgba(250, 248, 244, 0.4);
  font-size: 0.7rem;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.btn-clear-history:hover { color: #ff3b30; }

.discovery-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: rgba(250, 248, 244, 0.85);
  font-family: Inter, sans-serif;
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.search-chip:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: #D4AF37;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.trend-chip {
  border-color: rgba(212, 175, 55, 0.35);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(212, 175, 55, 0.02) 100%);
}

.discovery-tip {
  font-size: 0.76rem;
  color: rgba(250, 248, 244, 0.55);
  line-height: 1.5;
  background: rgba(212, 175, 55, 0.05);
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border-left: 3px solid #D4AF37;
}

/* ── 7. FOOTER ACTION BAR ── */
.search-panel-footer {
  padding: 0.75rem 1rem;
  background: rgba(10, 8, 6, 0.95);
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
}

.btn-view-all-results {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #C8A951, #E8D08A, #D4AF37);
  color: #0a0805;
  font-family: Inter, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.6rem 1rem;
  border-radius: 100px;
  transition: all 0.25s ease;
}

.btn-view-all-results:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.keyboard-hint {
  font-size: 0.65rem;
  color: rgba(250, 248, 244, 0.4);
  letter-spacing: 0.04em;
}

.keyboard-hint strong {
  color: #D4AF37;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
}

/* ── 8. NO RESULTS STATE ── */
.search-no-results-view {
  padding: 2.5rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.no-results-icon { font-size: 2.2rem; margin-bottom: 0.2rem; }
.no-results-title { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; color: #f0ece4; }
.no-results-desc { font-size: 0.82rem; color: rgba(250, 248, 244, 0.5); max-width: 320px; line-height: 1.5; }

/* ── 9. DEDICATED SEARCH RESULTS SPA VIEW ── */
.search-results-page-container {
  padding: 3rem 0 6rem;
  min-height: 70vh;
}

.search-page-hero {
  text-align: center;
  padding: 3rem 1rem 4rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,175,55,0.08) 0%, transparent 70%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  margin-bottom: 3rem;
}

.search-page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 300;
  color: #f0ece4;
  margin-bottom: 0.5rem;
}

.search-page-subtitle {
  font-size: 0.95rem;
  color: rgba(250, 248, 244, 0.6);
  margin-bottom: 1.5rem;
}

.search-page-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.filter-pill-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: rgba(250, 248, 244, 0.8);
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.filter-pill-btn.active,
.filter-pill-btn:hover {
  background: #D4AF37;
  color: #0a0805;
  font-weight: 700;
  border-color: #D4AF37;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}
