/* =========================================================
   Base compartida de las páginas demo.
   Cada demo carga además su propio archivo (demo-taller.css, etc.)
   que define su paleta y sus componentes particulares.
   ========================================================= */

body.demo {
    --d-primary: #1f2933;
    --d-accent:  #f26b1d;
    --d-bg:      #ffffff;
    --d-soft:    #f4f5f7;
    --d-text:    #1d2530;
    --d-muted:   #5f6b7a;
    --d-line:    #e6e8ec;
    --d-radius:  12px;
    --d-bar-h:   44px;

    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: var(--d-text);
    background: var(--d-bg);
    line-height: 1.6;
    scroll-behavior: smooth;
}
html { scroll-behavior: smooth; }

/* Reinicio con :where() para que NO pese más que las clases de cada componente */
:where(body.demo) *, :where(body.demo) *::before, :where(body.demo) *::after { box-sizing: border-box; }
:where(body.demo) :where(h1, h2, h3, p, ul) { margin: 0; padding: 0; }
:where(body.demo) ul { list-style: none; }
:where(body.demo) a { color: inherit; }
:where(body.demo) [id] { scroll-margin-top: 120px; }

/* ---------- Barra "Estás viendo una demo" ---------- */
.demo-bar {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--d-bar-h);
    background: #111827;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px;
    font-size: 0.85rem;
}
.demo-bar a { text-decoration: none; }
.demo-bar__back { color: #cbd5e1; white-space: nowrap; }
.demo-bar__back:hover { color: #fff; }
.demo-bar__text { color: #cbd5e1; text-align: center; }
.demo-bar__text strong { color: #fff; }
.demo-bar__cta {
    background: #16c79a;
    color: #fff;
    font-weight: bold;
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ---------- Estructura ---------- */
.d-container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.d-header {
    position: sticky;
    top: var(--d-bar-h);
    z-index: 150;
    background: #fff;
    border-bottom: 1px solid var(--d-line);
}
.d-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
}
.d-brand { font-size: 1.25rem; font-weight: 800; color: var(--d-primary); text-decoration: none; }
.d-brand span { color: var(--d-accent); }
.d-nav { display: flex; align-items: center; gap: 22px; }
.d-nav a { text-decoration: none; font-weight: 500; color: var(--d-text); }
.d-nav a:hover { color: var(--d-accent); }

.d-section { padding: 70px 0; }
.d-section--soft { background: var(--d-soft); }
.d-title { text-align: center; font-size: 1.9rem; margin-bottom: 10px; color: var(--d-primary); }
.d-lead  { text-align: center; color: var(--d-muted); max-width: 620px; margin: 0 auto 40px; }

/* ---------- Botones ---------- */
.d-btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 10px;
    border: 2px solid transparent;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.d-btn:hover { transform: translateY(-2px); }
.d-btn--primary { background: var(--d-accent); color: #fff; }
.d-btn--ghost   { border-color: #fff; color: #fff; background: transparent; }
.d-btn--light   { background: #fff; color: #111827; }
.d-btn--block   { width: 100%; text-align: center; }
.d-btn--sm      { padding: 8px 18px; font-size: 0.9rem; }

/* ---------- Tarjetas ---------- */
.d-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.d-card {
    background: #fff;
    border: 1px solid var(--d-line);
    border-radius: var(--d-radius);
    padding: 26px;
}
.d-card__icon { font-size: 2rem; margin-bottom: 10px; }
.d-card h3 { font-size: 1.1rem; margin-bottom: 6px; color: var(--d-primary); }
.d-card p  { color: var(--d-muted); font-size: 0.95rem; }

/* ---------- Formularios ---------- */
.d-form {
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--d-line);
    border-radius: var(--d-radius);
    padding: 30px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.06);
}
.d-field { margin-bottom: 16px; }
.d-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.d-field input, .d-field select, .d-field textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cdd3dc;
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
.d-field input:focus, .d-field select:focus, .d-field textarea:focus {
    outline: 2px solid var(--d-accent);
    outline-offset: 1px;
}
.d-alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.95rem; }
.d-alert--error { background: #fdecec; color: #a12622; border: 1px solid #f5c2c0; }
.d-alert--ok    { background: #e8f8f2; color: #0d7a5c; border: 1px solid #b6e8d6; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* ---------- "Así lo vería el negocio": correo y WhatsApp simulados ---------- */
.d-sent { max-width: 760px; margin: 0 auto; }
.d-sent__title { text-align: center; font-size: 1.5rem; color: var(--d-primary); margin-bottom: 6px; }
.d-sent__sub { text-align: center; color: var(--d-muted); margin-bottom: 26px; }
.d-sent__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.d-sent__label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--d-muted); margin-bottom: 8px; }

.email-mock {
    background: #fff;
    border: 1px solid var(--d-line);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.9rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.email-mock__head { background: #f1f3f6; padding: 12px 16px; border-bottom: 1px solid var(--d-line); line-height: 1.7; }
.email-mock__body { padding: 16px; }
.email-mock__body li { margin: 4px 0; }

.wa-mock { background: #e5ddd5; border-radius: 10px; padding: 18px 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.wa-bubble {
    background: #dcf8c6;
    border-radius: 10px 10px 2px 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    max-width: 92%;
    margin-left: auto;
}
.wa-bubble small { display: block; text-align: right; color: #667781; margin-top: 4px; }

/* ---------- Pie con llamada a la acción de CTA ---------- */
.demo-cta-strip {
    background: #111827;
    color: #cbd5e1;
    text-align: center;
    padding: 36px 20px;
}
.demo-cta-strip p { max-width: 620px; margin: 0 auto 16px; }
.demo-cta-strip strong { color: #fff; }
.demo-cta-strip__link { display: inline-block; margin-left: 14px; color: #cbd5e1; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .demo-bar__text { display: none; }
    .d-nav a:not(.d-btn) { display: none; }
    .d-section { padding: 50px 0; }
    .d-title { font-size: 1.6rem; }
    .d-form { padding: 22px; }
}
