/* =============================================
   Overlays & Animations
   ============================================= */

/* ---------- Search Overlay ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.search-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.search-overlay__content {
  width: 100%;
  max-width: 600px;
  padding: 0 24px;
  position: relative;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.search-overlay.is-open .search-overlay__content {
  transform: translateY(0);
}

.search-overlay__close {
  position: absolute;
  top: -60px;
  right: 24px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 32px;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
}

.search-overlay__close:hover {
  color: #fff;
}

.search-overlay__input {
  width: 100%;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.5px;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-overlay__input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.search-overlay__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 0, 0,0.15);
}

/* ---------- Scroll Animations ---------- */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Cart badge bounce ---------- */
@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.header__cart-count.bounce {
  animation: bounce 0.3s ease;
}

/* ---------- Header scrolled ---------- */
.header--scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ---------- Predictive search results ----------
   IMPORTANT: this MUST NOT be named `.search-results` because WordPress
   automatically adds `search-results` as a CLASS on <body> for search pages,
   which would then match and apply `display: none` to the whole page. */
.search-overlay__results {
  margin-top: 16px;
  background: #fff;
  border-radius: 12px;
  max-height: 60vh;
  overflow-y: auto;
  display: none;
}

.search-overlay__results.is-visible {
  display: block;
}

.search-overlay__results-loading,
.search-overlay__results-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-dark-muted);
  font-size: 14px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-dark);
  border-bottom: 1px solid var(--light-border);
  transition: background 0.15s;
}

.search-result:last-child { border-bottom: none; }

.search-result:hover {
  background: var(--accent-soft);
}

.search-result__img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: var(--light-bg);
  border-radius: 8px;
  padding: 4px;
  flex-shrink: 0;
}

.search-result__body {
  flex: 1;
  min-width: 0;
}

.search-result__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result__price {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.search-result__price del {
  color: var(--text-dark-muted);
  font-weight: 500;
  margin-right: 6px;
}

.search-result__price ins {
  text-decoration: none;
}

/* ---------- Cart Abandonment Popup ---------- */
.abandon-popup {
  position: fixed;
  inset: 0;
  z-index: 9000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.abandon-popup.is-visible {
  opacity: 1;
  visibility: visible;
}

.abandon-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.abandon-popup__box {
  position: relative;
  max-width: 460px;
  margin: 12vh auto 0;
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px 32px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  transform: translateY(20px);
  transition: transform 0.35s ease;
}

.abandon-popup.is-visible .abandon-popup__box {
  transform: translateY(0);
}

.abandon-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: var(--text-dark-muted);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s;
}

.abandon-popup__close:hover {
  background: var(--light-bg);
  color: var(--text-dark);
}

.abandon-popup__icon {
  width: 64px;
  height: 64px;
  background: var(--accent-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.abandon-popup__icon svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.abandon-popup__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.abandon-popup__text {
  font-size: 14px;
  color: var(--text-dark-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.abandon-popup__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.abandon-popup__btn {
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s ease;
}

.abandon-popup__btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0,0.3);
}

.abandon-popup__btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

.abandon-popup__btn--ghost {
  background: transparent;
  color: var(--text-dark-secondary);
  border-color: var(--light-border-strong);
}

.abandon-popup__btn--ghost:hover {
  background: var(--light-bg);
  color: var(--text-dark);
}

@media (max-width: 640px) {
  .abandon-popup__box { margin: 18vh 16px 0; padding: 32px 24px 24px; }
  .abandon-popup__title { font-size: 19px; }
}
