/* =========================================================
   WC Live Search — Stylesheet v1.0
   Aesthetic: Luxury parfumerie — Cormorant × Jost
   ========================================================= */

:root {
  --wcs-accent:      #c9a96e;
  --wcs-icon:        #1a1a1a;
  --wcs-modal-bg:    #fefcf9;
  --wcs-text:        #1a1a1a;
  --wcs-muted:       #9a9490;
  --wcs-rule:        #ede9e2;
  --wcs-overlay-bg:  rgba(6, 5, 4, 0.62);
  --wcs-ease:        cubic-bezier(0.16, 1, 0.3, 1);
  --wcs-font-serif:  'Cormorant', Georgia, 'Times New Roman', serif;
  --wcs-font-sans:   'Jost', system-ui, -apple-system, sans-serif;
}


/* ─────────────────────────────────────────
   Trigger (search icon button)
────────────────────────────────────────── */

.wcs-trigger {
  display:         inline-flex !important;
  align-items:     center !important;
  justify-content: center !important;
  width:  42px !important;
  height: 42px !important;
  min-width: 42px !important;
  padding: 0 !important;
  background-color: transparent !important;
  border: none !important;
  cursor: pointer !important;
  transition: opacity .2s ease;
  vertical-align: middle;
  flex-shrink: 0;
  /* icon rendered via background-image from PHP (see output_customizer_css) */
}

.wcs-trigger:hover  { opacity: .55; }
.wcs-trigger:focus-visible {
  outline: 2px solid var(--wcs-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.wcs-trigger svg { display: none !important; }

/* Navigation list item wrapper */
.wcs-menu-item {
  list-style: none;
  display:    flex;
  align-items: center;
}


/* ─────────────────────────────────────────
   Overlay
────────────────────────────────────────── */

.wcs-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: var(--wcs-overlay-bg);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}

.wcs-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}


/* ─────────────────────────────────────────
   Modal panel
────────────────────────────────────────── */

.wcs-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: var(--wcs-modal-bg);
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform .45s var(--wcs-ease),
    opacity   .3s  ease;
  box-shadow: 0 24px 64px rgba(0,0,0,.14);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.wcs-modal.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.wcs-modal-inner {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 28px 36px;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


/* ─────────────────────────────────────────
   Input row
────────────────────────────────────────── */

.wcs-field-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--wcs-text);
  margin-bottom: 28px;
  flex-shrink: 0;
}

.wcs-field-icon {
  width:  22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--wcs-muted);
}

.wcs-field {
  flex: 1;
  min-width: 0;
  font-family: var(--wcs-font-serif);
  font-size:   clamp(22px, 3vw, 32px);
  font-weight: 300;
  font-style:  italic;
  color: var(--wcs-text);
  background: none;
  border: none;
  outline: none;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.wcs-field::placeholder {
  color: var(--wcs-muted);
  opacity: .75;
}

/* Hide browser's native clear button */
.wcs-field::-webkit-search-decoration,
.wcs-field::-webkit-search-cancel-button,
.wcs-field::-webkit-search-results-button,
.wcs-field::-webkit-search-results-decoration { display: none; }

.wcs-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width:  26px;
  height: 26px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--wcs-muted);
  padding: 0;
  transition: color .2s ease;
}
.wcs-clear-btn:hover { color: var(--wcs-text); }
.wcs-clear-btn svg   { width: 16px; height: 16px; display: block; }


/* ─────────────────────────────────────────
   Body — scrollable results area
────────────────────────────────────────── */

.wcs-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--wcs-rule) transparent;
}

.wcs-body::-webkit-scrollbar       { width: 4px; }
.wcs-body::-webkit-scrollbar-track { background: transparent; }
.wcs-body::-webkit-scrollbar-thumb {
  background: var(--wcs-rule);
  border-radius: 2px;
}


/* ─────────────────────────────────────────
   Status line
────────────────────────────────────────── */

.wcs-status {
  font-family: var(--wcs-font-sans);
  font-size:   12px;
  font-weight: 400;
  letter-spacing: .06em;
  color: var(--wcs-muted);
  margin: 0 0 16px;
  min-height: 18px;
}


/* Loading dots */
.wcs-dots {
  display:     inline-flex;
  gap:         5px;
  align-items: center;
}
.wcs-dots span {
  width:  5px;
  height: 5px;
  border-radius: 50%;
  background: var(--wcs-accent);
  animation: wcsDot 1.1s ease-in-out infinite;
}
.wcs-dots span:nth-child(2) { animation-delay: .18s; }
.wcs-dots span:nth-child(3) { animation-delay: .36s; }

@keyframes wcsDot {
  0%, 80%, 100% { transform: scale(.5); opacity: .35; }
  40%           { transform: scale(1);  opacity: 1;   }
}


/* ─────────────────────────────────────────
   Results list
────────────────────────────────────────── */

.wcs-list {
  list-style: none;
  margin:  0;
  padding: 0;
}

/* Each result row */
.wcs-item {
  display:     flex;
  align-items: center;
  gap:         16px;
  padding:     14px 8px;
  text-decoration: none;
  color:       inherit;
  cursor:      pointer;
  border-bottom: 1px solid var(--wcs-rule);
  outline:     none;
  transition:  background .15s ease, padding-left .15s ease;

  /* stagger in */
  animation: wcsIn .32s var(--wcs-ease) both;
}

.wcs-list li:first-child .wcs-item {
  border-top: 1px solid var(--wcs-rule);
}

.wcs-item:hover,
.wcs-item.is-active {
  background:   rgba(0,0,0,.025);
  padding-left: 14px;
}

/* Stagger delays handled inline via JS style attribute */

@keyframes wcsIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}


/* ── Thumbnail ── */
.wcs-img-wrap {
  width:    68px;
  height:   68px;
  flex-shrink: 0;
  overflow: hidden;
  background: #f0ede8;
}

.wcs-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}

.wcs-item:hover .wcs-img { transform: scale(1.04); }


/* ── Info ── */
.wcs-info {
  flex: 1;
  min-width: 0;
}

.wcs-cat {
  font-family: var(--wcs-font-sans);
  font-size:   10px;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color:   var(--wcs-accent);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wcs-name {
  font-family: var(--wcs-font-serif);
  font-size:   17px;
  font-weight: 400;
  color:   var(--wcs-text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Highlighted match */
.wcs-name mark {
  background: none;
  color: var(--wcs-accent);
  font-style: italic;
}


/* ── Price ── */
.wcs-price {
  flex-shrink: 0;
  text-align: right;
}

/* WooCommerce outputs its own spans — we target them */
.wcs-price .woocommerce-Price-amount,
.wcs-price ins .woocommerce-Price-amount {
  font-family: var(--wcs-font-sans);
  font-size:   14px;
  font-weight: 400;
  color: var(--wcs-text);
  text-decoration: none;
}

.wcs-price del {
  display: block;
  opacity: .55;
}
.wcs-price del .woocommerce-Price-amount {
  font-size: 12px;
}

.wcs-sale-badge {
  display:       inline-block;
  margin-top:    5px;
  font-family:   var(--wcs-font-sans);
  font-size:     9px;
  font-weight:   500;
  letter-spacing:.1em;
  text-transform: uppercase;
  color:      #fff;
  background: var(--wcs-accent);
  padding:    2px 7px;
}


/* ─────────────────────────────────────────
   View all link
────────────────────────────────────────── */

.wcs-view-all {
  margin-top: 22px;
  text-align: center;
  padding-bottom: 8px;
}

.wcs-view-all-link {
  display:     inline-flex;
  align-items: center;
  gap:         9px;
  font-family: var(--wcs-font-sans);
  font-size:   11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color:   var(--wcs-text);
  text-decoration: none;
  padding: 11px 28px;
  border:  1px solid var(--wcs-text);
  transition: background .22s ease, color .22s ease;
}

.wcs-view-all-link:hover {
  background: var(--wcs-text);
  color: var(--wcs-modal-bg);
}

.wcs-view-all-link svg {
  width:  13px;
  height: 13px;
  flex-shrink: 0;
  transition: transform .2s ease;
}

.wcs-view-all-link:hover svg { transform: translateX(3px); }


/* ─────────────────────────────────────────
   Close button
────────────────────────────────────────── */

.wcs-close-btn {
  position: absolute;
  top:   16px;
  right: 16px;
  display:     flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--wcs-font-sans);
  font-size:   10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color:  var(--wcs-muted);
  padding: 8px 4px;
  transition: color .2s ease;
}

.wcs-close-btn:hover { color: var(--wcs-text); }
.wcs-close-btn svg   { width: 13px; height: 13px; display: block; }


/* ─────────────────────────────────────────
   Responsive
────────────────────────────────────────── */

@media (max-width: 640px) {
  .wcs-modal-inner {
    padding: 36px 16px 24px;
  }

  .wcs-img-wrap {
    width:  52px;
    height: 52px;
  }

  .wcs-name { font-size: 15px; }

  .wcs-close-btn span { display: none; }

  .wcs-view-all-link {
    width: 100%;
    justify-content: center;
  }
}
