/* ============================================================
   Personalizador de placas memoriales -- pagina publica
   index.php?vista=personalizador (sin login).
   Todo queda bajo .pm-page para no afectar otras vistas.
   ============================================================ */

.pm-page {
    --pm-bg: #f5f1e8;
    --pm-card: #fffdf8;
    --pm-line: #e6dcc8;
    --pm-text: #1f2622;
    --pm-muted: #66706a;
    --pm-gold: #a8823a;
    --pm-gold-2: #d8b56a;
    --pm-gold-soft: #f4e9cf;
    --pm-deep: #12261d;
    --pm-deep-2: #1f4433;
    --pm-primary: #1d5a3f;
    --pm-primary-hover: #174a33;
    --pm-focus: #c49a45;
    --pm-shadow: 0 1px 2px rgba(31, 38, 34, .04), 0 12px 32px -12px rgba(31, 38, 34, .16);
    --pm-radius: 18px;
    --pm-serif: 'Cormorant Garamond', Georgia, serif;
    --pm-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    min-height: 100vh;
    font-family: var(--pm-sans);
    color: var(--pm-text);
    background:
        radial-gradient(1200px 500px at 85% 420px, rgba(216, 181, 106, .14), transparent 70%),
        radial-gradient(900px 500px at 0% 900px, rgba(29, 90, 63, .07), transparent 70%),
        var(--pm-bg);
}

html[data-theme="dark"] .pm-page {
    --pm-bg: #0f1412;
    --pm-card: #171e1a;
    --pm-line: #2b3631;
    --pm-text: #e9ece9;
    --pm-muted: #a2aca6;
    --pm-gold: #d8b56a;
    --pm-gold-soft: #2e2818;
    --pm-primary: #2a7a55;
    --pm-primary-hover: #33905f;
    --pm-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .6);
}

.pm-page *,
.pm-page *::before,
.pm-page *::after { box-sizing: border-box; }

/* css/style.css fija Poppins con el selector universal; aqui cada elemento
   hereda la fuente de su contenedor (los iconos .bx conservan la suya). */
:where(.pm-page) :where(:not(.bx)) { font-family: inherit; }

.pm-page i.bx { line-height: 1; }

/* ---------- Encabezado ---------- */
.pm-hero {
    position: relative;
    color: #f4efe3;
    padding: 18px 16px 120px;
    background:
        radial-gradient(700px 320px at 80% 0%, rgba(216, 181, 106, .22), transparent 70%),
        radial-gradient(600px 300px at 0% 100%, rgba(42, 122, 85, .35), transparent 70%),
        linear-gradient(160deg, var(--pm-deep) 0%, var(--pm-deep-2) 100%);
    overflow: hidden;
}

.pm-hero::after {
    /* Rombos finos de fondo, muy suaves */
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M22 6l6 16-6 16-6-16z' fill='none' stroke='%23d8b56a' stroke-opacity='.10'/%3E%3C/svg%3E");
    pointer-events: none;
}

.pm-hero__bar,
.pm-hero__content { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; }

.pm-hero__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.pm-hero__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .02em;
}

.pm-hero__brand img {
    height: 44px;
    width: auto;
    border-radius: 8px;
    background: rgba(255, 255, 255, .92);
    padding: 3px;
}

.pm-hero__actions { display: flex; align-items: center; gap: 8px; }

.pm-hero__icon,
.pm-hero__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(244, 239, 227, .25);
    background: rgba(255, 255, 255, .08);
    color: #f4efe3 !important;
    font: 500 14px/1 var(--pm-sans);
    text-decoration: none !important;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background .2s ease, border-color .2s ease;
}

.pm-hero__icon { width: 40px; padding: 0; justify-content: center; font-size: 19px; }

.pm-hero__icon:hover,
.pm-hero__back:hover { background: rgba(255, 255, 255, .16); border-color: rgba(244, 239, 227, .4); }

.pm-hero__content { padding-top: clamp(28px, 6vw, 56px); text-align: center; }

.pm-hero__eyebrow {
    display: inline-block;
    margin: 0 0 14px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(216, 181, 106, .45);
    color: var(--pm-gold-2) !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.pm-hero h1 {
    margin: 0 auto 14px;
    max-width: 760px;
    font-family: var(--pm-serif);
    font-weight: 600;
    font-size: clamp(32px, 5.2vw, 56px);
    line-height: 1.08;
    color: #fbf6ea;
    text-wrap: balance;
}

.pm-hero__lead {
    margin: 0 auto;
    max-width: 620px;
    font-size: clamp(15px, 1.6vw, 17px);
    line-height: 1.6;
    color: rgba(244, 239, 227, .82) !important;
}

.pm-hero__points {
    list-style: none;
    margin: 26px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 22px;
}

.pm-hero__points li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(244, 239, 227, .9) !important;
}

.pm-hero__points i { font-size: 19px; color: var(--pm-gold-2); }

/* ---------- Estructura ---------- */
.pm-demo {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    margin: -84px auto 0;
    padding: 0 16px 40px;
}

.pm-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
    gap: clamp(18px, 2.4vw, 32px);
    align-items: start;
}

.pm-card {
    background: var(--pm-card);
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius);
    box-shadow: var(--pm-shadow);
}

/* ---------- Vista previa ---------- */
.pm-preview { position: sticky; top: 16px; }

.pm-preview__card { padding: clamp(16px, 2vw, 24px); }

.pm-preview__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.pm-preview__head h2 {
    margin: 0;
    font-family: var(--pm-serif);
    font-size: 26px;
    font-weight: 600;
    color: var(--pm-text);
}

.pm-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(29, 90, 63, .1);
    color: var(--pm-primary);
    font-size: 12px;
    font-weight: 600;
}

html[data-theme="dark"] .pm-live { background: rgba(42, 122, 85, .22); color: #8fe0b5; }

.pm-live__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: pm-pulso 1.8s ease-in-out infinite;
}

@keyframes pm-pulso { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.pm-preview__selection { margin: 6px 0 16px; font-size: 13px; color: var(--pm-muted) !important; }

.pm-plaque-wrap {
    position: relative;
    padding: clamp(10px, 1.6vw, 18px);
    border-radius: 14px;
    background: linear-gradient(145deg, #e9e1d0, #d8cdb6);
}

html[data-theme="dark"] .pm-plaque-wrap { background: linear-gradient(145deg, #222b26, #1a211d); }

.pm-preview__note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 14px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--pm-muted) !important;
}

.pm-preview__note i { font-size: 16px; margin-top: 1px; }

/* ---------- Placa ----------
   Cada pieza (.pm-el) es movible: js/personalizador.js fija su
   left/top/width/height en px y --pm-esc (escala) segun la distribucion. */
.pm-plaque {
    --pm-height: 1px;
    position: relative;
    width: 100%;
    margin-inline: auto;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #070707;
    border-radius: 6px;
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .25);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    transition: filter .25s ease;
}

.pm-plaque__background { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }

.pm-el {
    --pm-esc: 1;
    position: absolute;
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--pm-ink-color, #f0d082);
    text-shadow: var(--pm-ink-shadow, 0 1px 2px #000);
}

.pm-el[hidden] { display: none; }

/* Fotografias con marco ovalado */
.pm-anillo { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pm-anillo ellipse { fill: none; vector-effect: non-scaling-stroke; }
.pm-anillo__grueso { stroke-width: var(--pm-anillo-grueso, 3px); }
.pm-anillo__fino { stroke-width: var(--pm-anillo-fino, 1px); }
.pm-metal-1 { stop-color: var(--pm-m1, #83601f); }
.pm-metal-2 { stop-color: var(--pm-m2, #c9a14e); }
.pm-metal-3 { stop-color: var(--pm-m3, #f8e3a2); }
.pm-metal-4 { stop-color: var(--pm-m4, #b4883a); }
.pm-metal-5 { stop-color: var(--pm-m5, #ecd089); }
.pm-metal-6 { stop-color: var(--pm-m6, #7c5a1c); }

.pm-rombo {
    position: absolute;
    left: 50%;
    width: calc(var(--pm-height) * .022 * var(--pm-esc));
    aspect-ratio: 1;
    transform: translate(-50%, -50%) rotate(45deg);
    background: linear-gradient(135deg, var(--pm-ring-1, #a87c2f), var(--pm-ring-2, #f6db97));
    pointer-events: none;
}
.pm-rombo--arriba { top: .6%; }
.pm-rombo--abajo { top: 99.4%; }

.pm-plaque__photo-box {
    position: absolute;
    inset: 3.7% 4.9%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.pm-plaque__photo-box img {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    object-fit: fill;
    pointer-events: none;
    user-select: none;
    transform-origin: center;
    will-change: transform;
}

.pm-plaque__photo-box img[hidden] { display: none; }
.pm-plaque__photo-box.pm-plaque__photo-box--active { cursor: grab; touch-action: none; }
.pm-plaque__photo-box.pm-plaque__photo-box--dragging { cursor: grabbing; }
.pm-plaque__photo-box:focus-visible { outline: 3px solid #fff4cb; outline-offset: -8px; }
.pm-el--foto.is-vacio .pm-plaque__photo-box { cursor: pointer; }

.pm-plaque__photo-box span {
    max-width: 80%;
    font-style: italic;
    font-size: calc(var(--pm-height) * .032 * var(--pm-esc));
    line-height: 1.4;
    opacity: .85;
}

/* Textos: js/personalizador.js fija el font-size de cada pieza (.pm-t)
   para que su contenido (.pm-in) quepa en la caja. */
.pm-t {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: calc(var(--pm-height) * .03);
}

.pm-in { width: 100%; display: flex; flex-direction: column; align-items: center; }
.pm-txt { display: block; max-width: 100%; overflow-wrap: break-word; text-wrap: balance; }
.pm-txt:empty { display: none; }

.pm-t--head .pm-txt { white-space: nowrap; font-weight: 700; letter-spacing: .08em; }

.pm-t--name { font-style: italic; }
.pm-nombre-txt { line-height: 1.12; }
.pm-nombre-sub { margin-top: .25em; font-size: max(.46em, calc(var(--pm-height) * .024)); line-height: 1.2; letter-spacing: .02em; opacity: .92; }

.pm-t--dates { font-style: italic; }
.pm-t--dates .pm-in { gap: .35em; }
.pm-f { line-height: 1.13; white-space: nowrap; }
.pm-t--dates .pm-divisor { margin-top: .3em; }

.pm-t--ded { font-style: italic; }
.pm-t--ded .pm-txt { line-height: 1.19; white-space: pre-line; }

.pm-t--foot { font-style: italic; }
.pm-t--foot .pm-in { gap: .6em; }
.pm-t--foot .pm-txt { line-height: 1.15; }

/* Letra manuscrita para los nombres */
.pm-plaque--manuscrita .pm-nombre-txt { font-family: 'Great Vibes', 'Brush Script MT', cursive; font-style: normal; line-height: 1.05; }
.pm-plaque--manuscrita .pm-nombre-sub { font-size: max(.34em, calc(var(--pm-height) * .024)); margin-top: .1em; }

/* Varias personas: sin separador bajo cada grupo de fechas */
.pm-plaque--varias .pm-t--dates .pm-divisor { display: none; }

/* Simbolo (cruz, paloma, corazones, laurel) */
.pm-el--simbolo svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .45)); }
.pm-plaque--blanco .pm-el--simbolo svg { filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .6)); }
.pm-simbolo-relleno { fill: url(#pm-metal-simbolo); }
.pm-simbolo-trazo { fill: none; stroke: url(#pm-metal-simbolo); stroke-linecap: round; stroke-linejoin: round; }
.pm-simbolo-hueco { fill: none; stroke: var(--pm-simbolo-hueco, #141416); stroke-linecap: round; stroke-linejoin: round; }

/* Forma de la foto: ovalo o arco */
.pm-anillo .pm-forma-arco { display: none; }
.pm-anillo path { fill: none; vector-effect: non-scaling-stroke; }
.pm-plaque--arco .pm-anillo .pm-forma-ovalo { display: none; }
.pm-plaque--arco .pm-anillo .pm-forma-arco { display: inline; }
.pm-plaque--arco .pm-plaque__photo-box { border-radius: 50% 50% 7% 7% / 36% 36% 5% 5%; }
.pm-plaque--arco .pm-rombo--arriba { display: none; }

/* Diseno "libro abierto": la placa es la silueta del libro */
.pm-plaque--libro { background: transparent; box-shadow: none; border-radius: 0; }
.pm-plaque--libro .pm-plaque__background { filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .45)); }

/* Separador: linea con un rombo al centro */
.pm-divisor {
    position: relative;
    display: block;
    width: 76%;
    height: max(1px, calc(var(--pm-height) * .003));
    background: linear-gradient(90deg, var(--pm-ring-2, #f6db97) 0 42%, transparent 42% 58%, var(--pm-ring-2, #f6db97) 58% 100%);
}

.pm-divisor::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--pm-height) * .02 * var(--pm-esc));
    aspect-ratio: 1;
    transform: translate(-50%, -50%) rotate(45deg);
    background: linear-gradient(135deg, var(--pm-ring-1, #a87c2f), var(--pm-ring-2, #f6db97));
}

/* Modo "Mover elementos" */
.pm-plaque--editando .pm-el { cursor: move; touch-action: none; outline: 1px dashed rgba(255, 255, 255, .5); outline-offset: 2px; }
.pm-plaque--blanco.pm-plaque--editando .pm-el { outline-color: rgba(0, 0, 0, .4); }
.pm-plaque--editando .pm-el:hover { outline-style: solid; }
.pm-plaque--editando .pm-el.is-seleccionado { outline: 2px solid var(--pm-gold-2, #d8b56a); }
.pm-plaque--editando .pm-plaque__photo-box { pointer-events: none; }

.pm-guia {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: rgba(216, 181, 106, .9);
    pointer-events: none;
    z-index: 5;
    display: none;
}

.pm-guia.is-visible { display: block; }

/* Marca de agua (solo pantalla) */
.pm-plaque__marca {
    position: absolute;
    inset: 0;
    background-repeat: repeat;
    background-size: 260px 170px;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.pm-plaque--blanco .pm-plaque__marca { filter: invert(1); mix-blend-mode: multiply; opacity: .55; }

/* ---------- Proteccion contra capturas (disuasiva) ---------- */
.pm-escudo {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 20px;
    border-radius: 14px;
    background: rgba(18, 38, 29, .55);
    color: #f4efe3;
}

.pm-escudo i { font-size: 38px; color: var(--pm-gold-2); }
.pm-escudo p { margin: 0; font-family: var(--pm-serif); font-size: 24px; font-weight: 600; color: #fbf6ea !important; }
.pm-escudo span { font-size: 13px; opacity: .85; }

.pm-demo.pm-protegido .pm-plaque { filter: blur(22px) saturate(.6); }
.pm-demo.pm-protegido .pm-escudo { display: flex; }

.pm-print-aviso { display: none; }

@media print {
    .pm-page { display: none !important; }
    .pm-print-aviso { display: block; padding: 40px; font: 18px/1.5 Georgia, serif; text-align: center; }
}

/* ---------- Editor de distribucion (debajo de la placa) ---------- */
.pm-editor { margin-top: 14px; }

.pm-editor__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.pm-editor__panel {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid var(--pm-line);
    border-radius: 12px;
    background: var(--pm-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.pm-editor__panel[hidden] { display: none; }
.pm-editor__panel p { margin: 0; flex: 1 1 200px; font-size: 13px; line-height: 1.45; color: var(--pm-muted) !important; }
.pm-editor__panel p strong { color: var(--pm-text) !important; }

.pm-editor__acciones { display: flex; gap: 6px; }

.pm-editor__acciones button {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--pm-line);
    border-radius: 10px;
    background: var(--pm-card);
    color: var(--pm-text);
    font: 600 13px/1 var(--pm-sans);
    cursor: pointer;
}

.pm-editor__acciones button:hover:not(:disabled) { border-color: var(--pm-gold); background: var(--pm-gold-soft); }
.pm-editor__acciones button:disabled { opacity: .45; cursor: not-allowed; }
.pm-editor__acciones i { font-size: 18px; }

/* ---------- Pasos ---------- */
.pm-steps { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.pm-step { padding: clamp(18px, 2.2vw, 26px); }

.pm-step__head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }

.pm-step__num {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--pm-gold-soft);
    border: 1px solid rgba(168, 130, 58, .35);
    color: var(--pm-gold);
    font-family: var(--pm-sans);
    font-size: 16px;
    font-weight: 700;
}

.pm-step__head h3 {
    margin: 2px 0 4px;
    font-family: var(--pm-serif);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.15;
    color: var(--pm-text);
}

.pm-step__head p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--pm-muted) !important; }

/* ---------- Campos ---------- */
.pm-field { margin-bottom: 16px; }
.pm-field:last-child { margin-bottom: 0; }

.pm-field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

.pm-page label,
.pm-fieldset legend {
    display: block;
    margin: 0 0 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pm-text);
}

.pm-page input[type="text"],
.pm-page input[type="tel"],
.pm-page input[type="date"],
.pm-page select,
.pm-page textarea {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--pm-line);
    border-radius: 12px;
    background: var(--pm-bg);
    color: var(--pm-text);
    font: 15px/1.4 var(--pm-sans);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.pm-page textarea { min-height: 92px; resize: vertical; }

.pm-page select {
    appearance: none;
    padding-right: 40px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a8823a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.pm-page input[type="text"]:focus,
.pm-page input[type="tel"]:focus,
.pm-page input[type="date"]:focus,
.pm-page select:focus,
.pm-page textarea:focus {
    outline: none;
    border-color: var(--pm-focus);
    background: var(--pm-card);
    box-shadow: 0 0 0 4px rgba(196, 154, 69, .18);
}

html[data-theme="dark"] .pm-page input[type="date"] { color-scheme: dark; }

.pm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.pm-grid-2 .pm-field { margin-bottom: 0; }

.pm-counter { font-size: 12px; font-weight: 600; color: var(--pm-muted); font-variant-numeric: tabular-nums; }

.pm-notice {
    margin: 4px 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
}

.pm-notice[hidden] { display: none; }
.pm-notice--warn { background: #fdf1e3; color: #7a4a14 !important; border: 1px solid #f0d3ac; }
.pm-notice--soft { background: var(--pm-gold-soft); color: #6a5221 !important; margin-top: 8px; }
.pm-notice--error { background: #fdecea; color: #a12a20 !important; border: 1px solid #f3c6c1; }

html[data-theme="dark"] .pm-notice--warn { background: #33261a; color: #f2c894 !important; border-color: #5a4126; }
html[data-theme="dark"] .pm-notice--soft { color: #e8cf96 !important; }
html[data-theme="dark"] .pm-notice--error { background: #3a1d1a; color: #ffb2a8 !important; border-color: #6a2f29; }

/* ---------- Fotografia ---------- */
.pm-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.pm-page .pm-upload__zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 24px 16px;
    border: 1.5px dashed rgba(168, 130, 58, .55);
    border-radius: 14px;
    background: var(--pm-bg);
    text-align: center;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.pm-upload__zone:hover { background: var(--pm-gold-soft); border-color: var(--pm-gold); }

.pm-upload__zone i { font-size: 34px; color: var(--pm-gold); }
.pm-upload__zone strong { font-size: 15px; color: var(--pm-text); }
.pm-upload__zone span { font-size: 13px; font-weight: 400; color: var(--pm-muted); overflow-wrap: anywhere; }

.pm-upload--extra { margin-top: 12px; }

.pm-page .pm-upload__zone--sm { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 14px 16px; text-align: left; }
.pm-upload__zone--sm i { font-size: 28px; flex: none; }
.pm-upload__texto { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pm-upload__zone em { font-style: normal; font-weight: 400; color: var(--pm-muted); }

.pm-link--danger { margin-top: 8px; color: #b3261e; }
html[data-theme="dark"] .pm-link--danger { color: #ff9b8f; }

.pm-tabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 12px;
    padding: 4px;
    border: 1px solid var(--pm-line);
    border-radius: 12px;
    background: var(--pm-bg);
}

.pm-tabs[hidden] { display: none; }

.pm-tabs button {
    padding: 8px 14px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--pm-muted);
    font: 600 13px/1 var(--pm-sans);
    cursor: pointer;
}

.pm-tabs button.is-active { background: var(--pm-card); color: var(--pm-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.pm-photo-tools { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--pm-line); }
.pm-photo-tools[hidden] { display: none; }
.pm-photo-tools__help { margin: 0 0 12px; font-size: 13.5px; color: var(--pm-muted) !important; }

.pm-page .pm-photo-tools__zoom { display: flex; justify-content: space-between; }
.pm-photo-tools__zoom output { color: var(--pm-gold); font-variant-numeric: tabular-nums; }

.pm-photo-tools input[type="range"] { display: block; width: 100%; margin: 4px 0 14px; accent-color: var(--pm-gold); cursor: pointer; }

.pm-photo-tools__row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pm-photo-tools__moves { display: flex; gap: 6px; }

.pm-photo-tools__moves button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--pm-line);
    border-radius: 12px;
    background: var(--pm-bg);
    color: var(--pm-text);
    font-size: 22px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.pm-photo-tools__moves button:hover { background: var(--pm-gold-soft); border-color: var(--pm-gold); }

/* ---------- Mosaicos de material / color ---------- */
.pm-fieldset { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.pm-fieldset:last-child { margin-bottom: 0; }

.pm-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.pm-page .pm-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 14px 6px 12px;
    border: 1.5px solid var(--pm-line);
    border-radius: 14px;
    background: var(--pm-bg);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.pm-tile:hover { border-color: var(--pm-gold-2); transform: translateY(-1px); }
.pm-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pm-tile:has(input:checked) { border-color: var(--pm-gold); background: var(--pm-gold-soft); box-shadow: inset 0 0 0 1px var(--pm-gold); }
.pm-tile:has(input:focus-visible) { outline: 3px solid var(--pm-focus); outline-offset: 2px; }

.pm-tile:has(input:checked)::after {
    content: '';
    position: absolute;
    top: 7px;
    right: 7px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--pm-gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center no-repeat;
}

.pm-tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.pm-esquema {
    width: 52px;
    height: 39px;
    fill: none;
    stroke: var(--pm-gold);
    stroke-width: 1.6;
    stroke-linecap: round;
}

.pm-esquema rect { stroke-width: 1.3; opacity: .65; }

.pm-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .18);
    box-shadow: 0 3px 8px rgba(0, 0, 0, .15), inset 0 1px 2px rgba(255, 255, 255, .25);
}

.pm-swatch--granito { background: radial-gradient(circle at 30% 30%, #4a4a4f 0 6%, transparent 7%), radial-gradient(circle at 65% 60%, #55555a 0 5%, transparent 6%), radial-gradient(circle at 45% 75%, #3c3c40 0 4%, transparent 5%), linear-gradient(135deg, #2a2a2e, #0b0b0c); }
.pm-swatch--verde { background: linear-gradient(120deg, transparent 40%, rgba(170, 225, 195, .35) 45%, transparent 50%), linear-gradient(135deg, #1c5a40, #06200f); }
.pm-swatch--blanco { background: linear-gradient(120deg, transparent 38%, rgba(110, 104, 95, .4) 43%, transparent 48%), linear-gradient(135deg, #fbfaf7, #d9d4ca); }
.pm-swatch--dorado { background: linear-gradient(130deg, #a97828, #ffe39e 45%, #be8d35); }
.pm-swatch--negro { background: #171717; }
html[data-theme="dark"] .pm-swatch { border-color: rgba(255, 255, 255, .28); }
.pm-swatch--plateado { background: linear-gradient(130deg, #91979f, #f4f5f7 48%, #8c929a); }

/* ---------- Asistente de IA ---------- */
.pm-ia {
    border: 1px solid transparent;
    background:
        linear-gradient(var(--pm-card), var(--pm-card)) padding-box,
        linear-gradient(135deg, var(--pm-gold-2), rgba(29, 90, 63, .55), var(--pm-gold)) border-box;
}

.pm-step__num--ia { background: linear-gradient(135deg, var(--pm-gold), var(--pm-gold-2)); color: #fff; border: 0; font-size: 18px; }

.pm-ia__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

.pm-chip {
    padding: 7px 13px;
    border: 1px solid var(--pm-line);
    border-radius: 999px;
    background: var(--pm-bg);
    color: var(--pm-text);
    font: 500 13px/1.2 var(--pm-sans);
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.pm-chip:hover { border-color: var(--pm-gold); background: var(--pm-gold-soft); }

.pm-ia__log { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.pm-ia__log:not(:empty) { margin-bottom: 12px; }

.pm-ia__msg { max-width: 88%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.pm-ia__msg--user { align-self: flex-end; background: var(--pm-primary); color: #fff; border-bottom-right-radius: 4px; }
.pm-ia__msg--ia { align-self: flex-start; background: var(--pm-gold-soft); color: var(--pm-text); border-bottom-left-radius: 4px; }
.pm-ia__msg--error { align-self: flex-start; background: #fdecea; color: #a12a20; }
.pm-ia__msg--cargando { align-self: flex-start; color: var(--pm-muted); font-style: italic; background: transparent; padding-left: 2px; }

html[data-theme="dark"] .pm-ia__msg--error { background: #3a1d1a; color: #ffb2a8; }

.pm-ia__form { display: flex; gap: 10px; align-items: flex-end; }
.pm-ia__form textarea { min-height: 52px; flex: 1; }

.pm-ia__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--pm-muted); }

.pm-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--pm-gold);
    font: 600 13px/1.2 var(--pm-sans);
    cursor: pointer;
}

.pm-link[hidden] { display: none; }

/* Campo resaltado tras un cambio de la IA */
.pm-cambiado { animation: pm-resalte 1.6s ease; }
@keyframes pm-resalte { 0%, 40% { box-shadow: 0 0 0 4px rgba(216, 181, 106, .55); } 100% { box-shadow: 0 0 0 0 rgba(216, 181, 106, 0); } }

/* ---------- Botones ---------- */
.pm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    font: 600 15px/1.2 var(--pm-sans);
    text-decoration: none !important;
    cursor: pointer;
    transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}

.pm-btn i { font-size: 20px; }
.pm-btn:disabled { opacity: .65; cursor: wait; }
.pm-btn:focus-visible { outline: 3px solid var(--pm-focus); outline-offset: 3px; }
.pm-btn--block { width: 100%; }

.pm-btn--primary { background: var(--pm-primary); color: #fff !important; box-shadow: 0 10px 22px -10px rgba(29, 90, 63, .7); }
.pm-btn--primary:hover:not(:disabled) { background: var(--pm-primary-hover); transform: translateY(-1px); }

.pm-btn--ia { background: linear-gradient(135deg, var(--pm-gold), #8a6420); color: #fff !important; min-height: 52px; }
.pm-btn--ia:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(138, 100, 32, .8); }

.pm-btn--ghost { min-height: 44px; background: transparent; border-color: var(--pm-line); color: var(--pm-text); }
.pm-btn--ghost:hover { border-color: var(--pm-gold); background: var(--pm-gold-soft); }
.pm-btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.pm-btn--ghost[aria-pressed="true"] { background: var(--pm-primary); border-color: var(--pm-primary); color: #fff; }

.pm-btn--whatsapp { margin-top: 12px; background: #1f9d55; color: #fff !important; }
.pm-btn--whatsapp[hidden] { display: none; }

/* ---------- Envio ---------- */
.pm-page .pm-consent {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--pm-line);
    border-radius: 12px;
    background: var(--pm-bg);
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.5;
    cursor: pointer;
}

.pm-consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--pm-primary); }

.pm-status { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--pm-gold) !important; }
.pm-status:empty { display: none; }
.pm-status.pm-demo__export-status--error { color: #b3261e !important; }
html[data-theme="dark"] .pm-status.pm-demo__export-status--error { color: #ff9b8f !important; }

.pm-saved {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 12px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(29, 90, 63, .1);
    color: var(--pm-primary) !important;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.pm-saved[hidden] { display: none; }
.pm-saved i { font-size: 20px; }
.pm-saved a { color: inherit; text-decoration: underline; }
html[data-theme="dark"] .pm-saved { background: rgba(42, 122, 85, .2); color: #a6ebc6 !important; }

/* ---------- Pie ---------- */
.pm-footer {
    max-width: 1280px;
    margin: 0 auto;
    padding: 26px 16px 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    border-top: 1px solid var(--pm-line);
    font-size: 13px;
    color: var(--pm-muted);
}

.pm-footer strong { font-family: var(--pm-serif); font-size: 19px; color: var(--pm-text); }
.pm-footer span { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; align-items: center; }
.pm-footer span i { margin-right: 4px; color: var(--pm-gold); }
.pm-footer small { font-size: 12px; color: var(--pm-muted) !important; }

/* ---------- Responsive ---------- */
/* ---------- Personas, interruptor de fotos y opciones de diseno ---------- */
.pm-page .pm-tile[hidden],
.pm-page .pm-upload[hidden],
.pm-page .pm-persona[hidden],
#pm-fotos-zona[hidden] { display: none; }

.pm-cantidad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

.pm-page .pm-cantidad__op {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 12px 4px 10px;
    border: 1.5px solid var(--pm-line);
    border-radius: 14px;
    background: var(--pm-bg);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.pm-cantidad__op:hover { border-color: var(--pm-gold-2); }
.pm-cantidad__op input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pm-cantidad__op:has(input:checked) { border-color: var(--pm-gold); background: var(--pm-gold-soft); box-shadow: inset 0 0 0 1px var(--pm-gold); }
.pm-cantidad__op:has(input:focus-visible) { outline: 3px solid var(--pm-focus); outline-offset: 2px; }
.pm-cantidad__iconos { display: inline-flex; gap: 0; color: var(--pm-gold); font-size: 18px; }
.pm-cantidad__iconos i + i { margin-left: -5px; }

.pm-personas { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 20px; }

.pm-persona {
    margin: 0;
    padding: 14px 16px 2px;
    border: 1px solid var(--pm-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--pm-bg) 70%, transparent);
    min-width: 0;
}

.pm-page .pm-persona__titulo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 6px;
    margin: 0;
    font-family: var(--pm-serif);
    font-size: 19px;
    font-weight: 600;
}

.pm-persona__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--pm-gold);
    color: #fff;
    font: 700 12px/1 var(--pm-sans);
}

.pm-persona .pm-grid-2 { margin-bottom: 12px; }
.pm-persona .pm-field { margin-bottom: 12px; }
.pm-opcional { font-style: normal; font-weight: 400; color: var(--pm-muted); }

.pm-textos { padding-top: 18px; border-top: 1px solid var(--pm-line); }

.pm-page .pm-switch { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 14px; cursor: pointer; }
.pm-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pm-switch__pista {
    position: relative;
    flex: none;
    width: 44px;
    height: 26px;
    border-radius: 99px;
    background: var(--pm-line);
    transition: background .2s ease;
}
.pm-switch__pista::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .2s ease;
}
.pm-switch input:checked + .pm-switch__pista { background: var(--pm-primary); }
.pm-switch input:checked + .pm-switch__pista::after { transform: translateX(18px); }
.pm-switch input:focus-visible + .pm-switch__pista { outline: 3px solid var(--pm-focus); outline-offset: 2px; }

.pm-upload + .pm-upload { margin-top: 10px; }
.pm-upload input:focus-visible + .pm-upload__zone { outline: 3px solid var(--pm-focus); outline-offset: 3px; }
.pm-upload.is-cargada .pm-upload__zone { border-style: solid; border-color: var(--pm-gold); }
.pm-upload.is-cargada .pm-upload__zone i { color: var(--pm-primary); }

.pm-tiles--auto { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.pm-tiles--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pm-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pm-page .pm-tile--mini { padding: 10px 4px 9px; gap: 6px; }

.pm-esquema .r { fill: var(--pm-gold); stroke: none; }
.pm-esquema--mini { width: 24px; height: 30px; }

.pm-simbolo-ico { width: 38px; height: 38px; }
.pm-simbolo-ico .pm-simbolo-relleno { fill: var(--pm-gold); }
.pm-simbolo-ico .pm-simbolo-trazo { fill: none; stroke: var(--pm-gold); stroke-linecap: round; stroke-linejoin: round; }
.pm-simbolo-ico .pm-simbolo-hueco { stroke: var(--pm-bg); }
.pm-tile:has(input:checked) .pm-simbolo-ico .pm-simbolo-hueco { stroke: var(--pm-gold-soft); }
.pm-simbolo-ico:empty { border: 1.5px dashed var(--pm-line); border-radius: 50%; width: 30px; height: 30px; margin: 4px; }

.pm-letra-muestra { font-size: 22px; line-height: 30px; color: var(--pm-gold); }
.pm-letra-muestra--clasica { font-family: Georgia, serif; font-style: italic; }
.pm-letra-muestra--manuscrita { font-family: 'Great Vibes', cursive; font-size: 27px; }

.pm-grid-2--opciones { align-items: start; }
.pm-grid-2--opciones .pm-fieldset { margin-bottom: 0; }
#pm-forma-grupo[disabled] { opacity: .45; }

/* ---------- Medida en el paso 1 ---------- */
.pm-field--medida { margin: 16px 0 0; }
.pm-ayuda { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--pm-muted) !important; }
.pm-page .pm-label { display: block; margin: 0 0 7px; font-size: 14px; font-weight: 600; color: var(--pm-text); }

/* Las imagenes no se arrastran ni se guardan con pulsacion larga */
.pm-page img { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; }

/* ---------- Consulta a un asesor ---------- */
.pm-page .pm-hero__asesor {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: #fbf6ea;
    font: 600 14px/1.2 var(--pm-sans);
    cursor: pointer;
    transition: background .2s ease;
}
.pm-hero__asesor:hover { background: rgba(255, 255, 255, .2); }
.pm-hero__asesor i { font-size: 18px; color: var(--pm-gold-2); }

.pm-asesor {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 4px 16px;
    padding: 20px 22px;
    border-style: dashed;
}
.pm-asesor .pm-btn { grid-column: 2; justify-self: start; margin-top: 10px; }
.pm-asesor__icono {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--pm-gold-soft);
    color: var(--pm-gold);
    font-size: 24px;
}
.pm-asesor__texto { flex: 1 1 240px; min-width: 0; }
.pm-asesor__texto h3 { margin: 0 0 4px; font-family: var(--pm-serif); font-size: 21px; font-weight: 600; color: var(--pm-text); }
.pm-asesor__texto p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--pm-muted) !important; }

.pm-page .pm-dialog {
    margin: auto;
    width: min(640px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    padding: 0;
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius);
    background: var(--pm-card);
    color: var(--pm-text);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
}
.pm-dialog::backdrop { background: rgba(12, 20, 16, .55); backdrop-filter: blur(3px); }
.pm-dialog__cuerpo { padding: clamp(18px, 3vw, 28px); }
.pm-dialog__head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.pm-dialog__head h2 { margin: 0 0 6px; font-family: var(--pm-serif); font-size: 26px; font-weight: 600; color: var(--pm-text); }
.pm-dialog__head p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--pm-muted) !important; }
.pm-dialog__cerrar {
    flex: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--pm-line);
    border-radius: 50%;
    background: var(--pm-bg);
    color: var(--pm-text);
    font-size: 22px;
    cursor: pointer;
}
.pm-dialog .pm-consent { margin-top: 4px; }

.pm-consulta__lista { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pm-consulta__lista:empty { display: none; }
.pm-consulta__lista li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 5px 6px 5px 12px;
    border: 1px solid var(--pm-line);
    border-radius: 999px;
    background: var(--pm-bg);
    font-size: 12.5px;
}
.pm-consulta__lista span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.pm-consulta__lista button { border: 0; background: none; color: var(--pm-muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.pm-consulta__listo { text-align: center; padding: 10px 0; }
.pm-consulta__listo[hidden], .pm-consulta__campos[hidden] { display: none; }
.pm-consulta__listo > i { font-size: 52px; color: var(--pm-primary); }
.pm-consulta__listo h3 { margin: 6px 0; font-family: var(--pm-serif); font-size: 26px; color: var(--pm-text); }
.pm-consulta__listo p { margin: 0 0 18px; color: var(--pm-muted) !important; }
.pm-consulta__listo .pm-btn + .pm-btn { margin-top: 10px; }

/* ---------- Orden del formulario: indice de pasos y subtitulos ---------- */
.pm-indice {
    position: sticky;
    top: 10px;
    z-index: 6;
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--pm-line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--pm-card) 88%, transparent);
    backdrop-filter: blur(8px);
    box-shadow: var(--pm-shadow);
    overflow-x: auto;
    scrollbar-width: none;
}
.pm-indice::-webkit-scrollbar { display: none; }
.pm-page .pm-indice a {
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--pm-muted);
    font: 600 13px/1 var(--pm-sans);
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.pm-indice a:hover { background: var(--pm-gold-soft); color: var(--pm-text); }
.pm-indice a span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--pm-gold-soft);
    color: var(--pm-gold);
    font-size: 11px;
}
.pm-steps > .pm-card { scroll-margin-top: 76px; }

.pm-subtitulo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 14px;
    font: 700 11.5px/1 var(--pm-sans);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--pm-gold);
}
.pm-subtitulo::after { content: ''; flex: 1; height: 1px; background: var(--pm-line); }
.pm-fieldset + .pm-subtitulo { margin-top: 26px; }

.pm-etiqueta {
    display: inline-block;
    margin-left: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--pm-gold-soft);
    color: var(--pm-gold);
    font: 600 11px/1.2 var(--pm-sans);
    vertical-align: middle;
}

.pm-grid-2--nombre { grid-template-columns: 1.5fr 1fr; }
.pm-step .pm-grid-2:last-child { margin-bottom: 0; }

@media (max-width: 980px) {
    .pm-layout { grid-template-columns: minmax(0, 1fr); }
    .pm-preview { position: static; }
    .pm-hero { padding-bottom: 104px; }
}

@media (max-width: 520px) {
    .pm-hero__back span { display: none; }
    .pm-hero__back { width: 40px; padding: 0; justify-content: center; }
    .pm-hero__brand span { font-size: 14px; }
    .pm-grid-2, .pm-grid-2--nombre { grid-template-columns: 1fr; }
    .pm-persona .pm-grid-2:not(.pm-grid-2--nombre) { grid-template-columns: 1fr 1fr; gap: 8px; }
    .pm-page .pm-indice a { padding: 7px 8px; font-size: 12px; }
    .pm-tiles--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pm-page .pm-cantidad__op { padding: 10px 2px 8px; font-size: 11.5px; }
    .pm-cantidad__iconos { font-size: 15px; }
    .pm-tiles--auto { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
    .pm-tiles { gap: 7px; }
    .pm-page .pm-tile { padding: 12px 4px 10px; font-size: 12px; }
    .pm-ia__form { flex-direction: column; align-items: stretch; }
    .pm-step__head h3 { font-size: 22px; }
}

@media (max-width: 380px) {
    .pm-persona .pm-grid-2:not(.pm-grid-2--nombre) { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .pm-live__dot, .pm-cambiado { animation: none; }
    .pm-tile, .pm-btn { transition: none; }
}

/* =========================================================
   Acabado realista: placa grabada en piedra pulida
   ========================================================= */

/* Escenario: pared clara con luz suave desde arriba */
.pm-page .pm-plaque-wrap {
    padding: clamp(22px, 3.4vw, 44px) clamp(16px, 3vw, 40px) clamp(30px, 4vw, 52px);
    border-radius: 16px;
    background:
        radial-gradient(ellipse 70% 55% at 50% 8%, rgba(255, 252, 244, .95), rgba(255, 252, 244, 0) 70%),
        linear-gradient(180deg, #ece5d6 0%, #ddd2bd 78%, #cfc2a8 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -18px 30px -24px rgba(60, 45, 20, .45);
}
html[data-theme="dark"] .pm-page .pm-plaque-wrap {
    background:
        radial-gradient(ellipse 70% 55% at 50% 8%, rgba(120, 140, 125, .22), rgba(0, 0, 0, 0) 70%),
        linear-gradient(180deg, #1f2622 0%, #171c19 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* Placa: canto pulido, grosor y sombra sobre la pared */
.pm-page .pm-plaque {
    border-radius: 3px;
    box-shadow:
        0 1px 0 1px rgba(255, 255, 255, .06),
        0 2px 0 1px #1b1b1e,
        0 4px 0 1px #111113,
        0 6px 0 1px #0a0a0b,
        0 30px 46px -20px rgba(0, 0, 0, .75),
        0 14px 24px -12px rgba(0, 0, 0, .45);
}
.pm-page .pm-plaque--blanco {
    box-shadow:
        0 1px 0 1px rgba(255, 255, 255, .6),
        0 2px 0 1px #cfc8ba,
        0 4px 0 1px #bdb5a5,
        0 6px 0 1px #a9a090,
        0 30px 46px -20px rgba(60, 45, 20, .55),
        0 14px 24px -12px rgba(60, 45, 20, .3);
}
.pm-page .pm-plaque--libro { box-shadow: none; }

/* Reflejo del pulido (solo en pantalla) */
.pm-reflejo {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
        linear-gradient(118deg, rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, .085) 43%, rgba(255, 255, 255, .025) 50%, rgba(255, 255, 255, 0) 58%);
    background-size: 260% 260%;
    background-position: var(--pm-luz-x, 30%) var(--pm-luz-y, 30%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 1px 0 0 rgba(255, 255, 255, .06), inset 0 -1px 0 rgba(0, 0, 0, .55);
    transition: background-position .5s ease-out;
}
.pm-plaque--blanco .pm-reflejo { opacity: .7; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -1px 0 rgba(90, 75, 50, .25); }
.pm-plaque--libro .pm-reflejo { display: none; }

/* Letras de metal grabadas (dorado y plateado) */
.pm-plaque--metal .pm-txt {
    background-image: var(--pm-ink-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 .05em .035em rgba(0, 0, 0, .85)) drop-shadow(0 -.02em 0 rgba(255, 238, 196, .2));
}
.pm-plaque--metal.pm-plaque--blanco .pm-txt {
    filter: drop-shadow(0 .035em 0 rgba(255, 255, 255, .9)) drop-shadow(0 -.02em .02em rgba(70, 48, 12, .45));
}

/* Marcos, simbolos y separadores con el mismo relieve */
.pm-anillo, .pm-adorno { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .8)) drop-shadow(0 -.5px 0 rgba(255, 238, 196, .25)); }
.pm-plaque--blanco .pm-anillo, .pm-plaque--blanco .pm-adorno { filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .9)) drop-shadow(0 -.5px .5px rgba(70, 48, 12, .45)); }
.pm-page .pm-el--simbolo svg { filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, .85)) drop-shadow(0 -.5px 0 rgba(255, 238, 196, .25)); }
.pm-rombo, .pm-divisor::after { background: linear-gradient(135deg, var(--pm-m2, #c9a14e), var(--pm-m3, #f8e3a2) 45%, var(--pm-m6, #7c5a1c)); }
.pm-divisor { filter: drop-shadow(0 1px .5px rgba(0, 0, 0, .7)); }

/* Fotografia en porcelana: brillo y sombra interior */
.pm-plaque__photo-box::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(140deg, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, .04) 32%, rgba(255, 255, 255, 0) 48%);
    box-shadow: inset 0 0 calc(var(--pm-height) * .014) rgba(0, 0, 0, .55);
}
.pm-el--foto.is-vacio .pm-plaque__photo-box::after { display: none; }

/* Marco de foto con laureles */
.pm-adorno { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; display: none; }
.pm-adorno__tallos { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pm-plaque--ornamentado .pm-adorno { display: block; }
.pm-plaque--ornamentado .pm-rombo { display: none; }

/* Mosaicos de diseno con miniatura real */
.pm-tiles--estilos { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.pm-page .pm-tile--estilo { padding: 8px 8px 10px; gap: 8px; }
.pm-estilo-mini {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .55), 0 1px 0 rgba(255, 255, 255, .5);
    transition: transform .2s ease;
}
.pm-estilo-mini img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pm-tile--estilo:has(input[value="libro"]) .pm-estilo-mini { background: transparent; box-shadow: none; }
.pm-tile--estilo:hover .pm-estilo-mini { transform: scale(1.03); }
.pm-tile--estilo:has(input:checked) .pm-estilo-mini { box-shadow: 0 0 0 2px var(--pm-gold), 0 8px 16px -8px rgba(0, 0, 0, .6); }

@media (max-width: 520px) {
    .pm-tiles--estilos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pm-tiles--3 .pm-tile { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
    .pm-reflejo, .pm-estilo-mini { transition: none; }
}

/* Orientacion de la placa (paso 1) */
.pm-orientacion { margin: 14px 0 6px; }
.pm-orientacion[hidden] { display: none; }
.pm-esquema--orientacion { width: 36px; height: 30px; }

/* ---------- Adaptacion a celulares y pantallas pequenas ---------- */
.pm-page img, .pm-page canvas { max-width: 100%; }
.pm-preview__card { scroll-margin-top: 12px; }

/* Boton flotante "Ver placa" (solo se activa en pantallas angostas desde el JS). */
.pm-ver-placa {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--pm-primary);
    color: #fff;
    font: 600 15px/1 var(--pm-sans);
    box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .45);
    cursor: pointer;
}
.pm-ver-placa[hidden] { display: none; }
.pm-ver-placa i { font-size: 20px; }

@media (max-width: 980px) {
    /* Espacio para que el boton flotante no tape el ultimo boton del formulario. */
    .pm-demo { padding-bottom: 72px; }
}

@media (max-width: 520px) {
    /* La barra de arriba en una sola fila: el nombre se recorta y los botones quedan a la derecha. */
    .pm-hero__bar { flex-wrap: nowrap; }
    .pm-hero__brand { flex: 1 1 auto; }
    .pm-hero__brand img { height: 38px; flex: none; }
    .pm-hero__brand span {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.25;
    }
    .pm-hero__actions { flex: none; }
    /* 16px evita que el celular haga zoom al escribir en un campo. */
    .pm-page input[type="text"],
    .pm-page input[type="tel"],
    .pm-page input[type="date"],
    .pm-page select,
    .pm-page textarea { font-size: 16px; }
}

@media (max-width: 380px) {
    /* Cantidad de personas: 2 por fila para que el texto no se parta. */
    .pm-cantidad { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pm-page .pm-cantidad__op { font-size: 12.5px; }
    .pm-hero__brand span { font-size: 13px; }
    .pm-hero__brand img { height: 34px; }
    .pm-tiles--estilos { gap: 6px; }
}

/* Celular acostado: poca altura, se reduce el encabezado. */
@media (max-height: 500px) and (orientation: landscape) {
    .pm-hero__content { padding-top: 16px; }
    .pm-hero__lead, .pm-hero__points { display: none; }
}

/* Dialogo del asesor: usa el alto visible real del celular (sin la barra del navegador). */
.pm-page .pm-dialog { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 520px) {
    .pm-dialog__head h2 { font-size: 22px; }
}
