/* ==========================================================================
   雫之洞悉 · 返魂堂 · 日式款待全站側滑購物車樣式表 (cart.css)
   ========================================================================== */

/* 懸浮購物車圓形按鈕 */
.floating-cart-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--forest-deep, #253B2F);
  color: var(--paper, #F8F4EC);
  border: 1.5px solid var(--gold-accent, #C5A059);
  box-shadow: 0 8px 24px rgba(37, 59, 47, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 998;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.floating-cart-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(37, 59, 47, 0.38);
  border-color: #E2C785;
}
.floating-cart-btn:active {
  transform: scale(0.92);
}
@keyframes cartBounce {
  0% { transform: scale(1); }
  25% { transform: scale(1.18) rotate(-6deg); }
  50% { transform: scale(0.96) rotate(4deg); }
  75% { transform: scale(1.06) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.floating-cart-btn.bounce {
  animation: cartBounce 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.floating-cart-btn svg {
  width: 24px;
  height: 24px;
  stroke: var(--paper, #F8F4EC);
  fill: none;
}
.cart-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--gold-accent, #C5A059);
  color: #1A1A1A;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  line-height: 20px;
  border-radius: 10px;
  text-align: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  border: 1.5px solid var(--paper, #F8F4EC);
  display: none;
}
.cart-badge-count.show {
  display: block;
}
@keyframes badgePulse {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); opacity: 1; }
}
.cart-badge-count.pop {
  animation: badgePulse 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 購物車遮罩 */
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.cart-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* 購物車側滑抽屜 */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  background: var(--paper, #F8F4EC);
  border-left: 1px solid var(--gold-border, rgba(184, 145, 46, 0.28));
  box-shadow: -10px 0 40px rgba(0,0,0,0.18);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cart-drawer.open {
  transform: translateX(0);
}

/* 抽屜標題列 */
.cart-drawer-header {
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--gold-border, rgba(184, 145, 46, 0.22));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-drawer-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--forest-deep, #253B2F);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-sub, #6B645C);
  padding: 6px;
  border-radius: 50%;
  line-height: 1;
  transition: all 0.2s ease;
}
.cart-close-btn:hover {
  color: var(--forest-deep, #253B2F);
  background: var(--paper-deep, #ECE3D2);
}
.cart-close-btn:active {
  transform: scale(0.9);
}

/* 購物車內容清單 */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cart-item-card {
  display: flex;
  gap: 14px;
  background: #FFFDF9;
  border: 1px solid rgba(184, 145, 46, 0.18);
  border-radius: 8px;
  padding: 12px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cart-item-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.cart-item-thumb {
  width: 68px;
  height: 68px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--paper-deep, #ECE3D2);
  border: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.cart-item-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-right: 18px;
}
.cart-item-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--forest-deep, #253B2F);
  line-height: 1.35;
}
.cart-item-pillar {
  font-size: 10px;
  color: var(--gold-accent, #C5A059);
  margin-top: 2px;
}
.cart-item-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.cart-item-price {
  font-weight: 700;
  color: var(--forest-soft, #486E58);
  font-size: 0.95rem;
}
.cart-qty-ctrl {
  display: flex;
  align-items: center;
  border: 1px solid var(--gold-border, rgba(184, 145, 46, 0.3));
  border-radius: 4px;
  background: var(--paper, #F8F4EC);
}
.cart-qty-btn {
  background: transparent;
  border: none;
  width: 26px;
  height: 26px;
  font-size: 14px;
  cursor: pointer;
  color: var(--forest-deep, #253B2F);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-qty-btn:hover {
  background: var(--paper-deep, #ECE3D2);
}
.cart-qty-btn:active {
  transform: scale(0.88);
  background: var(--paper-deep, #ECE3D2);
}
.cart-qty-val {
  min-width: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-ink, #2D2926);
}
.cart-item-del {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: #A0988E;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s ease, transform 0.15s ease;
}
.cart-item-del:hover {
  color: #C24136;
}
.cart-item-del:active {
  transform: scale(0.85);
}

/* 購物車為空狀態 */
.cart-empty-state {
  text-align: center;
  margin: auto;
  padding: 40px 20px;
  color: var(--text-sub, #6B645C);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cart-empty-icon-wrap {
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(197, 160, 89, 0.12) 0%, transparent 70%);
}
.cart-zen-svg {
  width: 56px;
  height: 56px;
  stroke: var(--forest, #355343);
  animation: floatZen 4s ease-in-out infinite;
}
@keyframes floatZen {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.cart-empty-haiku {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--gold-accent, #C5A059);
  font-weight: 600;
  margin-bottom: 8px;
}
.cart-empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--forest-deep, #253B2F);
  margin-bottom: 8px;
}
.cart-empty-sub {
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-sub, #6B645C);
  max-width: 280px;
  margin: 0 auto 24px;
}
.cart-empty-cta {
  font-size: 0.88rem !important;
  padding: 10px 24px !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(37, 59, 47, 0.22);
}

/* 抽屜底層結帳列 */
.cart-drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--gold-border, rgba(184, 145, 46, 0.22));
  background: #FFFDF9;
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.cart-summary-label {
  font-size: 0.9rem;
  color: var(--text-sub, #6B645C);
}
.cart-total-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--forest-deep, #253B2F);
}
.cart-shipping-tip {
  font-size: 11px;
  color: #7D756C;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cart-checkout-btn {
  width: 100%;
  padding: 14px;
  background: var(--forest-deep, #253B2F);
  color: var(--paper, #F8F4EC);
  border: 1px solid var(--gold-accent, #C5A059);
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  text-decoration: none;
}
.cart-checkout-btn:hover {
  background: var(--forest, #355343);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 59, 47, 0.25);
}
.cart-checkout-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 8px rgba(37, 59, 47, 0.2);
}
.cart-clear-link {
  display: block;
  text-align: center;
  font-size: 12px;
  color: #948C82;
  margin-top: 10px;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
}
.cart-clear-link:hover {
  color: #C24136;
}

/* 加入購物車 Toast 動態通知（所作與殘心餘韻高斯模糊淡出） */
.cart-toast {
  position: fixed;
  bottom: 96px;
  right: 28px;
  background: rgba(37, 59, 47, 0.94);
  color: var(--paper, #F8F4EC);
  border: 1px solid var(--gold-accent, #C5A059);
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  opacity: 0;
  transform: translateY(12px);
  filter: blur(4px);
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cart-toast.show {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0px);
}

/* ==========================================================================
   首頁精選商品列表元件樣式 (#shop)
   ========================================================================== */
.shop-section {
  padding: clamp(48px, 7vw, 84px) 20px;
  max-width: 1140px;
  margin: 0 auto;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 32px;
}
.shop-card {
  background: #FFFDF9;
  border: 1px solid var(--gold-border, rgba(184, 145, 46, 0.22));
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 18px rgba(0,0,0,0.03);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
.shop-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-accent, #C5A059);
  box-shadow: 0 12px 28px rgba(53, 83, 67, 0.09);
}
.shop-card-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--gold-light, rgba(197, 160, 89, 0.15));
  color: var(--gold-accent, #C5A059);
  border: 1px solid rgba(197, 160, 89, 0.35);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.shop-card-img-wrap {
  width: 100%;
  height: 180px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--paper-deep, #ECE3D2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.shop-card:hover .shop-card-img {
  transform: scale(1.05);
}
.shop-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--forest-deep, #253B2F);
  margin-bottom: 6px;
  line-height: 1.35;
}
.shop-card-desc {
  font-size: 0.85rem;
  color: var(--text-sub, #6B645C);
  line-height: 1.6;
  margin-bottom: 18px;
  flex: 1;
}
.shop-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(184, 145, 46, 0.15);
  padding-top: 14px;
}
.shop-card-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--forest-deep, #253B2F);
}
.shop-card-price span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-sub, #6B645C);
}
.shop-add-btn {
  background: var(--forest-deep, #253B2F);
  color: var(--paper, #F8F4EC);
  border: 1px solid var(--gold-accent, #C5A059);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.shop-add-btn:hover {
  background: var(--forest, #355343);
  transform: translateY(-1px);
}
.shop-add-btn:active {
  transform: translateY(1px) scale(0.95);
}

/* ==========================================================================
   行動版體驗與觸控最佳化 (Mobile UX & Safe Area Insets)
   ========================================================================== */
@media (max-width: 600px) {
  .floating-cart-btn {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    right: 18px;
    width: 52px;
    height: 52px;
  }
  .cart-drawer {
    width: 100vw;
  }
  .cart-drawer-header {
    padding: calc(16px + env(safe-area-inset-top, 0px)) 18px 14px;
  }
  .cart-close-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 50%;
  }
  .cart-drawer-body {
    padding: 16px 18px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .cart-drawer-footer {
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .cart-qty-ctrl {
    border-radius: 6px;
  }
  .cart-qty-btn {
    width: 34px;
    height: 34px;
    font-size: 16px;
    touch-action: manipulation;
  }
  .cart-qty-val {
    min-width: 28px;
    font-size: 13px;
  }
  .cart-item-del {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    top: 4px;
    right: 4px;
  }
  .cart-toast {
    left: 16px;
    right: 16px;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    justify-content: center;
    font-size: 0.82rem;
    padding: 10px 14px;
  }
  .shop-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ==========================================================================
   LINE Pay 日式款待過渡畫面 (Hospitality Transition Screen)
   ========================================================================== */
.linepay-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(248, 246, 240, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.linepay-transition-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.linepay-transition-modal {
  text-align: center;
  max-width: 420px;
  width: 90%;
  padding: 36px 24px;
  background: #FFFFFF;
  border: 1px solid rgba(184, 145, 46, 0.3);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(43, 61, 49, 0.15);
  animation: modalFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.linepay-transition-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 20px;
  border: 3px solid rgba(184, 145, 46, 0.2);
  border-top-color: #06C755;
  border-radius: 50%;
  animation: linepaySpin 0.9s linear infinite;
}
@keyframes linepaySpin {
  to { transform: rotate(360deg); }
}
.linepay-transition-brand {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: #B8912E;
  margin-bottom: 8px;
  font-weight: 600;
}
.linepay-transition-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #2B3D31;
  margin-bottom: 8px;
  line-height: 1.4;
}
.linepay-transition-subtitle {
  font-size: 0.85rem;
  color: #635A4F;
  margin-bottom: 16px;
  line-height: 1.6;
}
.linepay-transition-badge {
  display: inline-block;
  font-size: 11px;
  color: #058A3C;
  background: rgba(6, 199, 85, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  border: 1px solid rgba(6, 199, 85, 0.25);
}