/* ============================================================
   minoii · LV Signature Features (独立功能增强层)
   ------------------------------------------------------------
   悬停切第二张图 / Quick View 快速查看 / 全屏搜索抽屉 /
   心愿收藏 / 回到顶部。全部为追加式 DOM，不改核心交互结构。
   回滚：删除本文件引用与 js/lv-features.js 引用即可。
   ============================================================ */

/* ---------- 1. 悬停切图：图片交叉淡入 ---------- */
.product__media img,
.catalog-card__media img { transition: transform 0.7s var(--ease), opacity 0.16s ease; }

/* ---------- 2. Quick View 悬浮按钮 ---------- */
.lv-quick {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  height: 46px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--white);
  font-family: var(--font-english); font-size: 0.7rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  transform: translateY(101%);
  transition: transform 0.45s var(--ease), background 0.3s;
}
.product:hover .lv-quick,
.catalog-card:hover .lv-quick { transform: translateY(0); }
.lv-quick:hover { background: var(--accent-dark); }
/* 首页卡已有「+加入」，Quick View 上移一层，形成双层操作栏 */
.product .lv-quick { bottom: 46px; border-top: 1px solid rgba(255,255,255,0.18); }
/* 触屏无 hover：弱化常驻，保证可用 */
@media (hover: none) {
  .lv-quick { transform: translateY(0); height: 38px; font-size: 0.62rem; }
  .product .lv-quick { bottom: 0; }
  .product:hover .product__add { transform: translateY(100%); }
}

/* ---------- 3. 心愿收藏 ---------- */
.lv-wish {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 0; padding: 0;
  background: rgba(250,247,242,0.94); color: var(--ink);
  font-family: var(--font-sans); font-size: 1.15rem; line-height: 1;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, transform 0.3s var(--ease);
}
.lv-wish:hover { background: var(--ink); color: var(--white); transform: scale(1.06); }
.lv-wish.is-active { background: var(--ink); color: var(--white); }

/* ---------- 4. Quick View 弹窗 ---------- */
.lv-qv { position: fixed; inset: 0; z-index: 2100; display: none; align-items: center; justify-content: center; padding: 28px; }
.lv-qv.is-open { display: flex; animation: lvFade 0.3s ease both; }
.lv-qv__backdrop { position: absolute; inset: 0; background: rgba(28,24,20,0.62); }
.lv-qv__panel {
  position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr;
  width: min(900px, 100%); max-height: 86vh; background: var(--cream);
  border: 1px solid var(--line);
  animation: lvRise 0.45s var(--ease) both;
}
.lv-qv__close {
  position: absolute; top: 12px; right: 16px; z-index: 3;
  width: 38px; height: 38px; border: 0; background: var(--cream); color: var(--ink);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.lv-qv__close:hover { color: var(--accent-dark); }
.lv-qv__media { background: var(--oat); min-height: 420px; overflow: hidden; }
.lv-qv__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lv-qv__body { padding: 56px 46px; display: flex; flex-direction: column; justify-content: center; overflow: auto; }
.lv-qv__series { font-size: 0.66rem; letter-spacing: 0.26em; color: var(--muted); text-transform: uppercase; }
.lv-qv__name { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 400; line-height: 1.2; margin: 18px 0 14px; }
.lv-qv__price { font-size: 1.3rem; font-family: var(--font-english); margin-bottom: 22px; }
.lv-qv__desc { font-size: 0.9rem; line-height: 1.9; color: var(--ink-soft); margin-bottom: 34px; }
.lv-qv__link { align-self: flex-start; text-decoration: none; }
@keyframes lvFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lvRise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- 5. 搜索抽屉 ---------- */
.lv-search-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border: 0; background: none;
  color: var(--ink); cursor: pointer;
}
.lv-search-btn svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.lv-search-btn:hover { color: var(--accent-dark); }
.lv-search {
  position: fixed; inset: 0; z-index: 2050; display: none;
  flex-direction: column; background: var(--cream);
  padding: 0 clamp(20px, 6vw, 90px);
}
.lv-search.is-open { display: flex; animation: lvFade 0.28s ease both; }
.lv-search__top { display: flex; align-items: center; justify-content: space-between; padding: 28px 0 18px; border-bottom: 1px solid var(--line); }
.lv-search__label { font-size: 0.66rem; letter-spacing: 0.3em; color: var(--muted); text-transform: uppercase; }
.lv-search__close { width: 40px; height: 40px; border: 1px solid var(--line); background: none; color: var(--ink); font-size: 1.5rem; cursor: pointer; }
.lv-search__close:hover { background: var(--ink); color: var(--white); }
.lv-search__input {
  width: 100%; border: 0; border-bottom: 1px solid var(--ink); background: none;
  font-family: var(--font-sans); font-size: clamp(1.5rem, 5vw, 3rem); color: var(--ink);
  padding: 34px 0 22px; outline: none;
}
.lv-search__input::placeholder { color: var(--sand); }
.lv-search__hint { font-size: 0.78rem; color: var(--muted); padding: 18px 0 30px; letter-spacing: 0.04em; margin: 0; }
.lv-search__results { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px; overflow-y: auto; padding-bottom: 60px; }
.lv-search__card { display: block; text-decoration: none; color: inherit; border: 1px solid var(--line); background: var(--white); }
.lv-search__card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.lv-search__card-meta { padding: 14px 16px 18px; }
.lv-search__card-name { display: block; font-size: 0.95rem; margin-bottom: 6px; }
.lv-search__card-price { font-size: 0.8rem; color: var(--muted); font-family: var(--font-english); }
.lv-search__empty { grid-column: 1/-1; padding: 60px 0; text-align: center; color: var(--muted); font-size: 0.95rem; }

/* ---------- 6. 回到顶部 ---------- */
.lv-totop {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 0;
  background: var(--ink); color: var(--white); cursor: pointer;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transform: translateY(14px);
  transition: opacity 0.35s, transform 0.35s var(--ease), background 0.3s;
}
.lv-totop.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.lv-totop:hover { background: var(--accent-dark); }

/* ---------- 7. 锚点跳转避开吸顶导航 ---------- */
/* LV 式双层 header 会遮住锚点标题，用 scroll-margin 预留空间 */
section[id], div[id^="cat-"] { scroll-margin-top: 128px; }
@media (max-width: 860px) { section[id], div[id^="cat-"] { scroll-margin-top: 84px; } }

/* ---------- 8. 移动端 ---------- */
@media (max-width: 860px) {
  .lv-search { padding: 0 20px; }
  .lv-search__results { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .lv-qv { padding: 14px; }
  .lv-qv__panel { grid-template-columns: 1fr; max-height: 92vh; overflow-y: auto; }
  .lv-qv__media { min-height: 260px; max-height: 42vh; }
  .lv-qv__body { padding: 32px 26px 40px; }
  .lv-totop { right: 14px; bottom: 14px; width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .lv-quick, .lv-wish, .lv-totop, .lv-qv, .lv-qv__panel, .lv-search { transition: none !important; animation: none !important; }
}
