/* Editorial search overlay, cart, wishlist drawers, and checkout sheets */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(250, 248, 244, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

body.theme-dark .search-modal { background: rgba(14, 17, 20, 0.97); }
.search-modal.open { opacity: 1; pointer-events: auto; transform: translateY(0); }

.search-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(20px + var(--safe-t)) 24px 18px;
  border-bottom: 1px solid var(--rule);
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}

.search-input {
  flex: 1;
  border: none;
  border-bottom: 1px solid var(--rule-strong);
  background: transparent;
  padding: 10px 4px;
  font-family: var(--ff-display);
  font-size: 24px;
  color: var(--ink);
  outline: none;
}

.search-input:focus { border-bottom-color: var(--brand); }
.search-input::placeholder { color: var(--ink-faint); }

#closeSearchBtn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-results { flex: 1; overflow-y: auto; padding: 28px 24px; width: 100%; max-width: 780px; margin: 0 auto; }

.search-suggest-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.search-suggest-tags { display: flex; flex-wrap: wrap; gap: 10px; }

.search-suggest-tag {
  padding: 8px 16px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.search-suggest-tag:hover { background: var(--ink); color: var(--canvas); border-color: var(--ink); }

.search-result-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.search-result-row:hover { border-color: var(--brand); transform: translateX(3px); }

.search-result-img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--surface-alt);
  flex-shrink: 0;
}

.search-result-name { font-family: var(--ff-display); font-size: 18px; color: var(--ink); }
.search-result-meta { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-top: 2px; }
.search-empty { padding: 48px 20px; text-align: center; color: var(--ink-soft); }

/* Slide-over Cart & Wishlist Drawers */
.cart-overlay,
.wishlist-drawer,
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur) ease, visibility 0s var(--dur);
}

#authModalOverlay { z-index: 30000; }

.cart-overlay.open,
.wishlist-drawer.open,
.modal-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }

.cart-backdrop,
.wishlist-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 18, 20, 0.56);
  backdrop-filter: blur(4px);
}

.cart-panel,
.wishlist-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 88vh;
  background: var(--canvas);
  color: var(--ink);
  border-radius: 12px 12px 0 0;
  box-shadow: var(--sh-xl);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s var(--ease);
}

.cart-overlay.open .cart-panel,
.wishlist-drawer.open .wishlist-panel { transform: translateY(0); }

@media (min-width: 768px) {
  .cart-panel,
  .wishlist-panel {
    top: 0;
    left: auto;
    width: 420px;
    max-height: none;
    height: 100%;
    border-radius: 0;
    border-left: 1px solid var(--rule);
    transform: translateX(100%);
  }
  .cart-overlay.open .cart-panel,
  .wishlist-drawer.open .wishlist-panel { transform: translateX(0); }
}

.cart-handle,
.sheet-handle {
  width: 34px;
  height: 3px;
  background: var(--rule-strong);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

@media (min-width: 768px) { .cart-handle { display: none; } }

.cart-header,
.wishlist-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  flex-shrink: 0;
}

.cart-header h3,
.wishlist-header h3 { font-size: 24px; color: var(--ink); }

.cart-items,
.wishlist-items { flex: 1; overflow-y: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 16px; }

.cart-item,
.wishlist-item {
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.cart-item-img,
.wishlist-item-img {
  width: 74px;
  height: 74px;
  border-radius: var(--r-sm);
  border: 1px solid var(--rule);
  overflow: hidden;
  background: var(--surface);
  flex-shrink: 0;
}

.cart-item-img img,
.wishlist-item-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

.cart-item-info,
.wishlist-item-info { flex: 1; min-width: 0; }

.cart-item-name,
.wishlist-item-name { font-family: var(--ff-display); font-size: 17px; font-weight: 500; color: var(--ink); line-height: 1.25; }

.cart-item-brand,
.wishlist-item-price { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-top: 3px; }

.cart-item-row,
.wishlist-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.cart-item-price { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.cart-item-qty-controls { display: flex; align-items: center; gap: 6px; }

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.qty-val { font-size: 12.5px; font-weight: 600; min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-item-remove, .wish-remove-btn { color: #B9382C; font-size: 11.5px; font-weight: 600; padding: 4px; }

.wish-whatsapp-btn {
  background: #1E7A56;
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wish-add-cart {
  background: var(--brand);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cart-footer {
  padding: 18px 24px calc(18px + var(--safe-b));
  border-top: 1px solid var(--rule);
  background: var(--surface);
}

.cart-total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.cart-total-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.cart-total-value { font-family: var(--ff-display); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }

.cart-checkout-btn,
.auth-submit {
  width: 100%;
  padding: 15px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  min-height: 48px;
  transition: background var(--dur-fast) ease;
}

.cart-checkout-btn:hover, .auth-submit:hover { background: var(--brand-deep); }

.cart-empty,
.wishlist-empty { text-align: center; padding: 56px 20px; color: var(--ink-soft); }
.cart-empty svg, .wishlist-empty-icon svg { margin: 0 auto 14px; opacity: 0.3; }

.cart-label-sec {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 6px 0 10px;
}

.cart-summary-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; color: var(--ink-soft); }

.cart-total-row-summary {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.payment-option {
  flex: 1;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12.5px;
}

.payment-option.selected { border-color: var(--brand); background: rgba(var(--brand-rgb), 0.06); color: var(--brand); font-weight: 600; }
.accent-radio { -webkit-appearance: auto; appearance: auto; accent-color: var(--brand); }
