.pnqr-studio {
    --pnqr-orange: #ff6a00;
    --pnqr-orange-dark: #e95e00;
    --pnqr-text: #252525;
    --pnqr-muted: #6e6e73;
    --pnqr-line: #e6e6e8;
    --pnqr-soft: #f6f6f7;
    --pnqr-card: #ffffff;
    color: var(--pnqr-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.45;
}

.pnqr-studio *,
.pnqr-studio *::before,
.pnqr-studio *::after { box-sizing: border-box; }


/* Evita que grids, tabs o inputs ensanchen la página en pantallas pequeñas */
.pnqr-app,
.pnqr-panel,
.pnqr-fields,
.pnqr-type-panel,
.pnqr-field,
.pnqr-grid-2,
.pnqr-color-row,
.pnqr-upload-row {
    min-width: 0;
    max-width: 100%;
}


/* Integración con páginas internas de Pixel Naranja */
body.pnqr-page .pme-page__header {
    display: none !important;
}

body.pnqr-page .pme-page > .pme-section {
    padding-top: clamp(24px, 3vw, 42px);
}

body.pnqr-page .pme-page__content {
    margin-top: 0;
}

.pnqr-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 8px auto 42px;
}

.pnqr-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.pnqr-kicker {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--pnqr-orange);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
}

.pnqr-header h1 {
    margin: 0;
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1;
    letter-spacing: -0.045em;
}

.pnqr-header p {
    margin: 10px 0 0;
    color: var(--pnqr-muted);
    font-size: 17px;
}

.pnqr-badge {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid #ffd3b3;
    border-radius: 999px;
    background: #fff4ec;
    color: #9a3f00;
    font-size: 12px;
    font-weight: 700;
}

.pnqr-badge__dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--pnqr-orange);
    box-shadow: 0 0 0 4px rgba(255, 106, 0, .10);
}

.pnqr-app {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
    gap: 20px;
    align-items: start;
}

.pnqr-panel {
    background: var(--pnqr-card);
    border: 1px solid var(--pnqr-line);
    border-radius: 24px;
    box-shadow: 0 18px 55px rgba(40, 40, 45, .06);
}

.pnqr-panel--controls { padding: 24px; }
.pnqr-panel--preview {
    position: sticky;
    top: 24px;
    padding: 22px;
}

.pnqr-tabs {
    display: flex;
    width: 100%;
    max-width: 100%;
    gap: 8px;
    overflow-x: auto;
    padding: 4px;
    margin: -4px -4px 22px;
    scrollbar-width: none;
}
.pnqr-tabs::-webkit-scrollbar { display: none; }

.pnqr-tab {
    appearance: none;
    border: 1px solid var(--pnqr-line);
    background: #fff;
    color: #555;
    border-radius: 999px;
    padding: 9px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: .18s ease;
}

.pnqr-tab:hover { border-color: #cfcfd3; color: var(--pnqr-text); }
.pnqr-tab.is-active {
    background: var(--pnqr-text);
    border-color: var(--pnqr-text);
    color: #fff;
}

.pnqr-fields { min-height: 152px; }
.pnqr-type-panel[hidden] { display: none !important; }

.pnqr-field {
    display: grid;
    gap: 7px;
    margin: 0 0 16px;
    color: #444;
    font-size: 13px;
    font-weight: 700;
}

.pnqr-field small { color: var(--pnqr-muted); font-weight: 500; }

.pnqr-field input[type="text"],
.pnqr-field input[type="url"],
.pnqr-field input[type="tel"],
.pnqr-field input[type="email"],
.pnqr-field textarea,
.pnqr-field select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d9d9dc;
    border-radius: 12px;
    background: #fff;
    color: var(--pnqr-text);
    padding: 11px 13px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.pnqr-field textarea { min-height: 92px; resize: vertical; }

.pnqr-field input:focus,
.pnqr-field textarea:focus,
.pnqr-field select:focus {
    border-color: var(--pnqr-orange);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, .12);
}

.pnqr-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.pnqr-field--check {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    margin-top: 25px;
    padding: 0 4px;
}

.pnqr-field--check input { width: 17px; height: 17px; accent-color: var(--pnqr-orange); }

.pnqr-divider { height: 1px; background: var(--pnqr-line); margin: 4px 0 22px; }

.pnqr-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.pnqr-section-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }

.pnqr-link-button {
    border: 0;
    background: transparent;
    color: var(--pnqr-orange-dark);
    padding: 4px 0;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.pnqr-color-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
}

.pnqr-color-row input[type="color"] {
    width: 48px;
    height: 46px;
    border: 1px solid #d9d9dc;
    border-radius: 12px;
    background: #fff;
    padding: 4px;
    cursor: pointer;
}

.pnqr-upload-row { display: flex; gap: 10px; align-items: center; }
.pnqr-upload-row input[type="file"] {
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px dashed #d2d2d7;
    border-radius: 12px;
    background: var(--pnqr-soft);
    font-size: 13px;
    font-weight: 500;
}

.pnqr-field input[type="range"] { width: 100%; accent-color: var(--pnqr-orange); }

.pnqr-preview-card {
    display: grid;
    place-items: center;
    min-height: 360px;
    padding: 22px;
    border-radius: 18px;
    background:
        radial-gradient(circle at 20% 10%, rgba(255,106,0,.08), transparent 34%),
        var(--pnqr-soft);
}

.pnqr-preview {
    display: grid;
    place-items: center;
    width: min(100%, 300px);
    aspect-ratio: 1;
}

.pnqr-preview canvas,
.pnqr-preview svg,
.pnqr-preview img { max-width: 100% !important; height: auto !important; }

.pnqr-status {
    margin: 12px 0 0;
    color: var(--pnqr-muted);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.pnqr-field--compact { margin: 18px 0 12px; }

.pnqr-downloads { display: grid; gap: 10px; }

.pnqr-primary-button,
.pnqr-secondary-button {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 15px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    min-height: 48px;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.pnqr-primary-button {
    width: 100%;
    background: var(--pnqr-orange);
    color: #fff;
    border-color: var(--pnqr-orange);
    box-shadow: 4px 4px 0 var(--pnqr-text);
}
.pnqr-primary-button:hover {
    background: var(--pnqr-orange-dark);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--pnqr-text);
}
.pnqr-primary-button:focus-visible,
.pnqr-secondary-button:focus-visible {
    outline: 3px solid rgba(255, 106, 0, .24);
    outline-offset: 2px;
}

.pnqr-secondary-button {
    background: #fff;
    border-color: #d9d9dc;
    color: #3a3a3c;
}
.pnqr-secondary-button:hover { border-color: #bdbdc3; transform: translateY(-1px); }
.pnqr-secondary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.pnqr-secondary-button--full { width: 100%; }

.pnqr-privacy {
    display: grid;
    gap: 4px;
    margin-top: 16px;
    padding: 13px 14px;
    border: 1px solid #e4e4e7;
    border-radius: 14px;
    background: #fbfbfc;
    color: var(--pnqr-muted);
    font-size: 11px;
    line-height: 1.45;
}
.pnqr-privacy strong { color: #444; font-size: 12px; }

.pnqr-footer {
    margin-top: 18px;
    text-align: center;
    color: #8a8a8f;
    font-size: 12px;
}
.pnqr-footer a { color: inherit; text-decoration: none; font-weight: 700; }
.pnqr-footer a:hover { color: var(--pnqr-orange); }

@media (max-width: 850px) {
    body.pnqr-page .pme-page > .pme-section { padding-top: 20px; }
    .pnqr-shell { width: min(100% - 20px, 720px); margin: 0 auto 30px; }
    .pnqr-header { align-items: flex-start; flex-direction: column; gap: 14px; }
    .pnqr-app { grid-template-columns: 1fr; }
    .pnqr-panel--controls { order: 1; }
    .pnqr-panel--preview { order: 2; position: static; }
}

@media (max-width: 560px) {
    body.pnqr-page .pme-page > .pme-section {
        padding-top: 16px;
        overflow-x: clip;
    }

    .pnqr-shell {
        width: calc(100% - 24px);
        max-width: 100%;
        margin-bottom: 26px;
    }

    .pnqr-header {
        gap: 12px;
        margin-bottom: 20px;
    }

    .pnqr-header h1 {
        font-size: clamp(38px, 11vw, 46px);
        line-height: .98;
    }

    .pnqr-header p {
        max-width: 32ch;
        font-size: 15px;
        line-height: 1.45;
    }

    .pnqr-badge {
        max-width: 100%;
        line-height: 1.3;
        white-space: normal;
    }

    .pnqr-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        border-radius: 18px;
        overflow: hidden;
    }

    .pnqr-panel--controls,
    .pnqr-panel--preview {
        padding: 14px;
    }

    /* En móvil los tipos se muestran completos: 3 columnas x 2 filas. */
    .pnqr-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        overflow: visible;
        padding: 0;
        margin: 0 0 20px;
    }

    .pnqr-tab {
        width: 100%;
        min-width: 0;
        padding: 10px 5px;
        font-size: 12px;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pnqr-grid-2,
    .pnqr-grid-2--design {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .pnqr-field,
    .pnqr-field input,
    .pnqr-field textarea,
    .pnqr-field select {
        min-width: 0;
        max-width: 100%;
    }

    .pnqr-field input[type="text"],
    .pnqr-field input[type="url"],
    .pnqr-field input[type="tel"],
    .pnqr-field input[type="email"],
    .pnqr-field textarea,
    .pnqr-field select {
        font-size: 16px;
    }

    .pnqr-color-row {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .pnqr-field--check {
        margin-top: 0;
        min-height: auto;
        margin-bottom: 16px;
    }

    .pnqr-upload-row {
        align-items: stretch;
        flex-direction: column;
    }

    .pnqr-preview-card {
        min-height: 0;
        padding: 16px;
    }

    .pnqr-preview {
        width: min(100%, 280px);
    }
}
