/* === Search Overlay === */
.rrc-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

/* Close button — hidden on desktop (ESC kbd shown instead), visible on mobile */
.rrc-search-close {
  display: none;
}

.rrc-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.rrc-search-container {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 70vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: rrc-search-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rrc-search-enter {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header / Input */
.rrc-search-header {
  padding: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.rrc-search-input-wrap {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 56px;
  gap: 12px;
}

.rrc-search-icon {
  flex-shrink: 0;
  color: #6e6e73;
}

.rrc-search-input {
  flex: 1;
  border: none !important;
  outline: none;
  background: none !important;
  font-family: inherit;
  font-size: 17px !important;
  font-weight: 400;
  color: #1d1d1f;
  padding: 0 !important;
  margin: 0;
  border-radius: 0 !important;
}

.rrc-search-input::placeholder {
  color: #6e6e73;
  opacity: 0.7;
}

.rrc-search-kbd {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: #6e6e73;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1.4;
}

/* Body */
.rrc-search-body {
  overflow-y: auto;
  padding: 16px 20px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.rrc-search-body::-webkit-scrollbar {
  width: 4px;
}

.rrc-search-body::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 4px;
}

/* Popular Searches */
.rrc-search-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6e6e73;
  margin: 0 0 10px;
}

.rrc-search-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rrc-search-pill {
  background: #f5f5f7 !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: 980px !important;
  padding: 6px 14px !important;
  font-family: inherit;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #1d1d1f !important;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.rrc-search-pill:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

/* Results */
.rrc-search-results-group {
  margin-bottom: 20px;
}

.rrc-search-results-group:last-child {
  margin-bottom: 0;
}

/* Product Results */
.rrc-search-product {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  margin: 0 -10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.rrc-search-product:hover {
  background: #f5f5f7;
}

.rrc-search-product-image {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: #f5f5f7;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rrc-search-product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rrc-search-product-image-placeholder {
  width: 24px;
  height: 24px;
  color: #c7c7cc;
}

.rrc-search-product-info {
  flex: 1;
  min-width: 0;
}

.rrc-search-product-brand {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6e6e73;
  margin-bottom: 1px;
}

.rrc-search-product-title {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rrc-search-product-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.rrc-search-product-price {
  font-size: 13px;
  font-weight: 600;
  color: #1d1d1f;
}

.rrc-search-product-stock {
  font-size: 11px;
  font-weight: 500;
}

.rrc-search-product-stock.in-stock {
  color: #34c759;
}

.rrc-search-product-stock.out-of-stock {
  color: #6e6e73;
}

.rrc-search-product-arrow {
  flex-shrink: 0;
  color: #c7c7cc;
  transition: color 0.15s;
}

.rrc-search-product:hover .rrc-search-product-arrow {
  color: #6e6e73;
}

/* Category / Page Results */
.rrc-search-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 10px;
  text-decoration: none;
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease;
}

.rrc-search-link:hover {
  background: #f5f5f7;
}

.rrc-search-link-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: #6e6e73;
  margin-left: 8px;
}

.rrc-search-link-arrow {
  color: #c7c7cc;
  flex-shrink: 0;
}

.rrc-search-link:hover .rrc-search-link-arrow {
  color: #6e6e73;
}

/* Empty State */
.rrc-search-empty {
  text-align: center;
  padding: 40px 20px;
  color: #6e6e73;
}

.rrc-search-empty p {
  font-size: 15px;
  font-weight: 400;
}

/* Loading */
.rrc-search-loading {
  display: flex;
  justify-content: center;
  padding: 32px;
}

.rrc-search-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-top-color: #1d1d1f;
  border-radius: 50%;
  animation: rrc-search-spin 0.6s linear infinite;
}

@keyframes rrc-search-spin {
  to { transform: rotate(360deg); }
}

/* View All Results link */
.rrc-search-view-all {
  display: block;
  text-align: center;
  padding: 12px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #6e6e73;
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
}

.rrc-search-view-all:hover {
  background: #f5f5f7;
  color: #1d1d1f;
}

/* Responsive */
@media (max-width: 999px) {
  .rrc-search-overlay {
    padding-top: 0;
    align-items: stretch;
  }

  .rrc-search-backdrop {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
  }

  .rrc-search-container {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    height: 100%;
    background: #0a0a0a;
    box-shadow: none;
  }

  .rrc-search-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .rrc-search-input-wrap {
    height: 56px;
    padding: 0 12px;
    gap: 10px;
  }

  .rrc-search-icon {
    color: rgba(255, 255, 255, 0.5);
  }

  .rrc-search-input {
    font-size: 17px !important;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    height: 40px;
  }

  .rrc-search-input:focus {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    outline: none !important;
  }

  .rrc-search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
  }

  .rrc-search-kbd {
    display: none;
  }

  /* Close button — visible on mobile */
  .rrc-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer;
    padding: 0 !important;
    -webkit-tap-highlight-color: transparent;
  }

  .rrc-search-close svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
  }

  .rrc-search-close:active {
    background: rgba(255, 255, 255, 0.3) !important;
  }

  /* Body / results styling */
  .rrc-search-body {
    padding: 20px;
  }

  .rrc-search-section-label {
    color: rgba(255, 255, 255, 0.4);
  }

  .rrc-search-pill {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
  }

  .rrc-search-pill:hover,
  .rrc-search-pill:active {
    background: rgba(255, 255, 255, 0.15) !important;
  }

  /* Product results */
  .rrc-search-product:hover,
  .rrc-search-product:active {
    background: rgba(255, 255, 255, 0.06);
  }

  .rrc-search-product-image {
    background: rgba(255, 255, 255, 0.06);
  }

  .rrc-search-product-title {
    color: #fff;
  }

  .rrc-search-product-brand {
    color: rgba(255, 255, 255, 0.5);
  }

  .rrc-search-product-price {
    color: #fff;
  }

  .rrc-search-product-arrow {
    color: rgba(255, 255, 255, 0.2);
  }

  .rrc-search-product:hover .rrc-search-product-arrow {
    color: rgba(255, 255, 255, 0.5);
  }

  .rrc-search-product-image-placeholder {
    color: rgba(255, 255, 255, 0.2);
  }

  /* Link results */
  .rrc-search-link {
    color: #fff;
  }

  .rrc-search-link:hover,
  .rrc-search-link:active {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
  }

  .rrc-search-link-subtitle {
    color: rgba(255, 255, 255, 0.4);
  }

  .rrc-search-link-arrow {
    color: rgba(255, 255, 255, 0.2);
  }

  .rrc-search-link:hover .rrc-search-link-arrow {
    color: rgba(255, 255, 255, 0.5);
  }

  /* Empty state */
  .rrc-search-empty {
    color: rgba(255, 255, 255, 0.5);
  }

  /* Spinner */
  .rrc-search-spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: #fff;
  }

  /* View all */
  .rrc-search-view-all {
    color: rgba(255, 255, 255, 0.5);
  }

  .rrc-search-view-all:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
  }

  /* Scrollbar */
  .rrc-search-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
  }
}

.rrc-search-view-all {
  padding: 12px 16px;
  border-top: 1px solid rgba(0,0,0,0.08);
  background: #fafafa;
}
.rrc-search-view-all-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #0066CC;
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}
.rrc-search-view-all-link:hover { text-decoration: underline; }

/* Prevent body scroll when search is open */
body.rrc-search-open {
  overflow: hidden;
}
