/* ===========================================================
   天鴻商行 — 自訂樣式 (Custom site styles)
   由 index.html inline <style> 搬遷至此，方便長遠維護。
   =========================================================== */

/* --- CSS Variables --- */
:root {
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- Base typography --- */
body {
    font-family: 'PingFang TC','Microsoft JhengHei','Heiti TC','PMingLiU','Arial', sans-serif;
    background-color: var(--site-bg);
}
h1, h2, h3, h4, h5, h6 {
    font-family: 'PingFang TC','Microsoft JhengHei','Heiti TC','PMingLiU','Arial', serif;
    text-wrap: balance;
}

/* --- Utility --- */
.no-scroll { overflow: hidden; }

/* --- FAQ details --- */
.faq-details > summary::-webkit-details-marker { display: none; }
.faq-details .faq-caret { transition: transform 0.3s ease; }
.faq-details[open] .faq-caret { transform: rotate(180deg); }

/* --- Brand scroller --- */
@keyframes scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}
.start-scrolling .brands-animation {
    animation: scroll 40s linear infinite;
}
#brands-container:hover .brands-animation {
    animation-play-state: paused;
}

/* --- Footer brand --- */
#site-footer .brand-wrap,
#site-footer .brand-wrap * {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    -webkit-text-stroke: 0 !important;
    text-decoration: none !important;
}
#site-footer .brand-name {
    font-family: "PingFang TC","Microsoft JhengHei","Heiti TC","PMingLiU","Arial",sans-serif;
    letter-spacing: 0.02em;
}
#site-footer a:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* --- No-scroll reveal animations --- */
html { scroll-behavior: auto !important; }
.animate-in,
.content-fade-in,
.animate-when-visible,
.reveal-on-scroll,
.fade-in-up,
.fade-up,
.scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
}
.is-visible {
    opacity: 1 !important;
    transform: none !important;
}

/* --- Responsive Tables (rtable) ---
   Mobile-first: convert tables into stacked cards on small screens */
@media (max-width: 768px) {
  .rtable-wrap { overflow: visible !important; }
  table.rtable {
    width: 100% !important;
    min-width: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }
  table.rtable thead { display: none !important; }
  table.rtable tbody,
  table.rtable tr,
  table.rtable td,
  table.rtable th {
    display: block !important;
    width: 100% !important;
  }
  table.rtable tr {
    margin: 0 0 12px 0 !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    background: #fff !important;
  }
  table.rtable td,
  table.rtable th {
    padding: 10px 12px !important;
    border: 0 !important;
  }
  table.rtable td + td,
  table.rtable th + td,
  table.rtable td + th {
    border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
  }
  table.rtable td::before,
  table.rtable th::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    line-height: 1.2;
    opacity: 0.75;
    margin-bottom: 4px;
    font-weight: 600;
  }
  table.rtable td[data-label=""]::before,
  table.rtable th[data-label=""]::before {
    display: none;
  }
}

/* ===========================================================
   New 2026-04 — UI Refresh
   =========================================================== */

/* --- Category card top bar + hover border ---
   按品類用色：酒紅 / 海藍 / 古銅 / 紫 / 金 */
.cat-card {
  position: relative;
  overflow: hidden;
}
.cat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--cat-color, #0ea5e9);
  z-index: 3;
}
.cat-card[data-cat="wine"]         { --cat-color: #7f1d1d; }
.cat-card[data-cat="seafood"]      { --cat-color: #0369a1; }
.cat-card[data-cat="collectibles"] { --cat-color: #92400e; }
.cat-card[data-cat="luxury"]       { --cat-color: #6d28d9; }
.cat-card[data-cat="gold"]         { --cat-color: #b45309; }
.cat-card:hover {
  border-color: var(--cat-color, #0ea5e9) !important;
  box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--cat-color, #0ea5e9) 35%, transparent);
}
.cat-card .cat-more {
  color: var(--cat-color, #0369a1);
}
.cat-card:hover .cat-more {
  filter: brightness(0.9);
}

/* Category chip displayed over image top-left */
.cat-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--cat-color, #0ea5e9);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  z-index: 3;
}

/* --- Pricing range bar --- */
.pbar {
  position: relative;
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
  max-width: 180px;
}
.pbar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #0891b2, #0ea5e9);
  border-radius: 999px;
}
.pbar-fill.is-muted {
  background: linear-gradient(90deg, #94a3b8, #cbd5e1);
}

/* --- Topic badges (精選專題) --- */
.topic-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.topic-badge.is-hot {
  background: #fee2e2;
  color: #b91c1c;
}
.topic-badge.is-new {
  background: #dcfce7;
  color: #166534;
}

/* --- Storefront inset image --- */
.shop-inset {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 168px;
  z-index: 10;
  transform: rotate(3deg);
  transition: transform 0.4s var(--ease-out-quart);
}
.shop-inset:hover {
  transform: rotate(0deg) scale(1.03);
}
.shop-inset img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  border: 3px solid #ffffff;
}
@media (max-width: 640px) {
  .shop-inset { display: none; }
}
