/* =====================================================
   Tapplaza Store v1.0.0 — Frontend CSS
   Inherits all CSS variables from the TapPlaza theme.
   ===================================================== */

/* ── PRODUCT GRID ── */
.tpst-grid {
  display: grid;
  gap: 24px;
  margin: 0;
}
.tpst-cols-1 { grid-template-columns: 1fr; }
.tpst-cols-2 { grid-template-columns: repeat(2, 1fr); }
.tpst-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tpst-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .tpst-cols-3, .tpst-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .tpst-cols-2, .tpst-cols-3, .tpst-cols-4 { grid-template-columns: 1fr; }
}

/* ── PRODUCT CARD ── */
.tpst-card {
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: var(--rlg, 14px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  position: relative;
}
.tpst-card:hover {
  transform: translateY(-3px);
  border-color: var(--bdr2);
  box-shadow: 0 8px 32px rgba(0,0,0,.32);
}
.tpst-card-featured {
  border-color: rgba(0,212,255,.3);
  box-shadow: 0 0 0 1px rgba(0,212,255,.12);
}
.tpst-card-featured-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--acc);
  color: #000;
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  z-index: 2;
}
.tpst-card-thumb-wrap {
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg2);
}
.tpst-card-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .25s;
}
.tpst-card:hover .tpst-card-thumb { transform: scale(1.03); }
.tpst-card-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  color: var(--t3);
}
.tpst-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}
.tpst-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.tpst-card-title {
  font-family: var(--ffd);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}
.tpst-card-title a { color: var(--t1); }
.tpst-card-title a:hover { color: var(--acc); }
.tpst-card-excerpt {
  font-size: .82rem;
  color: var(--t2);
  line-height: 1.55;
  margin: 0;
}
.tpst-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .78rem;
  color: var(--t3);
  margin-top: auto;
  padding-top: 8px;
}
.tpst-card-rating, .tpst-card-downloads {
  display: flex; align-items: center; gap: 4px;
}
.tpst-meta-val { color: var(--t1); font-weight: 600; }
.tpst-meta-muted { color: var(--t3); }
.tpst-meta-icon { color: var(--acc); }
.tpst-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bdr);
}
.tpst-card-price { display: flex; align-items: baseline; gap: 4px; }
.tpst-price-from { font-size: .72rem; color: var(--t3); }
.tpst-price-amount { font-size: 1.1rem; font-weight: 800; color: var(--t1); font-family: var(--ffd); }
.tpst-card-btn { font-size: .8rem !important; padding: 7px 16px !important; }

/* ── BADGES ── */
.tpst-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid;
}
.tpst-badge-plugin  { color: var(--acc);  border-color: rgba(0,212,255,.25); background: rgba(0,212,255,.06); }
.tpst-badge-theme   { color: var(--gold); border-color: rgba(245,166,35,.25); background: rgba(245,166,35,.06); }
.tpst-badge-bundle  { color: var(--grn);  border-color: rgba(0,230,118,.25); background: rgba(0,230,118,.06); }
.tpst-badge-addon   { color: var(--t2);   border-color: var(--bdr); background: var(--surf2); }
.tpst-badge-version { color: var(--t3);   border-color: var(--bdr); background: var(--surf2); }
.tpst-badge-featured { color: var(--gold); border-color: rgba(245,166,35,.25); background: rgba(245,166,35,.06); }

/* ── STARS ── */
.tpst-stars { display: inline-flex; gap: 1px; }
.tpst-star { font-size: .95em; }
.tpst-star-full  { color: var(--gold); }
.tpst-star-half  { color: var(--gold); opacity: .6; }
.tpst-star-empty { color: var(--bdr2); }

/* ─────────────────────────────────
   SINGLE PRODUCT PAGE
───────────────────────────────── */
.tpst-single { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* HERO */
.tpst-hero {
  padding: 40px 0 0;
}
.tpst-hero-inner { display: flex; gap: 32px; align-items: flex-start; }
.tpst-hero-left  { display: flex; gap: 24px; align-items: flex-start; flex: 1; }
.tpst-hero-thumb {
  width: 80px; height: 80px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--bdr);
  flex-shrink: 0;
}
.tpst-hero-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tpst-hero-info { flex: 1; }
.tpst-hero-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tpst-hero-title {
  font-family: var(--ffd);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--t1);
}
.tpst-hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: .82rem;
  margin-bottom: 14px;
}
.tpst-hero-rating, .tpst-hero-dl, .tpst-hero-updated {
  display: flex; align-items: center; gap: 5px;
}
.tpst-hero-links { display: flex; gap: 10px; flex-wrap: wrap; }

/* LAYOUT */
.tpst-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  margin-top: 32px;
  align-items: start;
}
@media (max-width: 900px) {
  .tpst-layout { grid-template-columns: 1fr; }
  .tpst-sidebar { order: -1; }
}

/* TABS */
.tpst-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--bdr);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.tpst-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--t2);
  font-family: var(--ffb);
  font-size: .82rem;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.tpst-tab:hover  { color: var(--t1); }
.tpst-tab.active { color: var(--acc); border-bottom-color: var(--acc); }
.tpst-tab-panel.tpst-hidden { display: none; }

/* CONTENT */
.tpst-content { color: var(--t1); line-height: 1.75; }
.tpst-content h2 { font-family: var(--ffd); font-size: 1.2rem; font-weight: 700; margin: 24px 0 12px; }
.tpst-content h3 { font-family: var(--ffd); font-size: 1rem; font-weight: 700; margin: 20px 0 8px; }
.tpst-content p { margin-bottom: 14px; }
.tpst-content ul, .tpst-content ol { padding-left: 20px; margin-bottom: 14px; }
.tpst-content li { margin-bottom: 4px; }
.tpst-content img { border-radius: 8px; }

/* TAGS */
.tpst-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tpst-tag {
  font-size: .72rem;
  color: var(--t2);
  background: var(--surf2);
  border: 1px solid var(--bdr);
  padding: 4px 12px;
  border-radius: 100px;
}

/* REQUIREMENTS */
.tpst-requirements {
  margin-top: 28px;
  padding: 20px;
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
}
.tpst-requirements h4 { font-family: var(--ffd); font-size: .85rem; font-weight: 700; margin: 0 0 12px; color: var(--t2); text-transform: uppercase; letter-spacing: .06em; }
.tpst-requirements ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.tpst-requirements li { font-size: .82rem; color: var(--t2); }
.tpst-requirements li strong { color: var(--t1); }

/* AUTHOR BOX */
.tpst-author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 28px;
  padding: 20px;
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
}
.tpst-author-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--acc);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #000;
  flex-shrink: 0;
}
.tpst-author-name { font-weight: 700; font-size: .9rem; margin-bottom: 4px; color: var(--t1); }
.tpst-author-bio { font-size: .82rem; color: var(--t2); margin: 0; line-height: 1.55; }

/* ── CHANGELOG ── */
.tpst-changelog-body { font-size: .85rem; line-height: 1.7; color: var(--t2); }
.tpst-cl-version {
  margin: 20px 0 8px;
}
.tpst-cl-ver-badge {
  display: inline-block;
  background: var(--surf2);
  border: 1px solid var(--bdr);
  border-left: 3px solid var(--acc);
  padding: 4px 12px;
  border-radius: 0 6px 6px 0;
  font-family: var(--ffd);
  font-size: .85rem;
  font-weight: 700;
  color: var(--t1);
}
.tpst-cl-item { padding: 2px 0 2px 8px; color: var(--t2); }

/* ── FAQ ── */
.tpst-faq-list { display: flex; flex-direction: column; gap: 1px; }
.tpst-faq-item { border: 1px solid var(--bdr); border-radius: var(--r); overflow: hidden; background: var(--surf); }
.tpst-faq-q {
  width: 100%;
  background: transparent;
  border: none;
  padding: 16px 20px;
  text-align: left;
  font-family: var(--ffb);
  font-size: .9rem;
  font-weight: 600;
  color: var(--t1);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: background .15s;
}
.tpst-faq-q:hover { background: var(--surf2); }
.tpst-faq-icon { font-size: 1.2rem; color: var(--acc); flex-shrink: 0; transition: transform .2s; }
.tpst-faq-q[aria-expanded="true"] .tpst-faq-icon { transform: rotate(45deg); }
.tpst-faq-a {
  display: none;
  padding: 0 20px 16px;
  font-size: .85rem;
  color: var(--t2);
  line-height: 1.65;
}
.tpst-faq-a.open { display: block; }

/* ── DOCS LINK ── */
.tpst-docs-link { padding: 40px; text-align: center; }
.tpst-docs-link p { color: var(--t2); margin-bottom: 20px; }

/* ─────────────────────────────────
   PRICING SIDEBAR
───────────────────────────────── */
.tpst-pricing-box {
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: var(--rlg, 14px);
  overflow: hidden;
  position: sticky;
  top: 80px;
}
.tpst-pricing-header {
  padding: 16px 20px;
  font-family: var(--ffd);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--t3);
  border-bottom: 1px solid var(--bdr);
  background: var(--bg2);
}
.tpst-plan {
  padding: 20px;
  border-bottom: 1px solid var(--bdr);
  position: relative;
}
.tpst-plan:last-of-type { border-bottom: none; }
.tpst-plan-highlighted {
  background: linear-gradient(135deg, rgba(0,212,255,.04) 0%, transparent 100%);
  border-color: rgba(0,212,255,.2) !important;
}
.tpst-plan-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--acc);
  color: #000;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 10px;
}
.tpst-plan-top { margin-bottom: 14px; }
.tpst-plan-name { font-size: .78rem; font-weight: 700; color: var(--t2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.tpst-plan-price {
  font-family: var(--ffd);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--t1);
  line-height: 1;
}
.tpst-plan-sym { font-size: 1rem; vertical-align: super; }
.tpst-plan-period { font-size: .72rem; font-weight: 400; color: var(--t3); margin-left: 4px; font-family: var(--ffb); }
.tpst-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tpst-plan-features li { font-size: .8rem; color: var(--t2); display: flex; gap: 8px; align-items: flex-start; }
.tpst-check { color: var(--grn); font-weight: 700; flex-shrink: 0; }

/* Trust badges */
.tpst-pricing-trust {
  padding: 16px 20px;
  background: var(--bg2);
  border-top: 1px solid var(--bdr);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tpst-trust-item { font-size: .75rem; color: var(--t3); }

/* Buy buttons from payment plugin */
.tppay-buy-btn {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin-bottom: 8px !important;
  border-radius: var(--r) !important;
}

/* ─────────────────────────────────
   REVIEWS
───────────────────────────────── */
.tpst-reviews-summary {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding: 24px;
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  margin-bottom: 28px;
}
.tpst-rv-avg { text-align: center; min-width: 80px; }
.tpst-rv-big { font-family: var(--ffd); font-size: 2.8rem; font-weight: 800; line-height: 1; color: var(--t1); }
.tpst-rv-total { font-size: .72rem; color: var(--t3); margin-top: 6px; }
.tpst-rv-bars { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tpst-rv-bar-row { display: flex; align-items: center; gap: 10px; font-size: .78rem; }
.tpst-rv-bar-label { color: var(--t2); width: 20px; text-align: right; }
.tpst-rv-bar-track { flex: 1; height: 6px; background: var(--bg3); border-radius: 100px; overflow: hidden; }
.tpst-rv-bar-fill  { height: 100%; background: var(--gold); border-radius: 100px; transition: width .4s; }
.tpst-rv-bar-count { color: var(--t3); width: 20px; }

/* Review items */
.tpst-reviews-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.tpst-review-item {
  padding: 20px;
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
}
.tpst-review-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.tpst-review-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--acc);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  flex-shrink: 0;
}
.tpst-review-author { font-weight: 600; font-size: .88rem; color: var(--t1); }
.tpst-review-date   { font-size: .72rem; color: var(--t3); }
.tpst-review-stars  { margin-left: auto; }
.tpst-review-title  { font-weight: 700; font-size: .88rem; color: var(--t1); margin-bottom: 6px; }
.tpst-review-body   { font-size: .85rem; color: var(--t2); line-height: 1.6; }
.tpst-no-reviews    { color: var(--t3); font-size: .85rem; padding: 20px 0; text-align: center; }

/* Review form */
.tpst-review-form-wrap {
  padding: 24px;
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
}
.tpst-review-form-wrap h4 { font-family: var(--ffd); font-size: 1rem; font-weight: 700; margin: 0 0 16px; }
.tpst-rv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tpst-rv-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.tpst-rv-field label { font-size: .78rem; font-weight: 600; color: var(--t2); }
.tpst-rv-field input,
.tpst-rv-field textarea {
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  color: var(--t1);
  font-family: var(--ffb);
  font-size: .85rem;
  padding: 9px 12px;
  width: 100%;
  outline: none;
  transition: border-color .15s;
}
.tpst-rv-field input:focus,
.tpst-rv-field textarea:focus { border-color: var(--acc); }

/* Star picker */
.tpst-rv-rating-picker { margin-bottom: 16px; }
.tpst-rv-rating-picker label { font-size: .78rem; font-weight: 600; color: var(--t2); display: block; margin-bottom: 8px; }
.tpst-star-picker { display: flex; gap: 4px; cursor: pointer; }
.tpst-pick-star {
  font-size: 1.6rem;
  color: var(--bdr2);
  transition: color .1s, transform .1s;
  line-height: 1;
  cursor: pointer;
}
.tpst-pick-star.active,
.tpst-pick-star:hover { color: var(--gold); transform: scale(1.15); }

#tpst-review-msg {
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: .82rem;
  margin-bottom: 14px;
  display: none;
}
#tpst-review-msg.tpst-msg-ok  { background: rgba(0,230,118,.1); border: 1px solid rgba(0,230,118,.3); color: var(--grn); display: block; }
#tpst-review-msg.tpst-msg-err { background: rgba(255,71,87,.1); border: 1px solid rgba(255,71,87,.3); color: var(--red); display: block; }

/* ── RELATED PRODUCTS ── */
.tpst-related {
  padding: 60px 0 0;
  border-top: 1px solid var(--bdr);
  margin-top: 60px;
}
.tpst-related .section-label { margin-bottom: 8px; }
.tpst-related .section-title { margin-bottom: 32px; }

/* ── PRICING PAGE ── */
.tpst-pricing-product-block { margin-bottom: 56px; }
.tpst-pp-title { font-family: var(--ffd); font-size: 1.3rem; font-weight: 700; color: var(--t1); margin-bottom: 24px; }
.tpst-pp-title a { color: inherit; }
.tpst-pp-title a:hover { color: var(--acc); }
.tpst-pricing-plans-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.tpst-pp-plan {
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tpst-pp-plan.tpst-plan-highlighted { border-color: rgba(0,212,255,.3); background: linear-gradient(135deg,rgba(0,212,255,.04) 0%,transparent 100%); }

/* ── DOCS HUB ── */
.tpst-docs-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 24px;
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  text-decoration: none;
  color: inherit;
  transition: border-color .18s, transform .18s;
}
.tpst-docs-card:hover { border-color: var(--acc); transform: translateY(-2px); }
.tpst-docs-icon { font-size: 1.8rem; }
.tpst-docs-name { font-weight: 700; font-size: .95rem; color: var(--t1); }
.tpst-docs-link-label { font-size: .78rem; color: var(--acc); margin-top: auto; }

/* ── EMPTY STATE ── */
.tpst-empty { padding: 40px; text-align: center; color: var(--t3); }

/* ── LIGHT MODE OVERRIDES ── */
body.light-mode .tpst-card          { background: var(--surf); }
body.light-mode .tpst-pricing-box   { background: var(--surf); }
body.light-mode .tpst-review-item   { background: var(--surf); }
body.light-mode .tpst-review-form-wrap { background: var(--surf); }
body.light-mode .tpst-requirements  { background: var(--surf); }
body.light-mode .tpst-author-box    { background: var(--surf); }
body.light-mode .tpst-faq-item      { background: var(--surf); }
body.light-mode .tpst-rv-field input,
body.light-mode .tpst-rv-field textarea { background: var(--bg2); }
