/* Reuse the shared Zenaconsult site CSS (copied into this vhost). */
@import url("assets/site.css");

/* Small compatibility mapping for existing product templates. */
.container{ max-width: var(--zh-wrap-max); margin:0 auto; padding:0 var(--zh-page-pad-x) 32px; }
.header{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin:18px 0 10px; }
.nav{ display:flex; gap:10px; align-items:center; }
.nav-link{ text-decoration:none; font-weight:800; }
.controls{ display:flex; flex-wrap:wrap; gap:12px; padding:14px; border-radius:16px; border:1px solid rgba(15,23,42,0.12); background:rgba(255,255,255,0.70); box-shadow: var(--zh-card-shadow); }
.field{ display:flex; flex-direction:column; gap:6px; min-width:220px; flex:1; }
.label{ font-size:12px; font-weight:800; color: var(--zh-muted); }
.input,.select{ padding:12px 12px; border-radius:14px; border:1px solid rgba(15,23,42,0.14); background: rgba(255,255,255,0.92); font:inherit; }
.input:focus,.select:focus{ outline:2px solid rgba(255,157,0,0.45); outline-offset:2px; }
.subtle{ color: var(--zh-muted); }
.zc-cat-lines{
  display:-webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow:hidden;
  /* Fallback for non-webkit */
  max-height: 2.9em;
}
.button{ display:inline-block; padding:12px 16px; border-radius:999px; background:var(--zh-accent); color:#0b1220; text-decoration:none; font-weight:800; border:1px solid transparent; box-shadow:0 10px 22px rgba(15,23,42,0.10); cursor:pointer; }
.button.secondary{ background:transparent; border-color:rgba(15,23,42,0.18); color:var(--zh-text); }

/* Ensure image boxes can host overlays */
.thumb,
.zc-thumb-mini{
  position:relative;
}

/* Corner badge (Top pick) */
.zc-corner-badge{
  --zc-badge: 66px;
  position:absolute;
  top:0;
  left:0;
  width:var(--zc-badge);
  height:var(--zc-badge);
  z-index:6;
  pointer-events:none;
  display:block;
  /* Desktop/default: crisp triangle like before */
  background: rgba(255,157,0,0.95);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  -webkit-clip-path: polygon(0 0, 100% 0, 0 100%);
  border-right: 1px solid rgba(15,23,42,0.18);
  border-bottom: 1px solid rgba(15,23,42,0.18);
  box-shadow: 0 14px 24px rgba(15,23,42,0.18);
}
.zc-corner-badge__star{
  position:absolute;
  top:8px;
  left:8px;
  font-size:18px;
  font-weight:1000;
  color:#0b1220;
  line-height:1;
  text-shadow: 0 1px 0 rgba(255,255,255,0.55);
}

/* List view thumbnail: slightly smaller corner badge */
.zc-thumb-mini .zc-corner-badge{
  --zc-badge: 58px;
}
.zc-thumb-mini .zc-corner-badge__star{
  top:9px;
  left:9px;
  font-size:16px;
}

/* Hide drawer-only Market section on desktop */
.zc-market-drawer{ display:none; }
@media (max-width:768px){
  .zc-market-drawer{ display:block; }
  .zc-market-desktop{ display:none !important; }
}

/* Catalog filters: no "Search & sort" button on desktop */
@media (min-width:769px){
  #zc-filters > summary{ display:none !important; }
  #zc-filters{ margin-top:12px; }
}

/* Filter actions row (Apply + layout icons) */
.zc-filter-actions{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:220px;
  flex:1;
  justify-content:flex-end;
}
.zc-apply{
  height:48px;
  min-height:48px;
  padding:0 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  line-height:1;
}
.zc-layout-toggle{
  display:inline-flex;
  gap:8px;
}
.zc-layout-btn{
  width:48px;
  height:48px;
  min-height:48px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:18px;
  border-radius:999px;
}
.zc-layout-btn.is-active{
  border-color: rgba(15,23,42,0.32);
  background: rgba(255,255,255,0.92);
}
@media (max-width:768px){
  .zc-layout-toggle{ display:none; }
}
.grid{ display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:12px; }
@media (max-width: 980px){ .grid{grid-template-columns: repeat(2, minmax(0, 1fr));} }
@media (max-width: 640px){ .grid{grid-template-columns: 1fr;} }
.card{ background:var(--zh-surface); border:1px solid rgba(15,23,42,0.12); border-radius:16px; overflow:hidden; box-shadow: var(--zh-card-shadow); display:flex; flex-direction:column; }
/* Uniform thumbnail box across all cards */
.thumb{
  height: clamp(180px, 22vw, 240px);
  background: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
}
.thumb img{
  width:100%;
  height:100%;
  max-height: 100%;
  object-fit: contain;
  background: rgba(255,255,255,0.85);
}
.thumb-fallback{ width:100%; height:100%; background: radial-gradient(700px 280px at 10% 10%, rgba(255,157,0,0.20), transparent 55%), rgba(255,255,255,0.65); }
.card-body{ padding:14px; display:flex; flex-direction:column; gap:10px; }
.card-body{
  display:grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap:10px;
  min-height: 260px;
}
.card-title{
  margin:0;
  font-size:15px;
  line-height:1.25;
  /* Reserve space for up to 5 lines, even if shorter */
  min-height: 6.25em;
  display:-webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow:hidden;
}
.price{ font-weight:900; }
.card-desc{ margin:0; font-size:13px; line-height:1.45; color: var(--zh-muted); }
.card-desc{
  /* Reserve space for up to 5 lines, even if shorter */
  min-height: 7.25em;
  display:-webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow:hidden;
}
.card-actions{ margin-top:auto; }
.card-actions-grid{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap:12px;
  align-items:center;
  justify-items:center;
}

/* Right side: QR + copy, equal size, together max 1/3 */
.card-actions-side{
  width:100%;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

/* Normalize ALL action buttons to identical height */
.zc-action{
  width:100%;
  height:48px;
  min-height:48px;
  padding:0 14px;
  line-height:1;
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}
.zc-action--buy{
  font-size:13px;
}
.zc-action--small{
  font-size:12px;
  padding:0 12px;
}

/* Mobile view: show full product title; make Buy button slimmer */
@media (max-width:980px){
  .card-title{
    min-height: 0 !important;
    display:block !important;
    -webkit-line-clamp: initial !important;
    -webkit-box-orient: initial !important;
    overflow: visible !important;
  }
  .card-actions-grid{
    grid-template-columns: 1fr !important;
    justify-items:stretch !important;
  }
  .zc-action--buy{ width:100% !important; }
  .card-actions-side{
    max-width: 340px;
    margin: 0 auto;
    justify-content:center;
  }
}

/* Small phones: avoid half-line clipping by showing full description */
@media (max-width:640px){
  .card-desc{
    min-height: 0 !important;
    display:block !important;
    -webkit-line-clamp: initial !important;
    -webkit-box-orient: initial !important;
    overflow: visible !important;
  }

  /* Mobile: remove "Copy link" button to keep actions compact. */
  button[data-zc-copy]{ display:none !important; }
}

/* Catalog-only: make mobile market flags centered + bigger */
@media (max-width:768px){
  /* Hide big "Search & sort" button; use hamburger icon instead */
  .zc-page-catalog #zc-filters > summary{ display:none !important; }

  .zc-page-catalog .zc-market-drawer{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:10px;
    width:100%;
    flex-wrap:nowrap;
    margin-top:6px;
  }
  /* Cancel header-actions auto-push so the whole pill centers */
  .zc-page-catalog .header-actions .zh-lang-switch{
    margin-left:0 !important;
    order:0 !important;
    justify-self:center;
  }
  .zc-page-catalog .zc-market-drawer .zh-lang-switch{
    width:fit-content !important;
    margin-left:auto !important;
    margin-right:0 !important;
    justify-content:center;
    padding:3px !important;
  }
  /* In mobile drawer we intentionally reuse the desktop pill. */
  .zc-page-catalog .zc-market-drawer .zc-lang-switch--desktop{
    display:inline-flex !important;
  }
  .zc-page-catalog .zc-market-drawer .zh-lang-switch a{
    min-width:38px;
    min-height:36px;
    padding:5px 10px;
    font-size:16px;
  }

  .zc-page-catalog .zc-market-drawer .zc-mobile-filters-btn{
    min-width:44px;
    min-height:36px;
    padding:5px 10px;
    border-radius:999px;
  }
}

/* Extra-small screens: slightly smaller Top Pick corner badge */
@media (max-width:480px){
  .zc-corner-badge{ --zc-badge: 58px; }
  .zc-corner-badge__star{ top:9px; left:9px; font-size:16px; }
}
/* QR codes (hidden on mobile) */
.empty{ padding:22px; border-radius:16px; border:1px dashed rgba(15,23,42,0.18); background:rgba(255,255,255,0.60); }
.footer{ margin-top:18px; font-size:12px; color: var(--zh-muted); }

.zc-table-wrap{ overflow:auto; border:1px solid rgba(15,23,42,0.10); border-radius:16px; background:rgba(255,255,255,0.70); }
.zc-table{ width:100%; border-collapse:collapse; min-width: 860px; }
.zc-table thead th{
  text-align:left;
  font-size:12px;
  color: var(--zh-muted);
  padding: 10px 12px;
  border-bottom:1px solid rgba(15,23,42,0.10);
}
.zc-table td{
  padding: 10px 12px;
  border-bottom:1px solid rgba(15,23,42,0.08);
  vertical-align:top;
}
.zc-table tr:last-child td{ border-bottom:none; }
.zc-thumb-mini{
  width:52px;
  height:52px;
  border-radius:12px;
  background: #fff;
  border:1px solid rgba(15,23,42,0.10);
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}
.zc-thumb-mini.is-large{
  width:140px;
  height:140px;
  border-radius:16px;
}
.zc-thumb-mini img{ width:100%; height:100%; object-fit:contain; background:#fff; }

/* List layout: stack actions under Buy button */
.zc-list-actions{
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:stretch;
}
.zc-list-actions-sub{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
/* QR codes (hidden on mobile) */
.zc-qr{
  width: var(--zc-qr-size, 56px);
  height: var(--zc-qr-size, 56px);
  border-radius:12px;
  border:1px solid rgba(15,23,42,0.10);
  background:#fff;
}
.zc-qrwrap{ position:relative; display:inline-flex; }
.zc-qrpop{
  display:none;
  position:absolute;
  right:0;
  bottom: calc(100% + 10px);
  padding:10px;
  border-radius:16px;
  background:rgba(255,255,255,0.98);
  border:1px solid rgba(15,23,42,0.12);
  box-shadow:0 26px 70px rgba(15,23,42,0.22);
  z-index:9999;
}
.zc-qrpop img{
  width: var(--zc-qr-pop, 180px);
  height: var(--zc-qr-pop, 180px);
  object-fit:contain;
  display:block;
  border-radius:14px;
  background:#fff;
}
.zc-qrwrap:hover .zc-qrpop{ display:block; }

/* Action buttons are normalized above */
/* "Mobile view": hide QR on narrower screens */
@media (max-width:980px){
  .zc-qr-action{ display:none !important; }
  .zc-footer-qr{ display:none !important; }
}

