/* ============================================================
   Print Laguna Designer - Prendas dentro del diseñador
   (views/js/fpd-garments.js)

   Dos piezas: el rótulo y el botón "＋" que se meten en la barra de páginas
   de FPD (<fpd-views-nav>), y el diálogo de "agregar prenda".
   ============================================================ */
fpd-views-nav .plgm-label {
    display: flex;
    align-items: center;
    padding: 0 10px;
    max-width: 190px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
    font-weight: 600;
    color: var(--fpd-secondary-font-color, #4b5563);
}

/* Con cortes, el rótulo es el botón para cambiar el de la prenda */
fpd-views-nav .plgm-label.is-cut { cursor: pointer; }
fpd-views-nav .plgm-label.is-cut::after {
    content: '▾';
    margin-left: 5px;
    font-size: 11px;
    color: #9ca3af;
}
fpd-views-nav .plgm-label.is-cut:hover { color: #111827; }

fpd-views-nav .plgm-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    align-self: stretch;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #10b981, #059669);
}
fpd-views-nav .plgm-add:hover { filter: brightness(1.08); }

/* ---------- Diálogo ---------- */
.plgm-modal {
    position: fixed;
    inset: 0;
    z-index: 200060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 24, 39, 0.6);
    box-sizing: border-box;
    font-family: inherit;
    color: #1f2937;
}
.plgm-modal *, .plgm-modal *::before, .plgm-modal *::after { box-sizing: border-box; }

.plgm-box {
    width: 460px;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.plgm-head {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}
.plgm-head h3 {
    flex: 1;
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #111827;
}
.plgm-modal button.plgm-close {
    border: 0;
    background: none;
    padding: 0 2px;
    margin: 0;
    color: #9ca3af;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}
.plgm-body {
    padding: 14px 16px;
    overflow-y: auto;
}
.plgm-hint {
    margin: 0 0 12px;
    font-size: 14px;
    color: #4b5563;
}
.plgm-opt {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 10px;
    align-items: center;
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
}
.plgm-opt.is-fixed { opacity: 0.7; cursor: default; }
.plgm-opt.plgm-copy { border-style: dashed; }
.plgm-opt input { margin: 0; }
.plgm-opt b { font-weight: 600; }
.plgm-opt small {
    grid-column: 2;
    font-size: 12px;
    color: #6b7280;
}
.plgm-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eee;
}
.plgm-modal button.plgm-cancel,
.plgm-modal button.plgm-go {
    margin: 0;
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    text-transform: none;
}
/* ---------- Cortes (Adulto, Dama, Niño) ---------- */
.plgm-sub {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}
.plgm-cuts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.plgm-cut {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 6px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.plgm-cut:hover { border-color: #a7f3d0; }
.plgm-cut.is-on {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .18);
}
.plgm-cut input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.plgm-cut-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 86px;
    margin-bottom: 4px;
    border-radius: 8px;
    background: #f9fafb;
    overflow: hidden;
}
.plgm-cut-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.plgm-cut-img i { font-style: normal; font-size: 40px; }
.plgm-cut b { font-size: 14px; font-weight: 700; color: #111827; }
.plgm-cut small { font-size: 12px; color: #6b7280; }
.plgm-modal button.plgm-go:disabled { opacity: .45; cursor: default; }

.plgm-modal button.plgm-cancel { background: #f3f4f6; color: #374151; }
.plgm-modal button.plgm-go { background: #10b981; color: #fff; }

/* ---------- Mis diseños (fpd-saved.js): pestaña de la barra de FPD ---------- */
/* el reset de FPD (.fpd-container *) le quita el padding a un selector de etiqueta */
.fpd-module-content > fpd-module-pl-saved { padding: 12px; }
fpd-module-pl-saved *, fpd-module-pl-saved *::before, fpd-module-pl-saved *::after { box-sizing: border-box; }
fpd-module-pl-saved > .plsv-panel {
    display: flex;
    flex-flow: column;
    height: 100%;
    min-height: 0;
    gap: 10px;
}
.plsv-head b { display: block; font-size: 15px; color: var(--fpd-text-color, #485563); }
.plsv-head small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: #6b7280; }
.plsv-save { display: flex; gap: 6px; }
fpd-module-pl-saved input.plsv-name {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--fpd-border-color, #e5e7eb);
    border-radius: var(--fpd-border-radius, 6px);
    font: inherit;
    font-size: 13px;
    color: #1f2937;
    background: #fff;
}
fpd-module-pl-saved button.plsv-store,
fpd-module-pl-saved button.plsv-go {
    border: 0;
    margin: 0;
    border-radius: var(--fpd-border-radius, 6px);
    background: var(--fpd-secondary-color, #029EEB);
    color: var(--fpd-secondary-fg-color, #fff);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
}
fpd-module-pl-saved button.plsv-store { height: 38px; padding: 0 14px; font-size: 13px; }
.plsv-msg { margin: 0; font-size: 12px; color: #4b5563; }
.plsv-msg[hidden] { display: none; }
.plsv-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-content: start;
    padding-bottom: 6px;
}
.plsv-list > .plsz-spin, .plsv-empty { grid-column: 1 / -1; }
.plsv-empty { margin: 20px 0; text-align: center; font-size: 13px; color: #6b7280; line-height: 1.5; }
.plsv-item {
    position: relative;
    display: flex;
    flex-flow: column;
    padding: 6px;
    border-radius: var(--fpd-border-radius, 6px);
    background: var(--fpd-module-secondary-color, #F6F6F6);
}
fpd-module-pl-saved button.plsv-pic {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 4px;
    /* La miniatura trae su propio fondo (claro u oscuro según el diseño) */
    background: #f3f4f6;
    overflow: hidden;
    cursor: pointer;
    box-shadow: none;
}
.plsv-pic img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.plsv-pic:hover img { opacity: .85; }
.plsv-nothumb {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #9ca3af;
    pointer-events: none;
}
fpd-module-pl-saved button.plsv-del {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 24, 39, .7);
    /* el aro blanco la separa también de una miniatura de fondo oscuro */
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .9);
    color: #fff;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    box-shadow: none;
}
.plsv-info { min-width: 0; margin: 5px 2px 6px; }
.plsv-info b {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
    color: #1f2937;
}
.plsv-info small { display: block; font-size: 11px; color: #6b7280; }
fpd-module-pl-saved button.plsv-go { width: 100%; padding: 7px 0; font-size: 12px; }

@media (max-width: 520px) {
    .plgm-modal { padding: 0; align-items: flex-end; }
    .plgm-box { border-radius: 14px 14px 0 0; }
    fpd-views-nav .plgm-label { max-width: 110px; }
}
