/* ═══ CATEGORY PAGE — Shared Styles ═══ */

/* ─ Category Hero ─ */
.cat-hero {
  padding: calc(var(--nav-h) + 48px) 32px 48px;
  text-align: center; position: relative; overflow: hidden;
}
.cat-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(212,168,67,.06) 0%, transparent 70%);
}
.cat-hero-inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.cat-hero-icon {
  width: 72px; height: 72px; border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem; margin-bottom: 20px;
}
.cat-hero-icon.ea-bg { background: var(--gold-bg); border: 1px solid var(--gold-d); }
.cat-hero-icon.ind-bg { background: rgba(96,165,250,.1); border: 1px solid rgba(96,165,250,.2); }
.cat-hero-icon.crs-bg { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.2); }
.cat-hero-icon.sig-bg { background: rgba(168,85,247,.1); border: 1px solid rgba(168,85,247,.2); }

.cat-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800;
  letter-spacing: -.03em; margin-bottom: 12px;
}
.cat-hero p { color: var(--fg2); font-size: 1.02rem; line-height: 1.7; margin-bottom: 28px; max-width: 560px; margin-left: auto; margin-right: auto; }

.cat-hero-stats {
  display: flex; gap: 32px; justify-content: center; flex-wrap: wrap;
}
.cat-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cat-stat-val { font-size: 1.3rem; font-weight: 800; color: var(--gold); font-family: var(--font-mono); }
.cat-stat-lbl { font-size: .72rem; color: var(--fg3); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

/* ─ Products Section ─ */
.cat-products-section { padding: 40px 32px 60px; max-width: 1200px; margin: 0 auto; }
.products-grid {
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: center;
}
.products-grid > .product-card {
  width: calc(25% - 18px); min-width: 220px; max-width: 320px;
}

/* ─ Product Card ─ */
.product-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-xl); overflow: visible;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  display: flex; flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
  border-color: var(--gold-d);
}
.product-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.product-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.product-card-name { font-size: 1rem; font-weight: 800; color: var(--fg); margin-bottom: 2px; word-break: break-word; }
.product-card-version { font-size: .74rem; color: var(--fg3); font-family: var(--font-mono); }
.product-card-desc {
  font-size: .84rem; color: var(--fg2); line-height: 1.7;
  margin-bottom: 16px; flex: 1;
}
.product-card-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 99px; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; width: fit-content;
}
.badge-ea { background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold-d); }
.badge-indicator { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(96,165,250,.3); }
.badge-course { background: var(--green-bg); color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.badge-signal { background: rgba(168,85,247,.1); color: #a855f7; border: 1px solid rgba(168,85,247,.3); }

/* Tags */
.product-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.product-tag {
  padding: 3px 10px; border-radius: 6px; font-size: .74rem; font-weight: 600;
  background: var(--bg3); color: var(--fg2); border: 1px solid var(--border);
}

/* Stats row */
.product-stats {
  display: flex; gap: 16px; padding: 14px 0; margin-bottom: 14px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.product-stat { flex: 1; text-align: center; }
.product-stat .label { font-size: .72rem; color: var(--fg3); margin-bottom: 2px; }
.product-stat .value { font-size: .92rem; font-weight: 700; color: var(--fg); }

/* ─ Empty / Coming Soon ─ */
.products-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 48px 20px; color: var(--fg3);
  background: var(--bg2); border: 1px dashed var(--border);
  border-radius: var(--r-lg);
}
.products-empty .icon { font-size: 2rem; margin-bottom: 12px; }

/* ─ EA Type Sections ─ */
.products-grid.ea-typed {
  display: flex; flex-direction: column; gap: 48px; align-items: stretch;
}
.ea-type-section {
  width: 100%;
}
.ea-type-header {
  font-size: 1.25rem; font-weight: 800; color: var(--gold);
  margin-bottom: 4px; display: flex; align-items: center; gap: 10px;
}
.ea-type-icon { font-size: 1.3rem; }
.ea-type-desc {
  font-size: .84rem; color: var(--fg3); margin-bottom: 20px; line-height: 1.5;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.ea-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.ea-type-grid > .product-card {
  width: 100% !important; max-width: 100% !important; min-width: unset !important;
}
@media (max-width: 1024px) { .ea-type-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .ea-type-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .ea-type-grid { grid-template-columns: 1fr; } }

/* ─ Setup Guide ─ */
.setup-section { max-width: 1100px; margin: 0 auto; padding: 0 32px 60px; }
.setup-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.setup-box {
  background: var(--bg2); border: 1px solid var(--border-s);
  border-radius: var(--r-lg); padding: 24px;
}
.setup-box h3 { font-size: .95rem; font-weight: 700; color: var(--gold); margin-bottom: 14px; }

/* ═══ PRODUCT DETAIL OVERLAY ═══ */
.detail-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: var(--bg); overflow-y: auto;
  animation: detailFadeIn .3s ease;
}
.detail-overlay.active { display: block; }
@keyframes detailFadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.detail-back {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 14px 32px; display: flex; align-items: center; gap: 10px;
}
.detail-back-btn {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 18px; color: var(--fg2); font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: all .2s; display: flex; align-items: center; gap: 6px;
}
.detail-back-btn:hover { border-color: var(--gold-d); color: var(--gold); }

.detail-container { max-width: 820px; margin: 0 auto; padding: 40px 32px 80px; }

.detail-header { margin-bottom: 32px; }
.detail-badge-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.detail-title {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 800;
  letter-spacing: -.02em; margin-bottom: 6px; line-height: 1.25;
}
.detail-version { font-family: var(--font-mono); font-size: .82rem; color: var(--fg3); }
.detail-update { font-size: .78rem; color: var(--fg3); margin-top: 6px; }

.detail-stats-bar {
  display: flex; gap: 16px; flex-wrap: wrap;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 24px; margin-bottom: 28px;
}
.detail-stat { flex: 1; min-width: 100px; text-align: center; }
.detail-stat .label { font-size: .72rem; color: var(--fg3); margin-bottom: 2px; }
.detail-stat .value { font-size: 1rem; font-weight: 700; color: var(--fg); }

.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.detail-tag {
  padding: 5px 14px; border-radius: 8px; font-size: .8rem; font-weight: 600;
  background: var(--bg3); color: var(--fg2); border: 1px solid var(--border);
}

.detail-desc {
  font-size: .95rem; line-height: 1.85; color: var(--fg2); margin-bottom: 32px;
}
.detail-desc strong { color: var(--fg); }
.detail-desc ul { margin: 8px 0 12px 8px; padding-left: 18px; list-style: disc; }
.detail-desc li { margin-bottom: 4px; }

.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.detail-actions .btn {
  flex: 1; min-width: 180px; text-align: center; padding: 14px 24px;
  font-size: .95rem; font-weight: 700; border-radius: 12px;
}

.detail-video-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; text-align: center;
}
.detail-video-box a {
  display: inline-flex; align-items: center; gap: 8px;
  color: #e05555; font-weight: 700; font-size: .95rem; text-decoration: none;
}
.detail-video-box a:hover { opacity: .8; }

/* ═══ BROKER CTA IN PRODUCT DETAIL ═══ */
.detail-broker-cta {
  margin-top: 48px; padding-top: 40px;
  border-top: 2px solid var(--border);
}
.detail-broker-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 28px;
}
.detail-broker-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(212,168,67,.15), rgba(212,168,67,.05));
  border: 1px solid var(--gold-d);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; flex-shrink: 0;
}
.detail-broker-header h3 {
  font-size: 1.2rem; font-weight: 800; margin: 0 0 4px;
  background: linear-gradient(135deg, var(--gold), #e8c547);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.detail-broker-header p {
  font-size: .88rem; color: var(--fg2); margin: 0; line-height: 1.5;
}
.detail-broker-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.detail-broker-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px 20px;
  text-align: center; transition: all .25s;
  display: flex; flex-direction: column;
}
.detail-broker-card:hover {
  border-color: var(--gold-d); box-shadow: 0 4px 20px rgba(212,168,67,.12);
  transform: translateY(-2px);
}
.detail-broker-top { margin-bottom: 10px; }
.detail-broker-name {
  font-size: 1.05rem; font-weight: 800; color: var(--fg);
}
.detail-broker-desc {
  font-size: .78rem; color: var(--fg3); line-height: 1.6;
  margin-bottom: 16px; flex: 1;
}
.detail-broker-invite {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg3); border: 1px dashed var(--border);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 14px;
  font-size: .78rem;
}
.detail-broker-invite .invite-label {
  color: var(--fg3); font-weight: 500;
}
.detail-broker-invite .invite-code {
  font-family: var(--font-mono); font-weight: 700; color: var(--gold);
  letter-spacing: .03em;
}
.detail-broker-invite .invite-copy-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 10px; font-size: .72rem; color: var(--fg2); cursor: pointer;
  transition: all .2s; font-weight: 600;
}
.detail-broker-invite .invite-copy-btn:hover {
  border-color: var(--gold-d); color: var(--gold);
}
.detail-broker-btn {
  width: 100%; padding: 12px 16px !important;
  font-size: .9rem !important; border-radius: 10px !important;
  margin-bottom: 8px;
}
.detail-broker-free {
  font-size: .76rem; color: var(--green); font-weight: 600;
}
.detail-broker-note {
  text-align: center; font-size: .82rem; color: var(--fg3);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 20px; line-height: 1.6;
}

/* ─ Nav Active ─ */
.nav-active { color: var(--gold) !important; font-weight: 600 !important; }

/* ═══ CONTACT POPUP — styles moved to shared.css ═══ */

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .cat-hero { padding: calc(var(--nav-h) + 30px) 20px 32px; }
  .cat-products-section { padding: 24px 16px 40px; }
  .products-grid > .product-card { width: 100%; max-width: 100%; min-width: unset; }
  .setup-section { padding: 0 16px 40px; }
  .setup-grid { grid-template-columns: 1fr; }
  .detail-back { padding: 12px 16px; }
  .detail-container { padding: 24px 16px 60px; }
  .detail-stats-bar { flex-direction: column; gap: 12px; }
  .detail-stat { text-align: left; display: flex; justify-content: space-between; }
  .detail-actions { flex-direction: column; }
  .detail-actions .btn { min-width: unset; }
  .detail-broker-grid { grid-template-columns: 1fr; }
  .detail-broker-header { flex-direction: column; text-align: center; }
  .detail-broker-invite { flex-wrap: wrap; justify-content: center; }
}
