/* ============================================================
   AI Product Engine — Product Page Styles
   Scoped under .ape-product-main to avoid theme conflicts.
   ============================================================ */

:root {
  --ape-bg:       #0d0f14;
  --ape-surface:  #161a22;
  --ape-border:   rgba(255,255,255,.08);
  --ape-accent:   #f5a623;
  --ape-accent2:  #e8562a;
  --ape-text:     #e8e6e1;
  --ape-muted:    #8a8a8a;
  --ape-pro:      #2dcc7a;
  --ape-con:      #e8562a;
  --ape-warn:     #f5a623;
  --ape-r:        10px;
  --ape-r-lg:     16px;
  --ff-head:      'Bebas Neue', 'Impact', sans-serif;
  --ff-body:      'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Wrapper ── */
.ape-product-main {
  background: var(--ape-bg);
  padding: 0 0 40px;
  font-family: var(--ff-body);
}

.ape-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 28px;
  color: var(--ape-text);
}

.ape-product-main a { color: var(--ape-accent); text-decoration: none; }
.ape-product-main a:hover { text-decoration: underline; }
.ape-product-main img { max-width: 100%; height: auto; }
.ape-product-main *, .ape-product-main *::before, .ape-product-main *::after { box-sizing: border-box; }

/* ── Breadcrumb ── */
.ape-breadcrumb {
  padding: 20px 0 8px;
  font-size: 13px;
  color: var(--ape-muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.ape-breadcrumb a { color: var(--ape-muted); }
.ape-breadcrumb a:hover { color: var(--ape-accent); text-decoration: none; }

/* ── Admin notice (only shown to logged-in admins, dismissible) ── */
.ape-admin-notice {
  background: rgba(245,166,35,.08);
  border: 1px dashed rgba(245,166,35,.4);
  border-radius: var(--ape-r);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--ape-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.ape-notice-icon { font-size: 18px; flex-shrink: 0; }
.ape-notice-body { flex: 1; }
.ape-admin-notice strong { color: #fff; }
.ape-notice-btn {
  display: inline-block;
  margin-left: 12px;
  padding: 4px 12px;
  background: var(--ape-accent);
  color: #000 !important;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
}
.ape-notice-btn:hover { opacity: .85; }
.ape-notice-dismiss {
  background: none;
  border: none;
  color: var(--ape-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  flex-shrink: 0;
  line-height: 1;
}
.ape-notice-dismiss:hover { color: #fff; }

/* ── Hero ── */
.ape-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 32px 0 48px;
  align-items: start;
}
@media (max-width: 700px) {
  .ape-hero { grid-template-columns: 1fr; gap: 24px; }
}

/* Image panel */
.ape-img-panel {}
.ape-main-img-wrap {
  position: relative;
  background: var(--ape-surface);
  border-radius: var(--ape-r-lg);
  border: 1px solid var(--ape-border);
  overflow: hidden;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ape-main-img-wrap img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 20px;
}
.ape-main-img-wrap::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(to bottom, var(--ape-accent), var(--ape-accent2));
  border-radius: 4px 0 0 4px;
}
.ape-gallery-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.ape-gallery-thumbs img {
  width: 56px; height: 56px;
  object-fit: contain;
  border-radius: 6px;
  border: 2px solid var(--ape-border);
  cursor: pointer;
  background: var(--ape-surface);
  padding: 4px;
  transition: border-color .2s;
}
.ape-gallery-thumbs img:hover,
.ape-gallery-thumbs img.ape-active { border-color: var(--ape-accent); }

/* Info panel */
.ape-info-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 6px;
}
.ape-cat-tag {
  display: inline-block;
  background: rgba(245,166,35,.12);
  color: var(--ape-accent);
  border: 1px solid rgba(245,166,35,.3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  width: fit-content;
  text-decoration: none !important;
}
.ape-cat-tag:hover { background: rgba(245,166,35,.2); text-decoration: none !important; }

.ape-product-title {
  font-family: var(--ff-head);
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.05;
  letter-spacing: .02em;
  color: #fff;
  margin: 0;
}

.ape-rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ape-stars { color: var(--ape-accent); font-size: 15px; letter-spacing: 2px; }
.ape-rating-num { font-size: 14px; color: #fff; font-weight: 600; }
.ape-rating-count { font-size: 13px; color: var(--ape-muted); }

.ape-price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ape-price {
  font-family: var(--ff-head);
  font-size: 36px;
  color: #fff;
  letter-spacing: .02em;
}
.ape-price-note { font-size: 12px; color: var(--ape-muted); }

/* ── Verdict box (inside hero) ── */
.ape-verdict-box {
  background: rgba(245,166,35,.06);
  border: 1px solid rgba(245,166,35,.25);
  border-radius: var(--ape-r);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}
.ape-verdict-item {}
.ape-verdict-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ape-muted);
  margin-bottom: 4px;
}
.ape-verdict-value {
  font-size: 13px;
  color: var(--ape-text);
  font-weight: 500;
  line-height: 1.4;
}
.ape-verdict-value.good { color: var(--ape-pro); }
.ape-verdict-value.bad  { color: var(--ape-con); }

.ape-rating-bar-wrap {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ape-rating-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  overflow: hidden;
}
.ape-rating-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ape-accent), var(--ape-accent2));
  border-radius: 3px;
  transition: width .6s ease;
}
.ape-rating-score { font-family: var(--ff-head); font-size: 20px; color: #fff; min-width: 36px; }

/* ── Buy button ── */
.ape-btn-amazon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ape-accent);
  color: #000 !important;
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: 15px;
  padding: 15px 24px;
  border-radius: var(--ape-r);
  border: none;
  cursor: pointer;
  transition: background .2s, transform .15s;
  text-decoration: none !important;
  line-height: 1;
}
.ape-btn-amazon:hover {
  background: #fbbf24;
  transform: translateY(-2px);
  text-decoration: none !important;
  color: #000 !important;
}
.ape-btn-amazon svg { flex-shrink: 0; }

.ape-trust-badges { display: flex; gap: 16px; flex-wrap: wrap; }
.ape-badge { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ape-muted); }
.ape-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ape-pro); flex-shrink: 0; }

/* ── Sections ── */
.ape-section { padding: 40px 0; border-top: 1px solid var(--ape-border); }

.ape-sec-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ape-accent);
  margin-bottom: 8px;
}
.ape-sec-title {
  font-family: var(--ff-head);
  font-size: clamp(22px, 3vw, 30px);
  color: #fff;
  letter-spacing: .03em;
  margin-bottom: 16px;
}

/* ── Editorial ── */
.ape-editorial p {
  color: var(--ape-text);
  font-size: 16px;
  line-height: 1.85;
  margin-bottom: 14px;
}
.ape-editorial p:last-child { margin-bottom: 0; }

/* ── Features ── */
.ape-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.ape-feat-card {
  background: var(--ape-surface);
  border: 1px solid var(--ape-border);
  border-radius: var(--ape-r);
  padding: 20px;
  transition: border-color .2s;
}
.ape-feat-card:hover { border-color: rgba(245,166,35,.3); }
.ape-feat-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(245,166,35,.1);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  font-size: 18px;
}
.ape-feat-card h4 { font-size: 14px; font-weight: 600; color: #fff; margin: 0 0 6px; }
.ape-feat-card p  { font-size: 13px; color: var(--ape-muted); line-height: 1.55; margin: 0; }

/* ── Pros & Cons ── */
.ape-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 520px) { .ape-pros-cons { grid-template-columns: 1fr; } }

.ape-pros-box, .ape-cons-box {
  background: var(--ape-surface);
  border-radius: var(--ape-r);
  padding: 20px;
}
.ape-pros-box { border: 1px solid rgba(45,204,122,.2); }
.ape-cons-box { border: 1px solid rgba(232,86,42,.2); }
.ape-pros-box h4 { color: var(--ape-pro); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 12px; }
.ape-cons-box h4 { color: var(--ape-con); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 12px; }
.ape-pc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ape-pc-list li { display: flex; gap: 10px; font-size: 14px; color: var(--ape-text); align-items: flex-start; line-height: 1.5; }
.ape-pc-list li::before {
  flex-shrink: 0; margin-top: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; line-height: 1;
}
.ape-pros-box .ape-pc-list li::before { content: '✓'; background: rgba(45,204,122,.15); color: var(--ape-pro); }
.ape-cons-box .ape-pc-list li::before { content: '✕'; background: rgba(232,86,42,.15); color: var(--ape-con); }

/* ── Who Should Skip ── */
.ape-who-not-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}
.ape-who-not-card {
  background: rgba(232,86,42,.05);
  border: 1px solid rgba(232,86,42,.15);
  border-radius: var(--ape-r);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 16px;
  align-items: start;
}
.ape-who-not-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(232,86,42,.15);
  color: var(--ape-con);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
  flex-shrink: 0; margin-top: 1px;
}
.ape-who-not-content {}
.ape-who-not-reason { font-size: 14px; color: var(--ape-text); font-weight: 500; margin-bottom: 5px; line-height: 1.4; }
.ape-who-not-alt { font-size: 13px; color: var(--ape-muted); line-height: 1.4; }
.ape-who-not-alt strong { color: var(--ape-accent); font-weight: 600; }

/* ── Use Cases ── */
.ape-use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.ape-use-case-card {
  background: var(--ape-surface);
  border: 1px solid var(--ape-border);
  border-radius: var(--ape-r);
  padding: 20px;
  border-left: 3px solid var(--ape-accent);
  transition: border-color .2s;
}
.ape-use-case-card:hover { border-color: var(--ape-accent); border-left-color: var(--ape-accent2); }
.ape-use-case-scenario {
  font-size: 13px;
  font-weight: 700;
  color: var(--ape-accent);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.ape-use-case-outcome { font-size: 14px; color: var(--ape-text); line-height: 1.55; }

/* ── Audience ── */
.ape-audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.ape-aud-card {
  background: var(--ape-surface);
  border: 1px solid var(--ape-border);
  border-radius: var(--ape-r);
  padding: 18px 16px;
  text-align: center;
  transition: border-color .2s;
}
.ape-aud-card:hover { border-color: rgba(245,166,35,.3); }
.ape-aud-icon { font-size: 24px; margin-bottom: 8px; }
.ape-aud-card strong { display: block; font-size: 13px; color: #fff; margin-bottom: 5px; font-weight: 600; }
.ape-aud-card p { font-size: 12px; color: var(--ape-muted); line-height: 1.45; margin: 0; }

/* ── Comparison ── */
.ape-comparison-text {
  background: var(--ape-surface);
  border: 1px solid var(--ape-border);
  border-radius: var(--ape-r);
  padding: 24px 28px;
  margin-top: 20px;
  border-left: 3px solid rgba(245,166,35,.4);
}
.ape-comparison-text p {
  font-size: 15px;
  color: var(--ape-text);
  line-height: 1.8;
  margin: 0;
}

/* ── Micro-decisions ── */
.ape-micro-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
.ape-micro-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px 16px;
  align-items: center;
  background: var(--ape-surface);
  border: 1px solid var(--ape-border);
  border-radius: var(--ape-r);
  padding: 14px 18px;
  transition: border-color .2s;
}
.ape-micro-row:hover { border-color: rgba(245,166,35,.25); }
@media (max-width: 600px) {
  .ape-micro-row { grid-template-columns: 1fr; }
  .ape-micro-arrow { display: none; }
}
.ape-micro-condition { font-size: 13px; color: var(--ape-muted); line-height: 1.4; }
.ape-micro-condition em { font-style: normal; color: var(--ape-text); font-weight: 500; }
.ape-micro-arrow { color: var(--ape-accent); font-size: 18px; text-align: center; }
.ape-micro-action { font-size: 13px; color: var(--ape-text); line-height: 1.4; }

/* ── Specs table ── */
.ape-specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 14px;
}
.ape-specs-table tr { border-bottom: 1px solid var(--ape-border); }
.ape-specs-table tr:last-child { border-bottom: none; }
.ape-specs-table td { padding: 13px 6px; vertical-align: top; line-height: 1.4; }
.ape-specs-table td:first-child { color: var(--ape-muted); width: 38%; }
.ape-specs-table td:last-child  { color: var(--ape-text); font-weight: 500; }

/* ── CTA block ── */
.ape-cta-block {
  background: var(--ape-surface);
  border: 1px solid var(--ape-border);
  border-radius: var(--ape-r-lg);
  padding: 40px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: 40px 0;
}
.ape-cta-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ape-accent), var(--ape-accent2));
}
.ape-cta-block h3 {
  font-family: var(--ff-head);
  font-size: 32px;
  color: #fff;
  letter-spacing: .03em;
  margin: 0 0 8px;
}
.ape-cta-block p { color: var(--ape-muted); font-size: 14px; margin: 0 0 24px; line-height: 1.6; }
.ape-cta-block .ape-btn-amazon { max-width: 340px; margin: 0 auto; }
.ape-price-warning {
  margin-top: 14px;
  font-size: 12px;
  color: var(--ape-muted);
  font-style: italic;
}

/* ── Related products ── */
.ape-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.ape-rel-card {
  background: var(--ape-surface);
  border: 1px solid var(--ape-border);
  border-radius: var(--ape-r);
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.ape-rel-card:hover { border-color: rgba(245,166,35,.4); transform: translateY(-2px); }
.ape-rel-card img { width: 100%; aspect-ratio: 1/1; object-fit: contain; background: #1a1f28; padding: 12px; }
.ape-rel-card-body { padding: 12px; }
.ape-rel-card-body h5 {
  font-size: 13px; color: var(--ape-text); font-weight: 500;
  line-height: 1.4; margin: 0 0 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ape-rel-price { font-size: 14px; color: var(--ape-accent); font-weight: 600; margin-bottom: 10px; }
.ape-btn-sm {
  display: block; text-align: center;
  background: rgba(245,166,35,.1);
  color: var(--ape-accent);
  border: 1px solid rgba(245,166,35,.3);
  border-radius: 6px; padding: 7px 10px;
  font-size: 12px; font-weight: 600;
  transition: background .2s; text-decoration: none !important;
}
.ape-btn-sm:hover { background: rgba(245,166,35,.2); text-decoration: none !important; }

/* ── Shop loop: Amazon buy button (replaces WC "Unavailable") ── */
.ape-loop-buy-btn.button,
a.ape-loop-buy-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: #e47911 !important;        /* Amazon orange */
  color: #111 !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: .02em;
  text-decoration: none !important;
  transition: background .2s, transform .1s;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.ape-loop-buy-btn.button:hover,
a.ape-loop-buy-btn:hover {
  background: #f5a623 !important;
  color: #111 !important;
  text-decoration: none !important;
  transform: translateY(-1px);
}

/* ── Affiliate disclosure ── */
.ape-disclosure {
  font-size: 12px;
  color: var(--ape-muted);
  padding: 24px 0 40px;
  border-top: 1px solid var(--ape-border);
  line-height: 1.7;
}
.ape-disclosure strong { color: #ccc; }
