/* ============================================================
   Print Laguna Designer - Tallas y cantidades (fpd-sizes.js)

   Tema claro a propósito: es el último paso antes del carrito y va sobre
   la ficha del producto, no dentro del diseñador. Todo cuelga de
   .plsz-modal para que el tema de la tienda no le cambie botones ni campos.
   ============================================================ */
html.plsz-lock,
html.plsz-lock body {
    overflow: hidden !important;
}

.plsz-modal {
    position: fixed;
    inset: 0;
    z-index: 200050;
    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;
    line-height: 1.4;
}
.plsz-modal[hidden] { display: none !important; }
.plsz-modal *,
.plsz-modal *::before,
.plsz-modal *::after { box-sizing: border-box; }

.plsz-box {
    width: 760px;
    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);
}

.plsz-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}
.plsz-head h3 {
    flex: 1;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}
.plsz-modal button.plsz-edit,
.plsz-modal button.plsz-close {
    border: 0;
    background: none;
    padding: 4px 2px;
    margin: 0;
    color: #6c5ce7;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: none;
    text-transform: none;
}
.plsz-modal button.plsz-close {
    font-size: 26px;
    line-height: 1;
    color: #9ca3af;
}

.plsz-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px;
    -webkit-overflow-scrolling: touch;
}
.plsz-hint {
    margin: 0 0 12px;
    color: #4b5563;
    font-size: 14px;
}

.plsz-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}
.plsz-thumb {
    flex: none;
    width: 96px;
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 8px;
    overflow: hidden;
}
.plsz-thumb img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.plsz-sizes { flex: 1; min-width: 0; }
.plsz-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.plsz-cname {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 15px;
}
.plsz-mini {
    display: none;
    width: 44px;
    height: 48px;
    border-radius: 6px;
    background: #f9fafb;
    object-fit: contain;
}
.plsz-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: #e5e7eb;
    flex: none;
}
.plsz-modal button.plsz-del {
    border: 0;
    background: none;
    padding: 2px 4px;
    margin: 0;
    color: #9ca3af;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    box-shadow: none;
}

.plsz-quote {
    margin: 0 0 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #f5f3ff;
    color: #4b5563;
    font-size: 12px;
}
.plsz-quote b { color: #111827; white-space: nowrap; }

.plsz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
}
.plsz-sz {
    padding: 6px 4px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}
.plsz-sz.is-on {
    border-color: #6c5ce7;
    background: #f5f3ff;
}
.plsz-sz.is-off { opacity: 0.45; }
.plsz-l {
    font-weight: 700;
    font-size: 13px;
    word-break: break-word;
}
.plsz-x {
    min-height: 15px;
    font-size: 11px;
    color: #b45309;
}
.plsz-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
}
.plsz-modal .plsz-step button {
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}
.plsz-modal .plsz-step button:disabled { opacity: 0.35; cursor: default; }
.plsz-modal .plsz-step input {
    width: 34px;
    height: 28px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: #111827;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    -moz-appearance: textfield;
    box-shadow: none;
}
.plsz-modal .plsz-step input::-webkit-outer-spin-button,
.plsz-modal .plsz-step input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.plsz-sub {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.plsz-modal button.plsz-add {
    width: 100%;
    margin: 0;
    padding: 12px;
    border: 2px dashed #c4b5fd;
    border-radius: 12px;
    background: #faf5ff;
    color: #6c5ce7;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    text-transform: none;
}
.plsz-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}
.plsz-modal button.plsz-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 70px;
    padding: 4px 0;
    margin: 0;
    border: 0;
    background: none;
    color: #374151;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
    box-shadow: none;
}
.plsz-swatch i {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #d1d5db;
}

.plsz-error {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 13px;
}

.plsz-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    background: #fff;
}
.plsz-tot { flex: 1; min-width: 0; }
.plsz-tot b {
    display: block;
    font-size: 18px;
    color: #111827;
}
.plsz-tot small { color: #6b7280; font-size: 12px; }
.plsz-modal button.plsz-cta {
    margin: 0;
    padding: 12px 18px;
    border: 0;
    border-radius: 10px;
    background: #10b981;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: none;
    text-transform: none;
}
.plsz-modal button.plsz-cta:disabled {
    background: #9ca3af;
    cursor: default;
}

.plsz-box.is-busy .plsz-body,
.plsz-box.is-busy .plsz-head { pointer-events: none; opacity: 0.6; }
.plsz-box.is-busy .plsz-error { pointer-events: auto; opacity: 1; }

.plsz-spin {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #e5e7eb;
    border-top-color: #6c5ce7;
    border-radius: 50%;
    animation: plsz-spin 0.8s linear infinite;
}
@keyframes plsz-spin { to { transform: rotate(360deg); } }

/* Botón en la ficha, junto a la vista previa del diseño */
.pldesigner-btn.plsz-open-btn {
    display: block;
    width: 100%;
    margin: 8px 0;
    background: linear-gradient(135deg, #10b981, #059669);
}

@media (max-width: 560px) {
    .plsz-modal { padding: 0; }
    .plsz-box { border-radius: 0; height: 100%; }
    .plsz-body { padding: 12px; }
    .plsz-card { flex-direction: column; gap: 6px; padding: 10px; }
    .plsz-thumb { display: none; }
    .plsz-mini { display: block; }
    .plsz-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .plsz-sz { padding: 5px 2px; }
    .plsz-modal .plsz-step button { width: 30px; height: 30px; }
    .plsz-modal .plsz-step input { width: 28px; }
    .plsz-foot { padding: 10px 12px; }
    .plsz-modal button.plsz-cta { padding: 12px; font-size: 14px; }
}
