/* ============================================================
   Piñatitas Mely - Estilos del Diseñador
   ============================================================ */

/* ---------- Selector de modo ---------- */
.pm-mode-card {
    background: var(--pm-white);
    border: 1.5px solid var(--pm-line);
    border-radius: var(--pm-radius-lg);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all .3s cubic-bezier(.2, .8, .2, 1);
    overflow: hidden;
}
.pm-mode-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--pm-shadow-lg);
    border-color: var(--pm-rose-soft);
}
.pm-mode-badge {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    padding: .35rem .85rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
}
.pm-mode-icon {
    width: 80px;
    height: 80px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
}
.pm-mode-title {
    font-family: var(--pm-font-display);
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: .75rem;
}
.pm-mode-desc {
    color: var(--pm-ink-soft);
    margin-bottom: 1.5rem;
}
.pm-mode-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}
.pm-mode-features li {
    padding: .35rem 0;
    color: var(--pm-ink);
    font-size: .95rem;
}
.pm-mode-features i {
    color: var(--pm-turquoise);
    margin-right: .5rem;
}

/* ============================================================
   LAYOUT DEL DISEÑADOR (full screen)
   ============================================================ */
.pm-designer-body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--pm-cream);
}
.pm-designer-topbar {
    height: 60px;
    flex-shrink: 0;
    background: rgba(255, 248, 238, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--pm-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 100;
}
.pm-designer-main {
    flex: 1;
    overflow: hidden;
    display: flex;
}

/* ============================================================
   WIZARD
   ============================================================ */
.pm-wizard {
    display: flex;
    width: 100%;
    height: 100%;
}
/* Panel izquierdo: pasos */
.pm-wizard-panel {
    width: 440px;
    flex-shrink: 0;
    background: var(--pm-white);
    border-right: 1px solid var(--pm-line);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
/* Preview derecho */
.pm-wizard-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    background:
        radial-gradient(circle at 30% 20%, rgba(253,200,58,.08), transparent 40%),
        radial-gradient(circle at 70% 80%, rgba(43,184,176,.08), transparent 40%),
        var(--pm-cream);
}

/* Progreso de pasos */
.pm-wizard-progress {
    display: flex;
    padding: 1.25rem 1.5rem;
    gap: .5rem;
    border-bottom: 1px solid var(--pm-line);
    flex-shrink: 0;
}
.pm-progress-step {
    flex: 1;
    height: 5px;
    border-radius: 999px;
    background: var(--pm-line);
    transition: background .3s;
}
.pm-progress-step.active { background: var(--pm-rose); }
.pm-progress-step.done { background: var(--pm-turquoise); }

/* Contenido scrollable de cada paso */
.pm-wizard-steps {
    flex: 1;
    overflow-y: auto;
    padding: 1.75rem 1.5rem;
}
.pm-wizard-step { display: none; animation: pm-fadeUp .4s ease; }
.pm-wizard-step.active { display: block; }

.pm-step-label {
    font-family: var(--pm-font-accent);
    color: var(--pm-rose);
    font-size: 1.4rem;
    line-height: 1;
}
.pm-step-heading {
    font-family: var(--pm-font-display);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: .35rem;
}
.pm-step-sub {
    color: var(--pm-ink-soft);
    font-size: .95rem;
    margin-bottom: 1.5rem;
}

/* Opciones tipo "chip/card" */
.pm-option-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
}
.pm-option-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.pm-option {
    border: 1.5px solid var(--pm-line);
    border-radius: var(--pm-radius);
    padding: 1rem .75rem;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--pm-cream);
    position: relative;
    user-select: none;
}
.pm-option:hover { border-color: var(--pm-rose); transform: translateY(-2px); }
.pm-option.selected {
    border-color: var(--pm-rose);
    background: var(--pm-rose-soft);
    box-shadow: 0 0 0 3px rgba(230,49,120,.12);
}
.pm-option.selected::after {
    content: '\F26E';
    font-family: 'bootstrap-icons';
    position: absolute;
    top: .4rem; right: .5rem;
    color: var(--pm-rose);
    font-size: .9rem;
}
.pm-option-icon { font-size: 1.6rem; display: block; margin-bottom: .35rem; }
.pm-option-name { font-weight: 500; font-size: .9rem; display: block; }
.pm-option-price { font-size: .78rem; color: var(--pm-ink-soft); display: block; margin-top: .15rem; }

/* Swatch de color */
.pm-color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .6rem;
}
.pm-swatch {
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all .2s;
    position: relative;
}
.pm-swatch:hover { transform: scale(1.1); }
.pm-swatch.selected {
    border-color: var(--pm-ink);
    box-shadow: 0 0 0 2px var(--pm-white) inset;
}
.pm-swatch.selected::after {
    content: '\F26E';
    font-family: 'bootstrap-icons';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
    font-size: 1rem;
}

/* Extras (checkboxes tipo toggle) */
.pm-extra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1rem;
    border: 1.5px solid var(--pm-line);
    border-radius: var(--pm-radius-sm);
    margin-bottom: .6rem;
    cursor: pointer;
    transition: all .2s;
    background: var(--pm-white);
}
.pm-extra:hover { border-color: var(--pm-rose); }
.pm-extra.selected { border-color: var(--pm-rose); background: var(--pm-rose-soft); }
.pm-extra-info { display: flex; align-items: center; gap: .65rem; }
.pm-extra-info i { font-size: 1.2rem; color: var(--pm-rose); }
.pm-extra-price { font-weight: 600; color: var(--pm-rose); font-size: .9rem; }

/* Footer del wizard (navegación + precio) */
.pm-wizard-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--pm-line);
    padding: 1rem 1.5rem;
    background: var(--pm-white);
}
.pm-price-display {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: .85rem;
}
.pm-price-label { font-size: .85rem; color: var(--pm-ink-soft); }
.pm-price-value {
    font-family: var(--pm-font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--pm-rose);
}
.pm-price-value small { font-size: .9rem; font-weight: 400; color: var(--pm-ink-soft); }

/* Preview de la piñata (SVG) */
.pm-pinata-preview {
    max-width: 420px;
    width: 100%;
    filter: drop-shadow(0 20px 40px rgba(42,26,46,.16));
    transition: transform .4s;
}
.pm-preview-caption {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--pm-ink-soft);
}
.pm-preview-name {
    font-family: var(--pm-font-accent);
    font-size: 2rem;
    color: var(--pm-rose);
    line-height: 1;
}

/* Breakdown de precio (tooltip/lista) */
.pm-breakdown {
    font-size: .82rem;
    color: var(--pm-ink-soft);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s;
}
.pm-breakdown.show { max-height: 300px; margin-bottom: .85rem; }
.pm-breakdown-row { display: flex; justify-content: space-between; padding: .15rem 0; }

/* ============================================================
   CANVAS (editor libre)
   ============================================================ */
.pm-canvas-layout {
    display: flex;
    width: 100%;
    height: 100%;
}
/* Barra de herramientas izquierda */
.pm-canvas-tools {
    width: 72px;
    flex-shrink: 0;
    background: var(--pm-white);
    border-right: 1px solid var(--pm-line);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    gap: .5rem;
    overflow-y: auto;
}
.pm-tool-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--pm-radius-sm);
    border: none;
    background: transparent;
    color: var(--pm-ink);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all .2s;
    display: grid;
    place-items: center;
    position: relative;
}
.pm-tool-btn:hover { background: var(--pm-rose-soft); color: var(--pm-rose); }
.pm-tool-btn.active { background: var(--pm-rose); color: #fff; }
.pm-tool-label {
    position: absolute;
    left: 58px;
    background: var(--pm-ink);
    color: #fff;
    padding: .25rem .6rem;
    border-radius: 6px;
    font-size: .75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
    z-index: 10;
}
.pm-tool-btn:hover .pm-tool-label { opacity: 1; }
.pm-tool-divider { width: 32px; height: 1px; background: var(--pm-line); margin: .35rem 0; }

/* Lienzo central */
.pm-canvas-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 2rem;
    background:
        repeating-conic-gradient(#0000 0% 25%, rgba(42,26,46,.02) 0% 50%) 50% / 24px 24px,
        var(--pm-cream-2);
}
.pm-canvas-wrap {
    background: #fff;
    box-shadow: var(--pm-shadow-lg);
    border-radius: 4px;
}

/* Panel de propiedades derecho */
.pm-canvas-props {
    width: 300px;
    flex-shrink: 0;
    background: var(--pm-white);
    border-left: 1px solid var(--pm-line);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pm-props-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--pm-line);
    font-family: var(--pm-font-display);
    font-weight: 600;
}
.pm-props-body { flex: 1; overflow-y: auto; padding: 1.25rem; }
.pm-props-empty {
    text-align: center;
    color: var(--pm-ink-soft);
    padding: 2rem 1rem;
}
.pm-props-empty i { font-size: 2.5rem; color: var(--pm-line); display: block; margin-bottom: .75rem; }

.pm-prop-group { margin-bottom: 1.25rem; }
.pm-prop-label { font-size: .82rem; font-weight: 500; color: var(--pm-ink-soft); margin-bottom: .4rem; display: block; }
.pm-canvas-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--pm-line);
}

/* Mini color swatches para canvas */
.pm-mini-swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.pm-mini-swatch {
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform .15s;
}
.pm-mini-swatch:hover { transform: scale(1.12); }
.pm-mini-swatch.selected { border-color: var(--pm-ink); }

/* Responsive: en móvil el wizard apila preview arriba */
@media (max-width: 860px) {
    .pm-wizard { flex-direction: column; }
    .pm-wizard-panel { width: 100%; height: 60%; order: 2; border-right: none; border-top: 1px solid var(--pm-line); }
    .pm-wizard-preview { height: 40%; order: 1; padding: 1rem; }
    .pm-pinata-preview { max-width: 200px; }

    .pm-canvas-props { display: none; }
    .pm-canvas-props.mobile-open {
        display: flex;
        position: fixed;
        right: 0; top: 60px; bottom: 0;
        z-index: 50;
        box-shadow: var(--pm-shadow-lg);
    }
}
