/*
 * LINORA 腕表独立站 —— 共享购物模块（window.WatchShop）样式。
 * 覆盖：登录弹窗 / 协议弹层 / Toast / 购物车按钮 / 抽屉 / 运费行 / 加购粒子。
 * 全部类名以 watchshop- 前缀，避免与 React 构建产物及旧 watch-cart-* 样式冲突。
 * 配色沿用腕表站的深色 + 金调（墨黑 #14110d / 金 #c6a15b / 米白 #f5efe3）。
 */

/* ------------------------------ Toast ------------------------------ */
#watchshop-toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translate(-50%, 150%);
  z-index: 10030; background: #14110d; color: #f5efe3;
  padding: .8rem 1.25rem; border-radius: 999px;
  font: 500 .8rem/1.2 Inter, sans-serif; letter-spacing: .04em;
  box-shadow: 0 12px 30px rgba(20, 17, 13, .35);
  opacity: 0; pointer-events: none; transition: transform .28s ease, opacity .28s ease;
}
#watchshop-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* ------------------------------ 购物车按钮 ------------------------------ */
.watchshop-cart {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 10000;
  overflow: hidden;
  background: #14110d; color: #f5efe3;
  border: 1px solid rgba(198, 161, 91, .55); border-radius: 999px;
  padding: .9rem 1.15rem;
  font: 600 .78rem/1 Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(20, 17, 13, .32);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.watchshop-cart:hover { transform: translateY(-2px); background: #241d14; border-color: #c6a15b; }

/* 抽屉：层级必须高于合规页脚（legal-footer.js 用的是 9999），否则滚到底部时会被它盖住 */
.watchshop-drawer {
  position: fixed; right: 0; top: 0; height: 100dvh; width: min(400px, 92vw);
  background: #f5efe3; color: #14110d; z-index: 10010;
  padding: 1.5rem; padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  box-shadow: -12px 0 44px rgba(20, 17, 13, .22);
  transform: translateX(105%); transition: transform .3s ease;
  display: flex; flex-direction: column; font-family: Inter, sans-serif;
}
.watchshop-drawer.is-open { transform: translateX(0); }
.watchshop-drawer-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(20, 17, 13, .18); padding-bottom: 1rem; }
.watchshop-drawer-head strong { font-family: "Bodoni Moda", serif; font-size: 1.3rem; font-weight: 500; }
.watchshop-drawer-head button { background: transparent; border: 0; color: inherit; cursor: pointer; letter-spacing: .1em; text-transform: uppercase; font-size: .62rem; opacity: .7; }
.watchshop-drawer-items { overflow: auto; flex: 1; padding: 1rem 0; display: flex; flex-direction: column; gap: .9rem; }
.watchshop-empty { opacity: .7; font-size: .85rem; display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; }
.watchshop-empty p { margin: 0; }
.watchshop-empty button { background: transparent; border: 1px solid rgba(20, 17, 13, .35); color: inherit; padding: .55rem .95rem; font: 600 .64rem/1 Inter, sans-serif; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; transition: background .2s ease, color .2s ease; }
.watchshop-empty button:hover { background: #14110d; color: #f5efe3; }
.watchshop-line { display: flex; gap: .85rem; padding: .4rem 0; border-bottom: 1px solid rgba(20, 17, 13, .1); font-size: .82rem; }
.watchshop-line-img { width: 56px; height: 70px; object-fit: cover; background: #e8ddc8; flex: 0 0 auto; }
.watchshop-line-main { display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 0; }
.watchshop-line-name { line-height: 1.3; }
.watchshop-line-spec { font-size: .7rem; color: rgba(20, 17, 13, .55); }
.watchshop-line-price { opacity: .6; font-size: .75rem; }
.watchshop-line-qty { display: inline-flex; align-items: center; gap: .5rem; margin-top: .2rem; }
.watchshop-line-qty span { min-width: 1.1rem; text-align: center; font-size: .85rem; font-weight: 600; }
.watchshop-line-qty button { width: 2.25rem; height: 2.25rem; border: 1px solid rgba(20, 17, 13, .25); background: transparent; color: inherit; cursor: pointer; line-height: 1; border-radius: 6px; font-size: 1.05rem; }
.watchshop-line-qty button:hover { background: #14110d; color: #f5efe3; }
.watchshop-line-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: .4rem; flex: 0 0 auto; }
.watchshop-line-del { background: transparent; border: 0; color: #a06a4a; cursor: pointer; font-size: .68rem; letter-spacing: .06em; text-decoration: underline; padding: 0; }
.watchshop-drawer-foot { border-top: 1px solid rgba(20, 17, 13, .18); padding-top: 1rem; display: flex; flex-direction: column; gap: .85rem; }
.watchshop-drawer-freight { font-size: .78rem; color: rgba(20, 17, 13, .8); padding-bottom: .35rem; }
.watchshop-drawer-total { display: flex; justify-content: space-between; align-items: baseline; font-size: .8rem; letter-spacing: .08em; }
.watchshop-drawer-total strong { font-size: 1.05rem; color: #8a5a3a; }
.watchshop-drawer-actions { display: flex; gap: .6rem; }
.watchshop-btn-ghost { flex: 0 0 auto; background: transparent; border: 1px solid rgba(20, 17, 13, .3); color: inherit; padding: .7rem 1rem; cursor: pointer; letter-spacing: .08em; text-transform: uppercase; font-size: .62rem; }
.watchshop-btn-ghost:hover { background: rgba(20, 17, 13, .06); }
.watchshop-checkout { flex: 1; background: #14110d; color: #f5efe3; border: 0; padding: .85rem 1rem; cursor: pointer; letter-spacing: .08em; text-transform: uppercase; font-size: .68rem; }
.watchshop-checkout:hover { background: #241d14; }

/* ------------------------------ 登录弹窗 ------------------------------ */
.watchshop-login-mask {
  position: fixed; inset: 0; z-index: 10020; background: rgba(12, 10, 7, .6);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 1.25rem;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.watchshop-login-mask.is-visible { opacity: 1; pointer-events: auto; }
.watchshop-login-card { position: relative; width: min(420px, 100%); background: #f5efe3; color: #14110d; padding: 2.4rem 2rem 1.8rem; box-shadow: 0 30px 70px rgba(12, 10, 7, .4); font-family: Inter, sans-serif; }
.watchshop-login-close { position: absolute; top: .7rem; right: .9rem; background: transparent; border: 0; font-size: 1.4rem; line-height: 1; color: rgba(20, 17, 13, .6); cursor: pointer; }
.watchshop-login-kicker { font-size: .62rem; letter-spacing: .28em; text-transform: uppercase; opacity: .6; }
.watchshop-login-title { font-family: "Bodoni Moda", serif; font-weight: 500; font-size: 1.8rem; margin: .5rem 0 .4rem; }
.watchshop-login-sub { font-size: .78rem; line-height: 1.5; opacity: .7; margin: 0 0 1.4rem; }
.watchshop-login-form { display: flex; flex-direction: column; gap: .35rem; }
.watchshop-login-label { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; opacity: .65; margin-top: .6rem; }
.watchshop-login-input { border: 1px solid rgba(20, 17, 13, .25); background: #fff; padding: .7rem .8rem; font: inherit; color: inherit; outline: none; }
.watchshop-login-input:focus { border-color: #14110d; }
.watchshop-login-agree { display: flex; align-items: flex-start; gap: .5rem; font-size: .7rem; line-height: 1.4; margin: .9rem 0 .2rem; opacity: .8; }
.watchshop-login-agree span { flex: 1; }
.watchshop-login-error { background: rgba(180, 60, 40, .1); color: #a4301c; font-size: .72rem; padding: .5rem .6rem; border-left: 3px solid #a4301c; }
.watchshop-login-submit { margin-top: .9rem; background: #14110d; color: #f5efe3; border: 0; padding: .9rem 1rem; letter-spacing: .12em; text-transform: uppercase; font-size: .72rem; cursor: pointer; }
.watchshop-login-submit:disabled { opacity: .6; cursor: default; }
.watchshop-login-links { display: flex; justify-content: space-between; margin-top: 1.1rem; font-size: .72rem; }
.watchshop-login-links a { color: #8a5a3a; }
.watchshop-policy-link { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: #8a5a3a; text-decoration: underline; cursor: pointer; }
.watchshop-policy-link:hover { color: #14110d; }

/* ------------------------------ 协议弹层 ------------------------------ */
.watchshop-policy-mask {
  position: fixed; inset: 0; z-index: 10020; background: rgba(12, 10, 7, .6);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 1.25rem;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.watchshop-policy-mask.is-visible { opacity: 1; pointer-events: auto; }
.watchshop-policy-card { display: flex; flex-direction: column; width: min(760px, 92vw); max-height: 80vh; background: #f5efe3; color: #2a2118; box-shadow: 0 30px 70px rgba(12, 10, 7, .4); }
.watchshop-policy-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.4rem; border-bottom: 1px solid rgba(20, 17, 13, .15); }
.watchshop-policy-title { font-family: "Bodoni Moda", serif; font-size: 1.2rem; font-weight: 500; }
.watchshop-policy-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; color: rgba(20, 17, 13, .6); cursor: pointer; }
.watchshop-policy-body { padding: 1.2rem 1.4rem; overflow-y: auto; line-height: 1.8; font-size: .86rem; }
.watchshop-policy-body h1, .watchshop-policy-body h2, .watchshop-policy-body h3 { font-family: "Bodoni Moda", serif; line-height: 1.4; margin: 1rem 0 .5rem; }
.watchshop-policy-body a { color: #8a5a3a; }
.watchshop-policy-hint { opacity: .6; }

/* ------------------------------ 运费提示可点 ------------------------------ */
.watchshop-drawer-freight.is-link,
.watch-detail-freight.is-link {
  cursor: pointer;
  color: #8a5a3a;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.watchshop-drawer-freight.is-link:hover,
.watch-detail-freight.is-link:hover { color: #14110d; }

/* ------------------------------ 清空购物车确认层（盖住整个抽屉） ------------------------------ */
.watchshop-confirm-mask {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: rgba(12, 10, 7, .55);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.watchshop-confirm-mask.is-visible { opacity: 1; pointer-events: auto; }
.watchshop-confirm-card {
  width: 100%; max-width: 320px; padding: 1.5rem 1.4rem 1.3rem;
  border-radius: 10px; background: #f5efe3; color: #14110d;
  box-shadow: 0 24px 60px rgba(12, 10, 7, .35);
}
.watchshop-confirm-card h3 {
  margin: 0 0 .5rem;
  font-family: "Bodoni Moda", serif;
  font-size: 1.15rem; font-weight: 500;
}
.watchshop-confirm-card p {
  margin: 0 0 1.2rem;
  font-size: .78rem; line-height: 1.55;
  color: rgba(20, 17, 13, .68);
}
.watchshop-confirm-actions { display: flex; gap: .6rem; justify-content: flex-end; }
.watchshop-confirm-danger {
  border: 1px solid #a4301c; border-radius: 4px; background: #a4301c; color: #fff;
  padding: .62rem 1rem; cursor: pointer;
  font: 600 .66rem/1 Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase;
  transition: background .2s ease;
}
.watchshop-confirm-danger:hover:not(:disabled) { background: #852614; }
.watchshop-confirm-danger:disabled { opacity: .6; cursor: not-allowed; }

/* ------------------------------ 账号入口（登录 / 退出） ------------------------------ */
/* 胶囊浮在屏幕右侧、与导航同一水平线；首页由 JS 给导航右侧让出 146px，避免盖住 GALLERY。
   详情页 / 列表页没有 GALLERY，直接贴顶部第一行。 */
#watchshop-account {
  position: fixed; top: 1.1rem; right: 1.25rem; z-index: 10000;
  display: inline-flex; align-items: center; gap: .45rem;
  max-width: min(220px, 62vw);
  padding: .28rem .34rem .28rem .66rem;
  border-radius: 999px;
  background: rgba(20, 17, 13, .72);
  color: #e8cf9a;
  border: 1px solid rgba(198, 161, 91, .42);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
  backdrop-filter: blur(8px);
  font: 500 .63rem/1 Inter, sans-serif;
  letter-spacing: .05em;
  white-space: nowrap;
  transition: border-color .2s ease, background .2s ease;
}
#watchshop-account:hover {
  border-color: rgba(198, 161, 91, .68);
  background: rgba(20, 17, 13, .86);
}
/* 首页：JS 把 top 设成 GALLERY 的中心点，这里只用 translateY 把自己居中 */
/* 首页：纯文字，直接嵌进导航行；字号/行高/字距全部继承导航，所以水平位置天然对齐。
   颜色用金色，和 SHOP / CATEGORIES / GALLERY 的白色区分开。 */
#watchshop-account.is-inline {
  position: static;
  inset: auto;
  z-index: auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  color: #c6a15b;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
}
#watchshop-account.is-inline:hover {
  background: none;
  border: 0;
}
#watchshop-account.is-inline .watchshop-account-name {
  max-width: 120px;
  color: #c6a15b;
  opacity: .9;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;   /* Hi, XYF-4 不要全大写 */
}
#watchshop-account.is-inline .watchshop-account-btn {
  border: 0;
  border-bottom: 1px solid rgba(198, 161, 91, .55);
  border-radius: 0;
  background: none;
  color: #c6a15b;
  padding: 0 0 1px;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
#watchshop-account.is-inline .watchshop-account-btn:hover {
  color: #f5efe3;
  border-bottom-color: #f5efe3;
}
#watchshop-account .watchshop-account-name {
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #e8cf9a;
  opacity: .9;
}
#watchshop-account .watchshop-account-btn {
  border: 1px solid rgba(198, 161, 91, .38);
  border-radius: 999px;
  background: transparent;
  color: #e8cf9a;
  padding: .26rem .52rem;
  font: inherit;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
#watchshop-account .watchshop-account-btn:hover {
  background: #c6a15b;
  color: #14110d;
  border-color: #c6a15b;
}

/* ------------------------------ 加购反馈 ------------------------------ */
.watchshop-particle {
  position: fixed; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; z-index: 10040;
  animation: watchshopParticle .85s cubic-bezier(.15, .7, .3, 1) forwards;
}
@keyframes watchshopParticle {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--tx), var(--ty)) scale(.4); opacity: 0; }
}
.watchshop-cart.watchshop-bounce { animation: watchshopCartBounce .55s ease; }
@keyframes watchshopCartBounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px) scale(1.04); }
  60% { transform: translateY(0) scale(.98); }
}

/* ------------------------------ 无障碍 ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .watchshop-particle { display: none; }
  .watchshop-cart.watchshop-bounce { animation: none; }
  .watchshop-drawer { transition: none; }
}
