/* ============================================================
   CP STYLE ORCHESTRATOR SAFE · v1.0.0
   Base segura para CalidadPrecio + Avada.
   Regla: si una entrada tiene CSS local, el CSS local gana.
   ============================================================ */

:root{
  --cp-black:#080c10;
  --cp-ink:#111820;
  --cp-text:#1d2a22;
  --cp-muted:#66756c;
  --cp-green:#0f7a36;
  --cp-green2:#16a34a;
  --cp-green-dark:#064e2c;
  --cp-green-soft:#edfdf3;
  --cp-green-soft2:#f5fff7;
  --cp-green-line:#bdebc9;
  --cp-purple:#7c19cf;
  --cp-purple-dark:#4b0b82;
  --cp-purple-soft:#f6edff;
  --cp-orange:#ff9900;
  --cp-gold:#ffb000;
  --cp-white:#ffffff;
  --cp-page:#f7fbf8;
  --cp-border:#dfeee4;
  --cp-border-strong:#bfe7ca;
  --cp-radius-sm:14px;
  --cp-radius-md:18px;
  --cp-radius-lg:24px;
  --cp-shadow-soft:0 10px 24px rgba(8,12,16,.06);
  --cp-shadow-card:0 18px 46px rgba(8,12,16,.10);
}

html,
body{
  overflow-x:hidden;
}

body.cpso-singular :where(.post-content,.entry-content,.fusion-post-content){
  overflow:visible;
}

/* Base de artículo: NO pinta fondos agresivos si la entrada tiene CSS local. */
body.cpso-singular :where(.cp-article){
  box-sizing:border-box;
  position:relative;
  width:100%;
  max-width:100%;
  min-width:0;
  margin:0 auto;
  padding:0;
  overflow:visible;
  color:var(--cp-ink);
  font-family:"Poppins","Manrope","Inter",Arial,sans-serif;
}

body.cpso-singular.cpso-no-local-css :where(.cp-article){
  background:#ffffff;
}

/* Full width real dentro de Avada, pero sin tocar entradas que no usan clases CP. */
body.cpso-singular.cpso-has-cp-article :where(.post-content,.entry-content,.fusion-post-content) > .cp-article,
body.cpso-singular.cpso-has-cp-article :where(.post-content,.entry-content,.fusion-post-content) .cp-article{
  width:100vw;
  max-width:100vw;
  margin-left:calc(50% - 50vw);
  margin-right:calc(50% - 50vw);
}

body.cpso-singular :where(.cp-article *, .cp-article *::before, .cp-article *::after){
  box-sizing:border-box;
}

body.cpso-singular :where(.cp-article .cp-wrap,
.cp-article .cp-container,
.cp-article .cp-inner,
.cp-wrap,
.cp-container,
.cp-inner){
  width:100%;
  max-width:1180px;
  min-width:0;
  margin-left:auto;
  margin-right:auto;
  padding-left:clamp(16px,3vw,28px);
  padding-right:clamp(16px,3vw,28px);
}

body.cpso-singular :where(.cp-article .cp-section,
.cp-article .cp-hero,
.cp-article .cp-section--light,
.cp-article .cp-section--soft,
.cp-article .cp-section--dark,
.cp-article .cp-fullbleed,
.cp-section,
.cp-hero,
.cp-section--light,
.cp-section--soft,
.cp-section--dark,
.cp-fullbleed){
  width:100%;
  max-width:none;
  min-width:0;
  margin-left:auto;
  margin-right:auto;
  overflow:hidden;
}

/* Solo fallback visual si NO hay CSS local en la publicación. */
body.cpso-singular.cpso-no-local-css :where(.cp-section:not(.cp-section--dark):not(.cp-section--soft):not(.cp-section--light):not(.cp-hero)){
  padding:clamp(34px,5vw,68px) 0;
  background:#ffffff;
}

body.cpso-singular.cpso-no-local-css :where(.cp-section--soft,.cp-section--light){
  padding:clamp(34px,5vw,68px) 0;
  background:linear-gradient(180deg,#ffffff 0%,var(--cp-green-soft2) 100%);
}

body.cpso-singular.cpso-no-local-css :where(.cp-section--dark){
  padding:clamp(34px,5vw,68px) 0;
  background:radial-gradient(circle at 12% 0%,rgba(34,197,94,.25),transparent 36%),linear-gradient(135deg,#051b12 0%,#17072c 100%);
  color:#ffffff;
}

body.cpso-singular.cpso-no-local-css :where(.cp-hero){
  padding:clamp(40px,6vw,86px) 0;
  background:linear-gradient(135deg,#f7fbf8 0%,#ffffff 52%,#f6edff 100%);
}

body.cpso-singular :where(.cp-grid,
.cp-checklist,
.cp-stats,
.cp-card-grid,
.cp-related-grid,
.cp-use-grid){
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:20px;
  align-items:stretch;
}

body.cpso-singular :where(.cp-hero-grid,
.cp-grid--split,
.cp-grid--media){
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(340px,520px);
  gap:clamp(24px,4vw,44px);
  align-items:center;
  width:100%;
  max-width:1180px;
  min-width:0;
  margin-left:auto;
  margin-right:auto;
}

body.cpso-singular :where(.cp-card,
.cp-product-card,
.cp-preview-card,
.cp-table-wrap,
.cp-product-plugin-slot,
.cp-asa-slot,
[class*="asa"]){
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
}

body.cpso-singular.cpso-no-local-css :where(.cp-card,.cp-product-card,.cp-preview-card,.cp-table-wrap,.cp-product-plugin-slot){
  background:#ffffff;
  border:1px solid var(--cp-border);
  border-radius:var(--cp-radius-lg);
  box-shadow:var(--cp-shadow-soft);
}

body.cpso-singular :where(.cp-card,.cp-product-card){
  padding:clamp(18px,2.4vw,28px);
}

body.cpso-singular :where(.cp-article img,
.cp-article .cp-img,
.cp-article picture,
.cp-article figure){
  max-width:100%;
}

body.cpso-singular :where(.cp-article img,.cp-article .cp-img){
  height:auto;
  object-fit:cover;
}

body.cpso-singular :where(.cp-table-wrap){
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
}

body.cpso-singular :where(.cp-table,.cp-table-wrap table){
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}

body.cpso-singular :where(.cp-btn,.cp-amazon-btn,.cp-table-btn){
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:42px;
  padding:11px 18px;
  border-radius:999px;
  text-decoration:none;
  font-weight:850;
  line-height:1.15;
}

body.cpso-singular.cpso-no-local-css :where(.cp-btn){
  background:linear-gradient(135deg,var(--cp-green),var(--cp-green2));
  color:#ffffff;
  box-shadow:0 12px 26px rgba(15,122,54,.18);
}

body.cpso-singular.cpso-no-local-css :where(.cp-amazon-btn,.cp-table-btn){
  background:linear-gradient(180deg,#ffd34d,#ff9900);
  color:#111820;
  box-shadow:0 12px 26px rgba(255,153,0,.22);
}

/* Oscuros: solo contraste de seguridad, sin cambiar fondos locales. */
body.cpso-singular :where(.cp-section--dark,
.cp-section--dark h1,
.cp-section--dark h2,
.cp-section--dark h3,
.cp-section--dark h4){
  color:#ffffff;
}

body.cpso-singular :where(.cp-section--dark p,
.cp-section--dark li,
.cp-section--dark span,
.cp-section--dark small,
.cp-section--dark strong,
.cp-section--dark b,
.cp-section--dark em){
  color:#eaf7ef;
}

body.cpso-singular :where(.cp-section--dark .cp-card--white,
.cp-section--dark .cp-card--white *,
.cp-section--dark .cp-preview-card,
.cp-section--dark .cp-preview-card *,
.cp-section--dark .cp-quick-card,
.cp-section--dark .cp-quick-card *,
.cp-section--dark .cp-use,
.cp-section--dark .cp-use *,
.cp-section--dark .cp-table-wrap,
.cp-section--dark .cp-table-wrap *){
  color:#132218;
  text-shadow:none;
  opacity:1;
  -webkit-text-fill-color:initial;
}

/* TOC y elementos flotantes: estructura mínima, diseño local puede sobreescribir. */
body.cpso-singular :where(.cp-article-toc,.cp-mobile-toc){
  box-sizing:border-box;
  font-family:"Poppins","Manrope","Inter",Arial,sans-serif;
}

@media(max-width:1200px){
  body.cpso-singular :where(.cp-hero-grid,.cp-grid--split,.cp-grid--media){
    grid-template-columns:1fr;
  }

  body.cpso-singular :where(.cp-article .cp-wrap,.cp-article .cp-container,.cp-article .cp-inner){
    max-width:100%;
    padding-left:20px;
    padding-right:20px;
  }
}

@media(max-width:760px){
  body.cpso-singular.cpso-has-cp-article :where(.post-content,.entry-content,.fusion-post-content) .cp-article,
  body.cpso-singular :where(.cp-article){
    width:100vw;
    max-width:100vw;
    margin-left:calc(50% - 50vw);
    margin-right:calc(50% - 50vw);
    overflow:hidden;
  }

  body.cpso-singular :where(.cp-article .cp-wrap,.cp-article .cp-container,.cp-article .cp-inner,.cp-wrap,.cp-container,.cp-inner){
    width:100%;
    max-width:100%;
    padding-left:16px;
    padding-right:16px;
  }

  body.cpso-singular :where(.cp-grid,.cp-checklist,.cp-stats,.cp-card-grid,.cp-hero-grid,.cp-grid--split,.cp-grid--media){
    grid-template-columns:1fr;
    gap:16px;
  }

  body.cpso-singular :where(.cp-article-toc){
    display:none;
  }
}

@media(max-width:420px){
  body.cpso-singular :where(.cp-wrap,.cp-container,.cp-inner){
    padding-left:12px;
    padding-right:12px;
  }

  body.cpso-singular :where(.cp-card,.cp-product-card){
    padding:16px;
  }
}
