/* ═══════════════════════════════════════════════
   POPUPS.CSS — Search Modal & Contact Popup
   OkaneGroup Theme v1.0.0
   ═══════════════════════════════════════════════ */

/* ═══ SHARED OVERLAY BASE ═══ */
.search-overlay,
.contact-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(26, 23, 20, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.search-overlay.active,
.contact-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

body.contact-open,
body.search-open {
  overflow: hidden;
}

/* ═══════════════════════════════════════════════
   CONTACT POPUP
   ═══════════════════════════════════════════════ */
.contact-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.contact-popup {
  width: min(580px, 100%);
  max-height: 85vh;
  background: linear-gradient(
    320deg,
    rgba(32, 29, 24, 0.97) 0%,
    rgba(26, 23, 20, 0.99) 100%
  );
  border: 1px solid var(--ok-cream-15);
  border-radius: var(--ok-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.3s var(--ok-ease);
}

.contact-overlay.active .contact-popup {
  transform: translateY(0) scale(1);
}

.cp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ok-cream-08);
}

.cp-title {
  font-family: var(--ok-font-primary);
  font-size: 18px;
  font-weight: 500;
  color: var(--ok-cream);
}

.cp-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--ok-radius);
  background: var(--ok-cream-08);
  color: var(--ok-cream-40);
  border: none;
  cursor: pointer;
  transition: all var(--ok-transition-fast);
}

.cp-close:hover {
  background: var(--ok-cream-15);
  color: var(--ok-cream);
}

.cp-close svg { width: 14px; height: 14px; }

.cp-body {
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--ok-cream-15) transparent;
}

.cp-body::-webkit-scrollbar { width: 4px; }
.cp-body::-webkit-scrollbar-thumb { background: var(--ok-cream-15); border-radius: 4px; }

.cp-subtitle {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ok-cream-30);
  margin-bottom: 24px;
}

.cp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.cp-field {
  display: flex;
  flex-direction: column;
}

.cp-full { width: 100%; }

.cp-field label {
  font-size: 12px;
  color: var(--ok-cream-30);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.cp-field input,
.cp-field select,
.cp-field textarea {
  padding: 12px 14px;
  border: 1px solid var(--ok-cream-08);
  border-radius: var(--ok-radius);
  font-size: 14px;
  font-family: var(--ok-font-primary);
  color: var(--ok-cream);
  background: var(--ok-cream-08);
  outline: none;
  transition: border-color var(--ok-transition-fast);
  font-weight: 300;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.cp-field input::placeholder,
.cp-field textarea::placeholder {
  color: var(--ok-cream-30);
}

.cp-field select {
  color: var(--ok-cream-30);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(225,216,203,0.4)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.cp-field select option {
  background: var(--ok-dark);
  color: var(--ok-cream);
}

.cp-field input:focus,
.cp-field select:focus,
.cp-field textarea:focus {
  border-color: var(--ok-cream-30);
}

.cp-field textarea {
  resize: vertical;
  min-height: 90px;
}

.cp-submit {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

/* ═══════════════════════════════════════════════
   SEARCH MODAL
   ═══════════════════════════════════════════════ */
.search-overlay {
  display: flex;
  justify-content: center;
  padding-top: min(12vh, 120px);
}

.search-modal {
  width: min(600px, 92vw);
  max-height: 75vh;
  background: linear-gradient(
    320deg,
    rgba(32, 29, 24, 0.95) 0%,
    rgba(26, 23, 20, 0.98) 100%
  );
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--ok-cream-15);
  border-radius: var(--ok-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(-12px) scale(0.97);
  transition: transform 0.3s var(--ok-ease);
}

.search-overlay.active .search-modal {
  transform: translateY(0) scale(1);
}

/* Search bar */
.search-modal-bar {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--ok-cream-08);
}

.search-modal-bar .sm-icon {
  color: var(--ok-cream-40);
  flex-shrink: 0;
}

.search-modal-bar .sm-icon svg { width: 20px; height: 20px; }

.search-modal-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--ok-cream);
  font-family: var(--ok-font-primary);
  font-size: 15px;
  font-weight: 300;
}

.search-modal-bar input::placeholder { color: var(--ok-cream-30); }

.search-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--ok-radius);
  background: var(--ok-cream-08);
  color: var(--ok-cream-40);
  flex-shrink: 0;
  transition: all var(--ok-transition-fast);
  cursor: pointer;
  border: none;
}

.search-modal-close:hover {
  background: var(--ok-cream-15);
  color: var(--ok-cream);
}

.search-modal-close svg { width: 14px; height: 14px; }

/* Scrollable body */
.search-modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--ok-cream-15) transparent;
}

.search-modal-body::-webkit-scrollbar { width: 4px; }
.search-modal-body::-webkit-scrollbar-thumb { background: var(--ok-cream-15); border-radius: 4px; }

/* Tags */
.sm-tags {
  padding: 14px 20px;
  border-bottom: 1px solid var(--ok-cream-08);
}

.sm-tags-label {
  font-size: 12px;
  color: var(--ok-cream-30);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.sm-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sm-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--ok-cream-08);
  border: 1px solid var(--ok-cream-08);
  border-radius: 20px;
  font-size: 13px;
  color: var(--ok-cream-60);
  cursor: pointer;
  transition: all var(--ok-transition-fast);
}

.sm-tag:hover {
  background: var(--ok-cream-15);
  color: var(--ok-cream);
  border-color: var(--ok-cream-15);
}

.sm-tag.active {
  background: var(--ok-cream-15);
  color: var(--ok-cream);
  border-color: var(--ok-cream-30);
}

.sm-tag svg { width: 14px; height: 14px; opacity: 0.6; }
.sm-tag .sm-tag-x { width: 12px; height: 12px; opacity: 0.4; margin-left: 2px; }
.sm-tag:hover .sm-tag-x { opacity: 0.7; }

/* Section headers */
.sm-section-header {
  padding: 14px 20px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sm-section-header span {
  font-size: 12px;
  color: var(--ok-cream-30);
  letter-spacing: 0.3px;
}

.sm-section-header .sm-count {
  color: var(--ok-cream-60);
  font-weight: 500;
}

/* Search result items */
.sm-results { list-style: none; padding: 0; margin: 0; }

.sm-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sm-result-item:hover { background: var(--ok-cream-08); }

.sm-result-thumb {
  width: 48px;
  height: 36px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.sm-result-thumb img { width: 100%; height: 100%; object-fit: cover; }

.sm-result-info { flex: 1; min-width: 0; }

.sm-result-name {
  font-size: 14px;
  font-weight: 400;
  color: var(--ok-cream);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sm-result-meta {
  font-size: 12px;
  color: var(--ok-cream-30);
  margin-top: 1px;
}

.sm-result-price {
  font-size: 13px;
  font-weight: 500;
  color: var(--ok-cream-60);
  white-space: nowrap;
  flex-shrink: 0;
}

.sm-result-actions { display: flex; gap: 6px; flex-shrink: 0; }

.sm-result-action {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--ok-cream-08);
  color: var(--ok-cream-40);
  transition: all var(--ok-transition-fast);
  opacity: 0;
}

.sm-result-item:hover .sm-result-action { opacity: 1; }

.sm-result-action:hover {
  background: var(--ok-cream-15);
  color: var(--ok-cream);
}

.sm-result-action svg { width: 14px; height: 14px; }

/* Quick actions */
.sm-actions { border-top: 1px solid var(--ok-cream-08); }

.sm-action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sm-action-item:hover { background: var(--ok-cream-08); }

.sm-action-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ok-radius);
  background: var(--ok-cream-08);
  color: var(--ok-cream-60);
  flex-shrink: 0;
}

.sm-action-icon svg { width: 15px; height: 15px; }

.sm-action-text {
  flex: 1;
  font-size: 14px;
  color: var(--ok-cream);
  font-weight: 300;
}

.sm-action-key {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--ok-cream-08);
  color: var(--ok-cream-40);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Featured */
.sm-featured { border-top: 1px solid var(--ok-cream-08); }

.sm-featured-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sm-featured-item:hover { background: var(--ok-cream-08); }

.sm-featured-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.sm-featured-icon img { width: 100%; height: 100%; object-fit: cover; }

.sm-featured-info { flex: 1; }

.sm-featured-title {
  font-size: 14px;
  color: var(--ok-cream);
  font-weight: 400;
}

.sm-featured-sub {
  font-size: 12px;
  color: var(--ok-cream-30);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.sm-featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--ok-cream-08);
  color: var(--ok-cream-40);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.sm-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--ok-cream-30);
  font-size: 14px;
  font-weight: 300;
}

/* ═══ Search modal — mobile ═══ */
@media (max-width: 640px) {
  .search-overlay { padding-top: 0; align-items: flex-start; }
  
  .search-modal {
    width: 100vw;
    max-height: 100vh;
    max-height: 100svh;
    border-radius: 0;
    border: none;
  }
  
  .sm-result-thumb { width: 40px; height: 30px; }
  .sm-result-action { opacity: 1; }
  
  .sm-tags-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
  }
  
  .sm-tags-list::-webkit-scrollbar { display: none; }
  .sm-tag { flex-shrink: 0; }
  
  /* Contact popup mobile */
  .contact-popup {
    width: 100vw;
    max-height: 100vh;
    max-height: 100svh;
    border-radius: 0;
    border: none;
  }
  
  .contact-overlay { padding: 0; }
  .cp-row { grid-template-columns: 1fr; }
}
