/* Editor de etiquetas de producto — estilo Apple */

.etq-modal {
    position: fixed;
    inset: 0;
    z-index: 10030;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.etq-modal.active {
    display: flex;
}

.etq-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.36);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
}

.etq-modal-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1180px, 96vw);
    height: min(820px, 90vh);
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    color: #1d1d1f;
}

.etq-modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid #e5e5ea;
    background: #fff;
    flex-shrink: 0;
}

.etq-modal-top h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.etq-modal-top p {
    margin: 2px 0 0;
    font-size: 12px;
    color: #86868b;
}

.etq-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #f2f2f7;
    color: #1d1d1f;
    cursor: pointer;
}

.etq-icon-btn:hover {
    background: #e8e8ed;
}

.etq-split {
    display: flex;
    flex: 1;
    min-height: 0;
}

.etq-preview-pane {
    flex: 1.08;
    background: #f5f5f7;
    position: relative;
    min-width: 0;
}

.etq-preview-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.etq-preview-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transform-origin: center center;
    flex-shrink: 0;
}

.etq-label {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.8mm;
    overflow: hidden;
    color: #111;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

.etq-block {
    line-height: 1.2;
    word-break: break-word;
}

.etq-code-img {
    width: auto;
    max-width: 100%;
    display: inline-block;
    vertical-align: middle;
    image-rendering: pixelated;
}

.etq-digits {
    font-size: 7pt;
    letter-spacing: 0.04em;
    margin-top: 0.5mm;
}

.etq-code-placeholder {
    display: inline-block;
    min-width: 18mm;
    min-height: 12mm;
    border: 1px dashed #c7c7cc;
    border-radius: 4px;
    color: #aeaeb2;
    font-size: 8pt;
    line-height: 12mm;
    padding: 0 4px;
}

.etq-config-pane {
    flex: 0 0 420px;
    width: 420px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-left: 1px solid #e5e5ea;
    background: #fff;
}

.etq-config-scroll {
    flex: 1;
    overflow: auto;
    padding: 18px 20px 12px;
}

.etq-section {
    margin-bottom: 22px;
}

.etq-section-title {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #86868b;
}

.etq-card {
    background: #f5f5f7;
    border-radius: 14px;
    padding: 12px;
}

.etq-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.etq-chip {
    border: 1px solid #d2d2d7;
    background: #fff;
    color: #1d1d1f;
    border-radius: 980px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.etq-chip:hover {
    border-color: #b0b0b5;
}

.etq-chip.active {
    background: #1d1d1f;
    border-color: #1d1d1f;
    color: #fff;
}

.etq-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.etq-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.etq-field label,
.etq-field-lab {
    display: block;
    font-size: 11px;
    color: #6e6e73;
    margin-bottom: 4px;
}

.etq-input {
    width: 100%;
    box-sizing: border-box;
    border: 0;
    background: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    color: #1d1d1f;
    outline: none;
    box-shadow: inset 0 0 0 1px #e5e5ea;
}

.etq-input:focus {
    box-shadow: inset 0 0 0 2px #1d1d1f;
}

.etq-seg {
    display: flex;
    background: #e8e8ed;
    border-radius: 9px;
    padding: 2px;
    gap: 0;
}

.etq-seg button {
    flex: 1;
    border: 0;
    background: transparent;
    border-radius: 7px;
    padding: 6px 8px;
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
    cursor: pointer;
}

.etq-seg button.active {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.etq-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 2px;
}

.etq-row-between span {
    font-size: 14px;
}

.etq-switch {
    position: relative;
    width: 42px;
    height: 26px;
    flex-shrink: 0;
}

.etq-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.etq-switch-ui {
    position: absolute;
    inset: 0;
    background: #e5e5ea;
    border-radius: 13px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.etq-switch-ui::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease;
}

.etq-switch input:checked + .etq-switch-ui {
    background: #34c759;
}

.etq-switch input:checked + .etq-switch-ui::after {
    transform: translateX(16px);
}

.etq-range-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.etq-range-row input[type="range"] {
    flex: 1;
    accent-color: #1d1d1f;
}

.etq-range-val {
    min-width: 46px;
    font-size: 12px;
    color: #6e6e73;
    text-align: right;
}

.etq-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.etq-field-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f5f5f7;
    border-radius: 14px;
    padding: 10px;
}

.etq-field-row.is-dragging {
    opacity: 0.45;
}

.etq-grab {
    border: 0;
    background: transparent;
    color: #aeaeb2;
    cursor: grab;
    padding: 4px 2px;
    line-height: 1;
    flex-shrink: 0;
}

.etq-field-main {
    flex: 1;
    min-width: 0;
}

.etq-field-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.etq-field-controls {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 6px;
    align-items: center;
}

.etq-field-controls-text {
    margin-top: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.etq-field-hint {
    font-size: 12px;
    color: #86868b;
}

.etq-move {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.etq-move button {
    width: 26px;
    height: 22px;
    border: 0;
    background: #fff;
    border-radius: 6px;
    color: #6e6e73;
    cursor: pointer;
    font-size: 10px;
}

.etq-move button:hover {
    color: #1d1d1f;
}

.etq-bold-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    font-weight: 700;
    cursor: pointer;
    color: #6e6e73;
}

.etq-bold-btn.active {
    background: #1d1d1f;
    color: #fff;
}

.etq-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px 16px;
    border-top: 1px solid #e5e5ea;
    background: #fff;
    flex-shrink: 0;
}

.etq-footer-left,
.etq-footer-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.etq-btn {
    border: 0;
    border-radius: 980px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.etq-btn-ghost {
    background: transparent;
    color: #6e6e73;
}

.etq-btn-ghost:hover {
    background: #f2f2f7;
    color: #1d1d1f;
}

.etq-btn-secondary {
    background: #f2f2f7;
    color: #1d1d1f;
}

.etq-btn-secondary:hover {
    background: #e8e8ed;
}

.etq-btn-primary {
    background: #1d1d1f;
    color: #fff;
}

.etq-btn-primary:hover {
    background: #000;
}

.etq-custom-size[hidden] {
    display: none !important;
}

@media (max-width: 860px) {
    .etq-modal {
        padding: 0;
    }

    .etq-modal-card {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .etq-split {
        flex-direction: column;
    }

    .etq-preview-pane {
        flex: 0 0 38vh;
    }

    .etq-config-pane {
        flex: 1;
        width: auto;
        border-left: 0;
        border-top: 1px solid #e5e5ea;
    }
}
